Skip to content

Commit f512395

Browse files
author
Gustav Pursche
committed
API: workaround for vercel/next.js#27376
1 parent 739b92b commit f512395

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { createClient } from 'urql';
22
import { Agent } from 'http';
3+
import fetch from 'node-fetch';
34

45
const agent = new Agent();
56

6-
global.fetch = (url, opts) => fetch(url, { ...opts, agent });
7+
global.fetch = (url, opts, ...rest) => fetch(url, { ...opts, agent }, ...rest);
78

89
const client = createClient({
910
url: process.env.NEXT_PUBLIC_GRAPHQL_API,

0 commit comments

Comments
 (0)