Open
Description
We're using java-graphql batch loaders (https://www.graphql-java.com/documentation/v15/batching/)
Instead of returning CompletableFuture
s in our resolver methods, I tried using kotlin suspend
functions, like this:
suspend fun loadUsers(env: DataFetchingEnvironment): List<UserGQL> {
val users = Context.getDataLoaders(env)
.usersLoader
.loadMany(listOf(1, 2, 3))
.await()
return users.map { UserGQL(it) }
}
However it seems to be hanging on the await
. I think it's blocking there, before java-graphql called the dispatch
on the registered data loaders (in DataLoaderRegistry).
What would be the best way to solve this? I couldn't really find examples in the documentation or the original pull request (#201)
Metadata
Metadata
Assignees
Labels
No labels