Skip to content

Commit

Permalink
add fetch on apollo-boost
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Pedro da Silva committed Jan 24, 2023
1 parent e2b42be commit 3fce0fc
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 112 deletions.
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@turf/points-within-polygon": "6.5.0",
"apicache": "1.6.3",
"apollo-boost": "0.4.9",
"apollo-link-http": "1.5.17",
"aws-sdk": "2.1034.0",
"axios": "0.24.0",
"axios-retry": "3.3.1",
Expand Down
22 changes: 14 additions & 8 deletions packages/core/src/subgraph/config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
// To use Apollo Client without a browser, is necessary to polyfill or provide a fetch method.
import 'cross-fetch/polyfill';

import ApolloClient, { InMemoryCache } from 'apollo-boost';
import { fetch } from 'cross-fetch';
import { ApolloClient, InMemoryCache } from 'apollo-boost';
import { HttpLink } from 'apollo-link-http';

import config from '../config';


export const clientDAO = new ApolloClient({
uri: config.subgraphUrl,
cache: new InMemoryCache(),
link: new HttpLink({
uri: config.subgraphUrl,
fetch,
}),
cache: new InMemoryCache()
});

export const clientCouncil = new ApolloClient({
uri: config.councilSubgraphUrl,
cache: new InMemoryCache(),
link: new HttpLink({
uri: config.councilSubgraphUrl,
fetch,
}),
cache: new InMemoryCache()
});
Loading

0 comments on commit 3fce0fc

Please sign in to comment.