Skip to content

Commit

Permalink
fix apollo boost config (#512)
Browse files Browse the repository at this point in the history
* add fetch on apollo-boost

* fix eslint
  • Loading branch information
Joao Pedro da Silva authored Jan 24, 2023
1 parent 69cde32 commit 219ede1
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 110 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
17 changes: 11 additions & 6 deletions packages/core/src/subgraph/config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
// 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 { ApolloClient, InMemoryCache } from 'apollo-boost';
import { HttpLink } from 'apollo-link-http';
import { fetch } from 'cross-fetch';

import config from '../config';

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

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

0 comments on commit 219ede1

Please sign in to comment.