This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-28
Channels
- # aleph (7)
- # babashka (13)
- # beginners (10)
- # biff (4)
- # calva (75)
- # cljs-dev (22)
- # clojure (55)
- # clojure-berlin (1)
- # clojure-europe (15)
- # clojure-nl (1)
- # clojure-norway (35)
- # clojure-serbia (1)
- # clojure-uk (2)
- # clojurescript (46)
- # community-development (1)
- # core-async (23)
- # data-science (1)
- # datalevin (2)
- # datascript (10)
- # datomic (11)
- # fulcro (28)
- # helix (12)
- # hyperfiddle (26)
- # introduce-yourself (4)
- # malli (16)
- # off-topic (1)
- # pathom (4)
- # pedestal (1)
- # polylith (12)
- # quil (11)
- # releases (3)
- # scittle (24)
- # shadow-cljs (85)
- # specter (1)
- # sql (9)
- # xtdb (5)
Hello everyone! Is there a way to pass params to a nested resolver?
hello, can you give an example of what you are looking for?
Sure!
I have a resolver that returns :acme/companies
That resolver's input is :acme/company-reponses
though, which is an output of another resolver that actually does the network request (I followed one of the tutorials on Pathom's website).
The "client" calls Pathom to get :acme/companies
but there's a bit of information that the "client" has that the network request needs. Let's call it extra-fields
.
So if the client passed extra-fields
as a parameter, only the top level resolver - the one that returns :acme/companies
will get it. But it would be cool if I can pass it to the :acme/company-responses
resolver.
The :acme/company-responses
resolver is batch, so I could pass the extra-fields
as part of every input item but that's not idea because the extra-fields
are shared for all the inputs so I'll be repeating the same extra-fields
which is error-prone and kinda looks not optimal.
As a workaround I've combined the two resolvers for now 😞 Which is a petty because I liked to have networking resolver separate - makes it easier to test the non-networking resolver separately.