Skip to content

Commit

Permalink
Reimplement node-fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Fjeldstad committed Oct 6, 2021
1 parent d5ae165 commit 1970f08
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 4 deletions.
68 changes: 68 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
"start": "next start",
"lint": "next lint"
},
"keywords": [],
"author": "",
Expand All @@ -18,6 +19,7 @@
"autoprefixer": "^10.3.7",
"graphql": "^15.6.1",
"next": "^11.1.3-canary.45",
"node-fetch": "2.6.5",
"nprogress": "^0.2.0",
"postcss": "^8.3.9",
"react": "^17.0.2",
Expand Down
5 changes: 2 additions & 3 deletions utils/apollo/ApolloClient.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/*eslint complexity: ["error", 6]*/

const fetcher = (url) => fetch(url).then((res) => res.json());

import fetch from 'node-fetch';
import {
ApolloClient,
InMemoryCache,
Expand Down Expand Up @@ -82,7 +81,7 @@ const client = new ApolloClient({
afterware.concat(
createHttpLink({
uri: WOO_CONFIG.GRAPHQL_URL,
fetcher,
fetch,
})
)
),
Expand Down

0 comments on commit 1970f08

Please sign in to comment.