Skip to content

Commit

Permalink
Merge pull request #528 from privacy-scaling-explorations/fix/prevent…
Browse files Browse the repository at this point in the history
…-fetch-subgraph-error

fix: catch error for fetch subgraph
  • Loading branch information
ctrlc03 authored Dec 6, 2024
2 parents 0361592 + 4d58c27 commit f43f13b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/interface/src/utils/fetchTally.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ export async function fetchTally(id: string): Promise<Tally | undefined> {
body: JSON.stringify({
query: tallyQuery.replace("id: $id", `id: "${id}"`),
}),
}).then((response: GraphQLResponse) => response.data?.tally);
})
.then((response: GraphQLResponse) => response.data?.tally)
.catch(() => undefined);
}

/**
Expand All @@ -62,5 +64,7 @@ export async function fetchTallies(): Promise<Tally[] | undefined> {
body: JSON.stringify({
query: talliesQuery,
}),
}).then((r) => r.data.tallies);
})
.then((r) => r.data.tallies)
.catch(() => []);
}

0 comments on commit f43f13b

Please sign in to comment.