From 1389aded80b5d753668d0377b2ea12d64ddca338 Mon Sep 17 00:00:00 2001 From: Zaiste Date: Tue, 16 May 2023 18:16:30 +0200 Subject: [PATCH] Improve the `reset` approach for the Apollo client --- src/react/apollo.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/react/apollo.ts b/src/react/apollo.ts index fec0f5d..998fef2 100644 --- a/src/react/apollo.ts +++ b/src/react/apollo.ts @@ -30,5 +30,8 @@ export const useAuthenticatedApolloClient = (opts: Options) => { [] ); - return { apolloClient, resetClient: () => apolloClient.resetStore() }; + return { + apolloClient, + reset: () => apolloClient.refetchQueries({ include: "all" }) + }; };