Skip to content

Commit

Permalink
Move subgraph urls to env.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
in19farkt committed Dec 16, 2019
1 parent 79f81f0 commit 93469a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions frontend/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const DEFAULT_DECIMALS = 18;
export const ETHEREUM_UNIT_NAME = 'DAI';
export const SUBSTRATE_UNIT_NAME = 'sDAI';

export const SUBGRAPH_HTTP_URL = 'https://api.thegraph.com/subgraphs/name/andor0/polkadai';
export const SUBGRAPH_WS_URL = 'wss://api.thegraph.com/subgraphs/name/andor0/polkadai';

export const SUBSTRATE_DEFAULT_ADDRESS_PREFIX = 42;
export const SUBSTRATE_NODE_URL = 'wss://node1-polkadai.akropolis.io';
export const SUBSTRATE_NODE_CUSTOM_TYPES: RegistryTypes = {
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/services/apollo/apolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { WebSocketLink } from 'apollo-link-ws';
import { HttpLink } from 'apollo-link-http';
import { onError } from 'apollo-link-error';
import { getMainDefinition } from 'apollo-utilities';
import { SUBGRAPH_HTTP_URL, SUBGRAPH_WS_URL } from 'env';

const bridgeLink = makeEndpointLink(
new HttpLink({
uri: 'https://api.thegraph.com/subgraphs/name/andor0/polkadai',
uri: SUBGRAPH_HTTP_URL,
credentials: 'same-origin',
}),
new WebSocketLink({
uri: 'wss://api.thegraph.com/subgraphs/name/andor0/polkadai',
uri: SUBGRAPH_WS_URL,
options: {
reconnect: true,
},
Expand Down

0 comments on commit 93469a0

Please sign in to comment.