This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-28
Channels
- # announcements (30)
- # architecture (9)
- # aws (2)
- # babashka (23)
- # beginners (55)
- # cider (22)
- # clj-kondo (40)
- # clojure (47)
- # clojure-europe (4)
- # clojure-france (2)
- # clojure-italy (17)
- # clojure-nl (16)
- # clojure-norway (1)
- # clojure-sanfrancisco (1)
- # clojure-seattle (1)
- # clojure-spec (12)
- # clojure-uk (34)
- # clojured (3)
- # clojurescript (15)
- # core-async (11)
- # cursive (19)
- # data-science (3)
- # emacs (7)
- # events (4)
- # figwheel-main (10)
- # fulcro (33)
- # graalvm (49)
- # graphql (11)
- # instaparse (1)
- # java (7)
- # kaocha (1)
- # leiningen (7)
- # malli (3)
- # meander (69)
- # pathom (9)
- # re-frame (4)
- # rum (2)
- # shadow-cljs (34)
- # spacemacs (9)
- # sql (29)
- # tree-sitter (1)
- # yada (3)
FYI there is err in https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/connect/resolvers.html#_single_attribute_resolvers - the text reads "use single-attr-resolver2" but the code below (pc/single-attr-resolver ::some-value ::other-value single-with-env))
I have a defresolver that already returns some of the nested attributes after running a big composed sql query with json aggregates, how can I query these nested attributes? I get :com.wsscode.pathom.core/not-found while if I don't ask for any and just put the key I get the map that is there in the reply
interstingly if I use placeholder syntax I get the queried attributes, but only because another resolver is used for that
In graphql I had
(defn- idempotent [field next] (fn [root args context info]
(if-let [field-value (get (utils/gql->clj root) field)]
field-value
(next root args context info))))
around resolvers for attributes that might have already been solved by earlier resolversWhat would be the best approach with pathom? So far I'm pretty stoked by the lib and looking forward to replace graphql entirely
ok it was somewhat easier than I thought, I simply add to nest the subfields in the ::pc/output
I guess the doc could show an example of that, I was hinted by https://wilkerlucio.github.io/pathom/#_query_notation_introduction
actually the reason I couldn't get it to work was slightly more complex, I was reading :query in the ast to get the fields and compose the sql query and naively expected keywords, but ofc as soon as I started specifying subfields, the elements in the query also contained maps, so my sql query didn't contain the field I was looking for anymore 😄
