This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-30
Channels
- # babashka (18)
- # beginners (90)
- # calva (33)
- # clara (6)
- # cljfx (11)
- # cljs-dev (22)
- # cljsrn (9)
- # clojure (71)
- # clojure-australia (2)
- # clojure-czech (15)
- # clojure-europe (27)
- # clojure-germany (9)
- # clojure-nl (4)
- # clojure-serbia (3)
- # clojure-uk (10)
- # clojurescript (17)
- # conjure (12)
- # data-oriented-programming (2)
- # deps-new (6)
- # fulcro (29)
- # graphql (10)
- # hugsql (6)
- # jobs (1)
- # lsp (59)
- # malli (8)
- # off-topic (76)
- # pathom (15)
- # polylith (130)
- # re-frame (9)
- # reagent (15)
- # releases (4)
- # rewrite-clj (6)
- # ring (6)
- # rum (9)
- # shadow-cljs (116)
- # specter (5)
- # testing (7)
- # tools-deps (24)
- # vim (6)
- # xtdb (17)
hi, i've been playing with p3 recently and found a weird behaviour on nested inputs resolvers: they mess up indicies in some way, both not working by themselves and making other resolvers invisible. here's a repro: http://nextjournal.com/fjolne/pathom3-nested-input-issue
i tried looking through pathom viz snapshots, but the logs did't make much sense: some existing relationships are marked as unreachable when I add nested inputs resolver
Has anyone tried to expose a bunch of resolvers as a GraphQL interface? I see examples where GraphQL is called by pathom, but never the other way around… It could be useful when you need to expose it to other frameworks/languages
@U66G3SGP5 For pathom2 there is https://github.com/denisidoro/graffiti for pathom3 there is still nothing available yet, there is an open discussion with ideas to achieve something similar https://github.com/wilkerlucio/pathom3/discussions/18
Interesting… thanks
also got a problem with p3 batch resolvers, created issues for both: https://github.com/wilkerlucio/pathom3/issues/29 , https://github.com/wilkerlucio/pathom3/issues/30
awesome, thanks, I'll have a look as soon as possible
is there anything special needed to get batch resolvers working with the parallel parser in pathom2? i’m running into some issues when i follow the docs here: https://blog.wsscode.com/pathom/v2/pathom/2.2.0/connect/resolvers.html#_n1_queries_and_batch_resolvers.
nothing special about parallel parser there, what issue you are facing?
Hmmm, I’ll keep digging. A query i have that normally takes ~20s (without batch) ends up having a lot of Insufficient resolver output
in the response. The basic resolver shape looks like this (which works when I have batch? false
)
(if (sequential? input#)
(->> input#
(mapv get-fn#)
promesa.core/all
cljs.core.async.interop/<p!
(mapv out-fn#))
(->> (get-fn# input#)
cljs.core.async.interop/<p!
out-fn#))
note this may be an error in your batch output
it must match exactly the input in number of items and order, otherwise you will have broken results
After digging into this more it seems to be due to there being two resolvers that can get to the same key. With batch it keeps spitting out insufficient resolver output
(referencing the resolver that shouldn’t be used) and without batch, pathom can appropriately get to the right resolver.
what’s strange is my basic query is below. The first one appropriately returns :user/id
however the second one has the insufficient resolver output which must be for :user.session/started-at
since it takes as input :session/id
and :user/id
.
;; Works with batch and non-batch
[{[:user/id "foo"]
[{:user/staff
[:user/id]}]}]
;; Doesn't work with batch, works with non-batch
[{[:user/id "foo"]
[{:user/staff
[:user/id
{(:>/session {:session/id "bar"})
[:user.session/started-at]}]}]}]