vertx-graphql-service-discovery icon indicating copy to clipboard operation
vertx-graphql-service-discovery copied to clipboard

Wrap Query with execueBlocking

Open a-marcel opened this issue 8 years ago • 3 comments

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

a-marcel avatar May 18 '17 20:05 a-marcel

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

aschrijver avatar Jun 02 '17 11:06 aschrijver

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

a-marcel avatar Sep 18 '17 22:09 a-marcel

@marcelalburg thanks for PR'ing :+1:

aschrijver avatar Sep 19 '17 05:09 aschrijver