Skip to content

Allow Asynchronous Execution And Fetching In GraphQL Java #324

@karthicks

Description

@karthicks

Currently, the GraphQL.execute(request) method blocks until the result is ready, unlike graphql-js, which lets you handle the result in a callback.

Here, we propose an asynchronous rendition of graphql-java, which will allow you to not only execute a GraphQL request in a non-blocking manner, but also permit the data fetcher to wrap it's results in a CompletableFuture.

Since our implementation relies on a Java 8 feature, it is being published as a separate project called graphql-java-async, so as to not impinge on graphql-java's Java 6 compatibility requirements.

A non-blocking version of the famous "hello world" can be found in the README file. A more involved scenario involving publishing and subscribing to news articles can be seen in this groovy test case.

Is this something that could go as a "related project" under graphql-java?

-Karthick Sankarachary

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions