From 11f54ab66e4119d8effa60ba941a914d421e885d Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 10 Sep 2020 19:28:08 +0200 Subject: [PATCH] =?UTF-8?q?Utilisation=20de=20la=20strat=C3=A9gie=20de=20c?= =?UTF-8?q?ache=20'cache=20puis=20r=C3=A9seau'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/util/apollo.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/src/util/apollo.ts b/client/src/util/apollo.ts index 519dee5..5cf0150 100644 --- a/client/src/util/apollo.ts +++ b/client/src/util/apollo.ts @@ -44,6 +44,19 @@ export function createClient(setLoggedIn: (boolean) => void) { errorLink, retryLink ]), + defaultOptions: { + watchQuery: { + fetchPolicy: 'cache-and-network', + errorPolicy: 'ignore', + }, + query: { + fetchPolicy: 'network-only', + errorPolicy: 'all', + }, + mutate: { + errorPolicy: 'all', + }, + } }); }