This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-31
Channels
- # announcements (7)
- # asami (2)
- # babashka (47)
- # beginners (8)
- # calva (42)
- # clj-kondo (58)
- # cljdoc (1)
- # clojure (88)
- # clojure-europe (11)
- # clojurescript (6)
- # conjure (7)
- # data-science (5)
- # emacs (9)
- # events (1)
- # holy-lambda (3)
- # introduce-yourself (5)
- # meander (3)
- # missionary (4)
- # nbb (18)
- # obb (5)
- # off-topic (1)
- # other-languages (10)
- # pathom (2)
- # reagent (6)
- # releases (3)
- # ring (3)
- # scittle (1)
- # shadow-cljs (1)
- # spacemacs (2)
- # xtdb (6)
How do I get to params in foreign AST? So I have a dynamic resolver, which trigger with query [{([:my/id 1] {:param/test "test"}) [:my/name]}]
so query with an ident with a param on it. The foreign AST my dynamic resolver gets is {:type :root :children […. node for :my/name]}
. I couldn’t find :param/test
anywhere in the whole environment in my dynamic resolver resolve function
you are probably asking how to access "parent" params in :my/name
resolver.
Well, pathom do not "support" that, but as #fulcro add the parameters in this place by default, I used to use a code like this in one of my projects:
(defn eql-api
[req]
(let [query (... req)
ast (eql/query->ast query)
root-params (-> ast
:children
(->> (keep :params)
(apply merge)))
result (parser (assoc env :root-params root-params)
query)]
{:status 200
:body result ...}))