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

Wrap Query with execueBlocking #7

Open
a-marcel opened this issue May 18, 2017 · 3 comments
Open

Wrap Query with execueBlocking #7

a-marcel opened this issue May 18, 2017 · 3 comments

Comments

@a-marcel
Copy link
Contributor

Hello,

so you see this: https://github.com/vert-x3/vertx-examples/blob/master/core-examples/src/main/java/io/vertx/example/core/execblocking/ExecBlockingExample.java

i just ask, if it's possible to wrap SchemaDefinition.class

@Override
    public void queryWithVariables(String graphqlQuery, JsonObject variables,
                                    Handler<AsyncResult<QueryResult>> resultHandler) {
        try {
            QueryResult result = queryBlocking(graphqlQuery, variables);
            resultHandler.handle(Future.succeededFuture(result));
        } catch (RuntimeException ex) {
            resultHandler.handle(Future.failedFuture(ex));
        }
    }

I know it's not perfect, but otherwise, a syncron datafetcher will block the thread. and it should be an easy task until graphql-java has the async implementation ?

Or are they other concerns and it will not work ?

Thanks
Marcel

@aschrijver
Copy link
Contributor

Thanks Marcel, for your PR, which I merged into a separate branch as explained in the PR comment.

@a-marcel
Copy link
Contributor Author

Please use #10 now. It contains the new java graphl version

@aschrijver
Copy link
Contributor

@marcelalburg thanks for PR'ing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants