Skip to content

Commit

Permalink
feat: add default skipPollAttempt clause to global client
Browse files Browse the repository at this point in the history
  • Loading branch information
rohan-chaturvedi committed Dec 4, 2024
1 parent e5b69dc commit c36b4b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/apollo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ const errorLink = onError(({ graphQLErrors, networkError, operation, forward })
export const graphQlClient = new ApolloClient({
link: from([errorLink, httpLink]),
cache: new InMemoryCache(),
defaultOptions: {
watchQuery: {
skipPollAttempt: () => document.hidden || !document.hasFocus()
}
}
})

0 comments on commit c36b4b7

Please sign in to comment.