This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-04
Channels
- # announcements (3)
- # aws (13)
- # babashka (10)
- # beginners (30)
- # biff (1)
- # calva (59)
- # chlorine-clover (11)
- # cider (3)
- # circleci (2)
- # clojars (22)
- # clojure (21)
- # clojure-europe (2)
- # clojurescript (10)
- # core-typed (2)
- # fulcro (8)
- # girouette (12)
- # graphql (1)
- # helix (6)
- # inf-clojure (4)
- # joyride (6)
- # leiningen (7)
- # off-topic (3)
- # pathom (44)
- # polylith (13)
- # shadow-cljs (44)
- # tools-deps (1)
Hi, eveyone, how to write batch query in df/load!
? I tried something like below, got the error Assert failed: (or (eql/ident? server-property-or-ident) (keyword? server-property-or-ident))
(defsc File
[_ _]
{:ident :file/key
:query [:file/key :file/name]})
(df/load!
app
[[:file/key k1] [:file/key k2]]
File
{:ok-action (fn [env]
;; update state here
))}
Arg 2 must be either a server property or an ident, which is what that assertion failure is trying to tell you
you gave it a seq of idents which isn't supported--probably you want a single call to df/load! per ident, or a call to load! on a parent component
What i want is to use the batch query as described https://blog.wsscode.com/pathom/#_n1_queries_and_batch_resolvers
I think the "right" way to do that is just to call load!
on a parent component--then pathom will see the EQL query 's list of child idents and use your batch resolver