Skip to content

Commit

Permalink
Reflect media type changes in reference documentation
Browse files Browse the repository at this point in the history
This commit mentions the `"application/graphql-response+json`" media
type in the reference documentation as the main media type used by the
server.

See gh-563
  • Loading branch information
bclozel committed Dec 6, 2022
1 parent 70afadc commit 6029e45
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions spring-graphql-docs/src/docs/asciidoc/index.adoc
Expand Up @@ -43,14 +43,13 @@ Spring MVC and one for Spring WebFlux. Both handle requests asynchronously and h
equivalent functionality, but rely on blocking vs non-blocking I/O respectively for
writing the HTTP response.

Requests must use HTTP POST with GraphQL request details included as JSON in the
request body, as defined in the proposed
https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md[GraphQL over HTTP]
specification. Once the JSON body has been successfully decoded, the HTTP response
status is always 200 (OK), and any errors from GraphQL request execution appear in the
"errors" section of the GraphQL response. The default and preferred choice of media type is
`"application/graphql+json"`, but `"application/json"` is also supported, as described in the
specification.
Requests must use HTTP POST with `"application/json"` as content type and GraphQL request details
included as JSON in the request body, as defined in the proposed
https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md[GraphQL over HTTP] specification.
Once the JSON body has been successfully decoded, the HTTP response status is always 200 (OK),
and any errors from GraphQL request execution appear in the "errors" section of the GraphQL response.
The default and preferred choice of media type is `"application/graphql-response+json"`, but `"application/json"`
is also supported, as described in the specification.

`GraphQlHttpHandler` can be exposed as an HTTP endpoint by declaring a `RouterFunction`
bean and using the `RouterFunctions` from Spring MVC or WebFlux to create the route. The
Expand Down

0 comments on commit 6029e45

Please sign in to comment.