Skip to content

Commit d5ae165

Browse files
author
Daniel Fjeldstad
committed
Remove node-fetch
1 parent 63d8c59 commit d5ae165

File tree

3 files changed

+51
-191
lines changed

3 files changed

+51
-191
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-woocommerce",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"description": "NextJS WooCommerce webshop",
55
"main": "index.js",
66
"scripts": {
@@ -18,7 +18,6 @@
1818
"autoprefixer": "^10.3.7",
1919
"graphql": "^15.6.1",
2020
"next": "^11.1.3-canary.45",
21-
"node-fetch": "^2.6.1",
2221
"nprogress": "^0.2.0",
2322
"postcss": "^8.3.9",
2423
"react": "^17.0.2",

utils/apollo/ApolloClient.js

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

3-
import fetch from 'node-fetch';
3+
const fetcher = (url) => fetch(url).then((res) => res.json());
4+
45
import {
56
ApolloClient,
67
InMemoryCache,
@@ -81,7 +82,7 @@ const client = new ApolloClient({
8182
afterware.concat(
8283
createHttpLink({
8384
uri: WOO_CONFIG.GRAPHQL_URL,
84-
fetch,
85+
fetcher,
8586
})
8687
)
8788
),

0 commit comments

Comments
 (0)