@Test void testCrypticErrorOnUpsert() throws IOException, JSONException { Incident incident = new Incident(); String graphQLRequest = document( selection( field( "incidents", arguments( argument("op", "UPSERT"), argument("data", incident) ), selections( field("id"), field("name") ) ) ) ).toQuery(); Response response = endpoint.post(uriInfo, user2, graphQLRequestToJSON(graphQLRequest)); JsonNode node = extract200Response(response); Iterator<JsonNode> errors = node.get("errors").elements(); assertTrue(errors.hasNext()); assertTrue(errors.next().get("message").asText().contains("No id provided, cannot persist incidents")); }
@POST @Consumes(MediaType.APPLICATION_JSON) public Response post( @Context UriInfo uriInfo, @Context SecurityContext securityContext, String graphQLDocument) { ElideResponse response = runner.run(uriInfo.getBaseUri().toString(), graphQLDocument, getUser.apply(securityContext)); return Response.status(response.getResponseCode()).entity(response.getBody()).build(); }
GraphQLEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) public Response post( @Context UriInfo uriInfo, @Context SecurityContext securityContext, String graphQLDocument) { ElideResponse response = runner.run(uriInfo.getBaseUri().toString(), graphQLDocument, getUser.apply(securityContext)); return Response.status(response.getResponseCode()).entity(response.getBody()).build(); } }
GraphQLEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) public Response post( @Context UriInfo uriInfo, @Context SecurityContext securityContext, String graphQLDocument) { ElideResponse response = runner.run(uriInfo.getBaseUri().toString(), graphQLDocument, getUser.apply(securityContext)); return Response.status(response.getResponseCode()).entity(response.getBody()).build(); } @Inject  GraphQLEndpoint(
            @Named("elide") Elide elide,
            @Named("elideUserExtractionFunction") DefaultOpaqueUserFunction getUser); }
GraphQLEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) public Response post( @Context UriInfo uriInfo, @Context SecurityContext securityContext, String graphQLDocument) { ElideResponse response = runner.run(uriInfo.getBaseUri().toString(), graphQLDocument, getUser.apply(securityContext)); return Response.status(response.getResponseCode()).entity(response.getBody()).build(); } @Inject  GraphQLEndpoint(
            @Named("elide") Elide elide,
            @Named("elideUserExtractionFunction") DefaultOpaqueUserFunction getUser); @POST @Consumes(MediaType.APPLICATION_JSON) Response post(
            @Context UriInfo uriInfo,
            @Context SecurityContext securityContext,
            String graphQLDocument); }
GraphQLEndpoint { @POST @Consumes(MediaType.APPLICATION_JSON) public Response post( @Context UriInfo uriInfo, @Context SecurityContext securityContext, String graphQLDocument) { ElideResponse response = runner.run(uriInfo.getBaseUri().toString(), graphQLDocument, getUser.apply(securityContext)); return Response.status(response.getResponseCode()).entity(response.getBody()).build(); } @Inject  GraphQLEndpoint(
            @Named("elide") Elide elide,
            @Named("elideUserExtractionFunction") DefaultOpaqueUserFunction getUser); @POST @Consumes(MediaType.APPLICATION_JSON) Response post(
            @Context UriInfo uriInfo,
            @Context SecurityContext securityContext,
            String graphQLDocument);  }