This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-29
Channels
- # aws (8)
- # babashka (45)
- # beginners (83)
- # cider (23)
- # clj-on-windows (4)
- # cljdoc (23)
- # clojars (6)
- # clojure (68)
- # clojure-dev (33)
- # clojure-europe (75)
- # clojure-nl (1)
- # clojure-uk (4)
- # clojurescript (14)
- # conjure (6)
- # data-science (15)
- # datascript (7)
- # datomic (47)
- # docker (15)
- # events (1)
- # fulcro (4)
- # graphql (3)
- # jobs (4)
- # lsp (14)
- # nginx (2)
- # nrepl (2)
- # off-topic (41)
- # pathom (18)
- # pedestal (1)
- # polylith (72)
- # reitit (8)
- # reveal (1)
- # shadow-cljs (48)
- # tools-build (11)
- # tools-deps (24)
- # xtdb (8)
So on the topic of subscriptions. Our schema has a dataloader (superlifter) that is started in an interceptors :enter
, and cleaned up in an interceptors :leave
. Now, in the lacinia.pedestals subscription attaching, I can pass an interceptor chain, but it seems that the chain is executed in both directions prior to me even calling source-stream
. So I was wondering whether there is a way to do ‘around’ actions like this for single invocations of source-stream
. I mean, like ‘data loader start’ -> ‘source stream calling’ -> ‘nested selection resolving (using the dataloader)’ -> ‘dataloader cleanup’.
I tried to do the obvious, right, starting the dataloader, calling source stream, stopping the dataloader. But source-stream
returns immediately. As far as I can tell before executing the nested selection. So the dataloader is cleaned up prior to it being needed :’).
So a solution I came up with is running an interceptor chain around resolving the query after a value was produced on the source-stream
. Therefore, I have made a slight alteration of the execute-operation-interceptor
interceptor to do so.
I don’t know what to think about it, tho…