walmartlabs / lacinia

GraphQL implementation in pure Clojure
http://lacinia.readthedocs.io/en/latest/
Other
1.82k stars 160 forks source link

Use of executor/selection in streamer functions #426

Closed happy-river closed 2 years ago

happy-river commented 2 years ago

I'm not sure if this is a lacinia issue or a lacinia-pedestal issue, but I suspect the former. When resolver functions are called, :com.walmartlabs.lacinia/selection is set in the context so they can use executor/selection, but when a streamer function is called, it is not set.

I'm currently working around this in my use of lacinia-pedestal by adding an interceptor that calls executor/parsed-query->context to my list of subscription interceptors, but it seems like it ought to be the responsibility of one or the other of the libraries. I'd be happy to work on a PR for it if you could give me some guidance on where it ought to go.

hlship commented 2 years ago

This seems like a bug to me too, but let me think about it and check the code first.