Skip to content

Commit a578f80

Browse files
Michael Kasererchristianalfoni
authored andcommitted
feat(overmind-graphql): fetch polyfill added
1 parent b08313d commit a578f80

File tree

1 file changed

+1
-8
lines changed
  • packages/node_modules/overmind-graphql/src

1 file changed

+1
-8
lines changed

packages/node_modules/overmind-graphql/src/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@ import { GraphQLClient } from 'graphql-request';
33
import { RequestInit } from 'graphql-request/dist/types.dom';
44
import { print } from 'graphql/language/printer';
55
import { Socket as PhoenixSocket } from 'phoenix';
6-
import { Headers } from 'cross-fetch';
6+
import 'cross-fetch/polyfill';
77

88
import gqlTag from 'graphql-tag';
99

1010

11-
// Fix for issue in version 3.1.0 of graphql-request: https://github.com/prisma-labs/graphql-request/issues/206
12-
// @ts-ignore
13-
global.Headers = global.Headers || Headers;
14-
1511
export interface Query<Result extends any, Payload extends any = void> {
1612
(payload: Payload): Result;
1713
}
@@ -119,11 +115,8 @@ export const graphql: <T extends Queries>(
119115
: {};
120116

121117
if (_clients[_http.endpoint]) {
122-
console.log("SET HEADERS")
123118
_clients[_http.endpoint].setHeaders(headers);
124119
} else {
125-
console.log("HEADERS", typeof headers, headers)
126-
console.log("HEADERS ALREADY SET", headers)
127120
_clients[_http.endpoint] = new GraphQLClient(_http.endpoint, {
128121
..._http.options,
129122
headers,

0 commit comments

Comments
 (0)