vert-x3 / vertx-web

HTTP web applications for Vert.x
Apache License 2.0
1.11k stars 535 forks source link

GraphQL: Combination of request batching and Automatic Persisted Queries fails #2622

Open jellenelis opened 5 months ago

jellenelis commented 5 months ago

We have successfully executed requests using Automatic Persisted Queries and request batching separately. However, when these two features are combined, the following exception occurs.

graphql.AssertException: query can't be null at graphql.Assert.throwAssert(Assert.java:207) at graphql.Assert.assertNotNull(Assert.java:31) at graphql.ExecutionInput$Builder.query(ExecutionInput.java:221) at io.vertx.ext.web.handler.graphql.impl.GraphQLHandlerImpl.execute(GraphQLHandlerImpl.java:417) at io.vertx.ext.web.handler.graphql.impl.GraphQLHandlerImpl.executeBatch(GraphQLHandlerImpl.java:274) at io.vertx.ext.web.handler.graphql.impl.GraphQLHandlerImpl.handlePostBatch(GraphQLHandlerImpl.java:268) at io.vertx.ext.web.handler.graphql.impl.GraphQLHandlerImpl.handlePostJson(GraphQLHandlerImpl.java:232) at io.vertx.ext.web.handler.graphql.impl.GraphQLHandlerImpl.handlePost(GraphQLHandlerImpl.java:199) at io.vertx.ext.web.handler.graphql.impl.GraphQLHandlerImpl.handle(GraphQLHandlerImpl.java:108) at io.vertx.ext.web.handler.graphql.impl.GraphQLHandlerImpl.handle(GraphQLHandlerImpl.java:50) at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1285) at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:177) at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:137)

This line seems to successfully set the query if the query is missing, but on this line the query in the GraphQLQuery object seems to be null again.

tsegismont commented 5 months ago

Is this actually supported by the Apollo client?