This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-20
Channels
- # announcements (3)
- # babashka (7)
- # beginners (36)
- # calva (71)
- # cider (25)
- # clj-commons (5)
- # cljdoc (19)
- # cljs-dev (5)
- # clojure (223)
- # clojure-austin (2)
- # clojure-bay-area (1)
- # clojure-europe (31)
- # clojure-france (6)
- # clojure-nl (2)
- # clojure-norway (19)
- # clojure-spec (13)
- # clojure-uk (7)
- # clojurescript (127)
- # core-logic (2)
- # cursive (21)
- # datalevin (53)
- # datomic (9)
- # emacs (37)
- # events (1)
- # graphql (8)
- # jobs (12)
- # lsp (8)
- # off-topic (92)
- # pathom (49)
- # pedestal (1)
- # polylith (3)
- # re-frame (25)
- # releases (2)
- # sci (11)
- # shadow-cljs (13)
- # vim (10)
in Lacinia, is there any way to convince the execution engine to run the resolvers for each item in a collection in parallel? I’m returning a vector of datomic entity maps, and from the tracing data it looks like it’s running the field resolvers for each map in the collection serially. I.e. it’s doing “map” but I want “pmap”
I know about this, but this is about resolving an individual field/value. I can’t see how this can give me any control over the parallelism of nested resolvers
There is https://github.com/vlaaad/plusinia that allows parallelizing (and batching) resolution process, at the expense that you have to opt-in for every resolver to work on a set of values instead of a single value
I think in my case I have an alternative. My return value is actually [{:node v1} {:node v2},,,]
(think Connection like result https://graphql.org/learn/pagination/#complete-connection-model). So I can make the resolver for :node
return a promise which I immediately (asynchronously) deliver, and then I know the on-deliver chain of resolvers lacinia attaches will run in parallel. That’s enough parallelism for me in this case. It seems to work! I deliver the promise value using an agent send
, but set the *callback-executor*
to the agent send-off
threadpool because those other resolvers may involve IO.
If I didn’t have that extra nesting via the :node
field to rely on, I’m not sure what I could have done here.
Hello everybody!
I'd like to announce [io.github.timrichardt/hicgql "0.1.0"]
, a tiny library I wrote to create GraphQL documents in ClojureScript.
It's modeled after Hiccup and should cover the whole GraphQL spec.
I am happy for any feedback.
https://github.com/timrichardt/hicgql