Fork me on GitHub

The Fullstack Tutorial for GraphQL,, ported from Javascript to Clojure/script: Blog post: Source code GitHub repo: Suggestions and corrections, more than welcome. Hope it to be useful for anyone interested.


Q: I want to use lacinia-pedestal to use a non-blocking micro-service call in a resolver. I’ve looked at the tests for async but I’m wondering if there’s any other samples out there of implementing resolvers this way?


@UDF11HLKC yes that is close however I believe the resolvers in a lacinia-pedestal environment might be slightly different from vanilla Lacinia. The reason I suspect this is that Pedestal runs async when an interceptor returns a core.async channel so I’m not clear on the right way to implement. I’ll keep digging but thanks for your response.


Lacinia-pedestal can run in two modes; there's an option for that. In mode 1, it blocks while query executes; individual resolvers may be sync or async. This will result in a Jetty request thread being blocked. In mode 2, it returns a channel while the query executes async. Resolvers may be async or not.


There's also a thead pool you can optionally specify (so that you don't accidentally do lots of work and/or block a go thread).