This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-23
Channels
- # babashka (22)
- # beginners (8)
- # calva (7)
- # clj-kondo (65)
- # cljdoc (9)
- # cljsrn (1)
- # clojure (53)
- # clojure-australia (4)
- # clojure-europe (49)
- # clojure-gamedev (2)
- # clojure-italy (13)
- # clojure-nl (1)
- # clojure-spec (19)
- # clojure-uk (4)
- # clojurescript (48)
- # clojureverse-ops (1)
- # core-async (3)
- # css (2)
- # cursive (15)
- # datomic (6)
- # degree9 (2)
- # depstar (4)
- # emacs (2)
- # find-my-lib (1)
- # fulcro (16)
- # graalvm (11)
- # gratitude (1)
- # honeysql (9)
- # introduce-yourself (2)
- # jobs (1)
- # joker (2)
- # livestream (2)
- # malli (16)
- # nbb (4)
- # news-and-articles (2)
- # off-topic (1)
- # pathom (7)
- # polylith (10)
- # practicalli (1)
- # re-frame (7)
- # reitit (1)
- # releases (3)
- # remote-jobs (1)
- # rewrite-clj (19)
- # shadow-cljs (10)
- # tools-build (1)
- # tools-deps (9)
- # uncomplicate (1)
- # vim (3)
- # xtdb (44)
I'm a bit stuck on a use case. I'm wanting to take the example from https://blog.wsscode.com/pathom/v2/pathom/2.2.0/connect/resolvers.html#_n1_queries_and_batch_resolvers , but instead of having the total stored under :items
, instead bring it up to the top level map next to :items
as something like :total-items
.
I'm not sure how to add the nested query into the inputs set on a resolver, or even if it's possible
I've been playing with
(pc/defresolver total-items-resolver
{::pc/input #{[{:items [:number]}]}
::pc/output [:total-items}
...)
and request with
(parser {} [:total-items])
which in my mind matches the list-things
resolver from the example, then can operate on that.
So far I can't figure out how to do it. Is there a way to do this currently or am I barking up the wrong tree?hello, it looks like what you want is nested inputs, Pathom 2 doesn't have support for that
Pathom 3 does support it: https://pathom3.wsscode.com/docs/resolvers#nested-inputs
Are pathom 2.4 resolvers and mutations directly invokable like they are in pathom 3?
I want to unit test them in isolation (without a parser)
The answer is no, they are just maps.