From 2669a44d79dea628f313bdea2c07e3e475b5acf0 Mon Sep 17 00:00:00 2001 From: cmeng Date: Mon, 20 May 2024 15:29:56 +1200 Subject: [PATCH] fix(react-query): set react-query networkMode to offlineFirst EE-7081 (#11812) --- app/react-tools/react-query.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/react-tools/react-query.ts b/app/react-tools/react-query.ts index 795557751..8ab6d611d 100644 --- a/app/react-tools/react-query.ts +++ b/app/react-tools/react-query.ts @@ -76,6 +76,11 @@ function mergeOptions(options: T[]) { export function createQueryClient() { return new QueryClient({ + defaultOptions: { + queries: { + networkMode: 'offlineFirst', + }, + }, mutationCache: new MutationCache({ onError: (error, variable, context, mutation) => { handleError(error, mutation.meta?.error);