-
Notifications
You must be signed in to change notification settings - Fork 322
Closed
Description
Current spring boot graphql does not seem to support application/graphql content type with query text as body as specified here ( https://graphql.org/learn/serving-over-http ).
quote from the above specification:
In addition to the above, we recommend supporting two additional cases:
- If the "query" query string parameter is present (as in the GET example above), it should be parsed and handled in the same way as the HTTP GET case.
- If the "application/graphql" Content-Type header is present, treat the HTTP POST body contents as the GraphQL query string.
From GraphQlWebFluxAutoConfiguration.java:
RouterFunctions.Builder builder = RouterFunctions.route()
.GET(graphQLPath, request ->
ServerResponse.status(HttpStatus.METHOD_NOT_ALLOWED)
.headers(headers -> headers.setAllow(Collections.singleton(HttpMethod.POST)))
.build())
.POST(graphQLPath,
accept(MediaType.APPLICATION_JSON).and(contentType(MediaType.APPLICATION_JSON)),
handler::handleRequest);
Metadata
Metadata
Assignees
Labels
type: enhancementA general enhancementA general enhancement