This repository was archived by the owner on Dec 19, 2023. It is now read-only.
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Question: Coroutine drawbacks in resolvers and recommended implementation? #321
Closed
Description
I noticed that graphql-java-tools supports coroutines (suspend functions) in resolvers and was curious of two things:
- are there any potential drawbacks to using
suspend
over a normalCompletableFuture.supplyAsync
in query/type resolvers? (it seems to useGlobalScope
which, the Kotlin docs make sound like should be avoided in most cases, but I'm still working on understanding it fully) - is there a recommended implementation for using suspend functions in query/type resolvers? (like providing your own coroutine context or just allowing the default, etc.)