This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-11
Channels
- # adventofcode (31)
- # announcements (6)
- # babashka (5)
- # beginners (93)
- # calva (15)
- # cider (20)
- # cljs-dev (16)
- # clojure (159)
- # clojure-berlin (1)
- # clojure-dev (5)
- # clojure-europe (9)
- # clojure-italy (9)
- # clojure-losangeles (2)
- # clojure-nl (26)
- # clojure-spec (7)
- # clojure-uk (33)
- # clojurescript (54)
- # clojutre (5)
- # cursive (20)
- # datomic (23)
- # emacs (19)
- # events (1)
- # expound (1)
- # figwheel-main (1)
- # fulcro (104)
- # hyperfiddle (1)
- # jobs (1)
- # luminus (10)
- # malli (59)
- # nrepl (1)
- # off-topic (11)
- # pathom (5)
- # planck (15)
- # reagent (13)
- # reitit (8)
- # rewrite-clj (10)
- # ring-swagger (3)
- # shadow-cljs (129)
- # tools-deps (46)
- # xtdb (14)
- # yada (1)
I’m attempting to make a single-input resolver to handle a pull-like query based on an ident like this: [{[:agency/id "123"] [:db/id :agency/Active :agency/Name ,,, {:agency/Projects [:db/id :project/Name ,,,]}]}]
I’m needing the query and the list of keys, but the problem is that the :query
key is missing from the AST and only the first query key is mentioned in the AST: {:type :prop, :dispatch-key :db/id, :key :db/id}
What’s the right way to do this? The resolver returns everything if I just blindly do a [*]
wildcard pull, but I’d rather shape it for the actual query
@thosmos resolvers are triggered during attribute processing, that's the reason you get the single :db/id
, to look back you can use ::p/parent-query
from env, I guess that's the one you are looking for
@wilkerlucio thanks I missed that when I looked at the env keys!
What’s doing the sub-select of the AST before handing it to the resolver? I ask because to me these two queries are effectively the same context but the second just narrows the scope down to one result: [{:agencies [:db/id ,,,]}]
[{[:agency/id 1][:db/id ,,,]}]
In other words, how I think about it, :agencies
and [:agency/id 1]
are the root keys in these two similar queries, and as I’m attempting to resolve these, I would expect the :agency/id
to be in the the root node of the AST with all of its first level query attributes as its children. In order to get this, would I modify the reader?