Skip to content

Commit 83f7ec9

Browse files
authored
Merge pull request #613 from w3bdesign/dev
Reimplement node-fetch
2 parents 442bfb7 + 1970f08 commit 83f7ec9

File tree

3 files changed

+73
-4
lines changed

3 files changed

+73
-4
lines changed

package-lock.json

Lines changed: 68 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "next",
88
"build": "next build",
9-
"start": "next start"
9+
"start": "next start",
10+
"lint": "next lint"
1011
},
1112
"keywords": [],
1213
"author": "",
@@ -18,6 +19,7 @@
1819
"autoprefixer": "^10.3.7",
1920
"graphql": "^15.6.1",
2021
"next": "^11.1.3-canary.45",
22+
"node-fetch": "2.6.5",
2123
"nprogress": "^0.2.0",
2224
"postcss": "^8.3.9",
2325
"react": "^17.0.2",

utils/apollo/ApolloClient.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/*eslint complexity: ["error", 6]*/
22

3-
const fetcher = (url) => fetch(url).then((res) => res.json());
4-
3+
import fetch from 'node-fetch';
54
import {
65
ApolloClient,
76
InMemoryCache,
@@ -82,7 +81,7 @@ const client = new ApolloClient({
8281
afterware.concat(
8382
createHttpLink({
8483
uri: WOO_CONFIG.GRAPHQL_URL,
85-
fetcher,
84+
fetch,
8685
})
8786
)
8887
),

0 commit comments

Comments
 (0)