Skip to content

Commit

Permalink
Send recommended Accept header according to GraphQL over HTTP spec
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-tengler committed Mar 2, 2023
1 parent 05021b3 commit fed2200
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tasks/GenerateRelayEnvironmentTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class GenerateRelayEnvironmentTask extends TaskBase {
const resp = await fetch(${HTTP_ENDPOINT}, {
method: "POST",
headers: {
Accept: "application/json",
Accept: "application/graphql-response+json; charset=utf-8, application/json; charset=utf-8",
"Content-Type": "application/json",
// <-- Additional headers like 'Authorization' would go here
},
Expand Down Expand Up @@ -105,7 +105,7 @@ export class GenerateRelayEnvironmentTask extends TaskBase {
});
subscribeFn = (request, variables) => {
// To understand why we return Observable<any>,
// To understand why we return Observable.create<any>,
// please see: https://github.com/enisdenjo/graphql-ws/issues/316#issuecomment-1047605774
return Observable.create<any>((sink) => {
if (!request.text) {
Expand Down

0 comments on commit fed2200

Please sign in to comment.