Skip to content

Commit

Permalink
API: workaround for vercel/next.js#27376
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustav Pursche committed Jul 27, 2021
1 parent 739b92b commit f512395
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { createClient } from 'urql';
import { Agent } from 'http';
import fetch from 'node-fetch';

const agent = new Agent();

global.fetch = (url, opts) => fetch(url, { ...opts, agent });
global.fetch = (url, opts, ...rest) => fetch(url, { ...opts, agent }, ...rest);

const client = createClient({
url: process.env.NEXT_PUBLIC_GRAPHQL_API,
Expand Down

0 comments on commit f512395

Please sign in to comment.