Skip to content

HttpGraphQlClientTransport should respect an existing, explicitly set Content-Type #359

@busches

Description

@busches

With 1.0.0-RC1, the Client now sends the Content-Type header as application/graphql+json

We're trying to override the headers here, but it has no affect:

HttpGraphQlClient.builder(webClient)
        .url(url)
        .headers { header -> header.contentType = MediaType.APPLICATION_JSON }
        .build()

graphQlClient.documentName(documentName)
            .variables(variables)
            .retrieve("myQuery")
            .toEntityList(myQuery::class.java)

It's still coming over as application/graphql+json.

We need to do this, as the the Apollo graphql gateway we're using does not accept the graphql header.
Error: POST body missing, invalid Content-Type, or JSON object has no keys. (it's not the other two).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions