Skip to content

Commit

Permalink
Override graphql endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
emmdim committed Nov 9, 2023
1 parent 6d99a28 commit 278308f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/js-client/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DEFAULT_GASLESS_VOTING_BACKEND_URL, DEFAULT_GASLESS_VOTING_REPO_ADDRESS } from "./internal";
import { DEFAULT_GASLESS_VOTING_BACKEND_URL, DEFAULT_GASLESS_VOTING_REPO_ADDRESS, DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL } from "./internal";
import {
GaslessVotingContextState as GaslessVotingContextState,
GaslessVotingOverriddenState as GaslessVotingOverriddenState,
Expand All @@ -19,6 +19,7 @@ export class GaslessVotingContext extends ContextCore {
super();
// if the user alredy provides an aragon context that we can use
if (aragonContext) {
aragonContext.set({graphqlNodes: [{"url":DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL}]})
// override the default values with the ones from the aragon context
Object.assign(this, aragonContext);
}
Expand Down
1 change: 1 addition & 0 deletions packages/js-client/src/internal/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { VocdoniVoting__factory } from '@vocdoni/gasless-voting-ethers';

export const DEFAULT_GASLESS_VOTING_REPO_ADDRESS =
'0x0000000000000000000000000000000000000000';
export const DEFAULT_GASLESS_VOTING_SUBHGRAPH_URL = 'https://api.studio.thegraph.com/query/56700/gasless-voting/version/latest'
export const DEFAULT_ADDRESSES: {
[K in SupportedNetwork]: { repoAddress: string; setupAddress: string };
} = {
Expand Down

0 comments on commit 278308f

Please sign in to comment.