Skip to content

Commit

Permalink
Improve the reset approach for the Apollo client
Browse files Browse the repository at this point in the history
  • Loading branch information
zaiste committed May 16, 2023
1 parent 56afafc commit 1389ade
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/react/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@ export const useAuthenticatedApolloClient = (opts: Options) => {
[]
);

return { apolloClient, resetClient: () => apolloClient.resetStore() };
return {
apolloClient,
reset: () => apolloClient.refetchQueries({ include: "all" })
};
};

0 comments on commit 1389ade

Please sign in to comment.