Rever to "application/json" as default MIME type

As of #108, the `"application/graphql+json"` media type is supported and
has been made the default.

It seems that it is not ready for adoption now; so while we'll keep
supporting it, this commit reverts back to `"application/json"` as the
default media type for servers and clients.

Closes gh-375
This commit is contained in:
Brian Clozel
2022-05-04 11:14:10 +02:00
parent 81a03f2b2d
commit 85ad5bbfb4
8 changed files with 18 additions and 18 deletions

View File

@@ -55,12 +55,12 @@ final class WebTestClientTransport implements GraphQlTransport {
public Mono<GraphQlResponse> execute(GraphQlRequest request) {
Map<String, Object> responseMap = this.webTestClient.post()
.contentType(MediaType.APPLICATION_GRAPHQL)
.accept(MediaType.APPLICATION_GRAPHQL)
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.bodyValue(request.toMap())
.exchange()
.expectStatus().isOk()
.expectHeader().contentTypeCompatibleWith(MediaType.APPLICATION_GRAPHQL)
.expectHeader().contentTypeCompatibleWith(MediaType.APPLICATION_JSON)
.expectBody(MAP_TYPE)
.returnResult()
.getResponseBody();