diff --git a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java index f0df7f5932297..b6f44d441a318 100644 --- a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java +++ b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLAbstractHandler.java @@ -58,22 +58,18 @@ public void handle(Object e) { @Override public void handle(final RoutingContext ctx) { - if (currentManagedContext.isActive()) { - handleWithIdentity(ctx); - } else { - + ctx.response() + .endHandler(currentManagedContextTerminationHandler) + .exceptionHandler(currentManagedContextTerminationHandler) + .closeHandler(currentManagedContextTerminationHandler); + if (!currentManagedContext.isActive()) { currentManagedContext.activate(); - ctx.response() - .endHandler(currentManagedContextTerminationHandler) - .exceptionHandler(currentManagedContextTerminationHandler) - .closeHandler(currentManagedContextTerminationHandler); - - try { - handleWithIdentity(ctx); - } catch (Throwable t) { - currentManagedContext.terminate(); - throw t; - } + } + try { + handleWithIdentity(ctx); + } catch (Throwable t) { + currentManagedContext.terminate(); + throw t; } } diff --git a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java index d153c2c9572b9..7ff8e8d403998 100644 --- a/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java +++ b/extensions/smallrye-graphql/runtime/src/main/java/io/quarkus/smallrye/graphql/runtime/SmallRyeGraphQLExecutionHandler.java @@ -196,8 +196,8 @@ private JsonObject getJsonObjectFromBody(RoutingContext ctx) throws IOException } private String readBody(RoutingContext ctx) { - if (ctx.getBody() != null) { - return ctx.getBodyAsString(); + if (ctx.body() != null) { + return ctx.body().asString(); } return null; }