Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using DataLoader from suspend function #653

Commits on Mar 21, 2023

  1. support returning dataloader from suspend function

    Rudimentary implementation to support returning a `CompletableFuture` from a suspend fun.
    
    `CoroutinesUtils.invokeSuspendingFunction` wraps the return value of the function in a `Mono` (or `Flux`). But it also does this when a `CompletableFuture` is returned, and thus results in a `Mono<CompletableFuture<?>>`, which isn't captured by graphql-java, and thus the dataloader is never dispatched.
    
    By unwrapping the future, and _converting_ it to a mono (as opposed to wrapping), the dataloader seems to be dispatched correctly.
    koenpunt committed Mar 21, 2023
    Configuration menu
    Copy the full SHA
    d580c04 View commit details
    Browse the repository at this point in the history