Skip to content

Commit

Permalink
Merge headers correctly with option overrides
Browse files Browse the repository at this point in the history
in Network layer
  • Loading branch information
rricard committed Sep 9, 2016
1 parent c084c2e commit 877ea0b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/networkInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,13 @@ export class HTTPFetchNetworkInterface implements NetworkInterface {
}: RequestAndOptions): Promise<IResponse> {
return fetch(this._uri, assign({}, this._opts, {
body: JSON.stringify(printRequest(request)),
headers: assign({}, options.headers, {
method: 'POST',
}, options, {
headers: assign({}, {
Accept: '*/*',
'Content-Type': 'application/json',
}),
method: 'POST',
}, options));
}, options.headers),
}));
};

public query(request: Request): Promise<GraphQLResult> {
Expand Down

0 comments on commit 877ea0b

Please sign in to comment.