Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix apollo boost config #512

Merged
merged 2 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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