From 03370b4a1b0adb408a96eaa6328e6d7525d815f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Tue, 31 Dec 2024 12:12:07 +0100 Subject: [PATCH] Change Apollo cache policy (#9296) Set the default cache policy to 'cache-and-network' to make sure user get more fresh data without refreshing the browser. Better for workspace with several users working at the same time. It will put more load on the server... Note: I don't think the previous setting was taken into account Screenshot 2024-12-31 at 10 59 56 --- .../twenty-front/src/modules/apollo/hooks/useApolloFactory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts b/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts index 104364957cda..2b72e2c9a96e 100644 --- a/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts +++ b/packages/twenty-front/src/modules/apollo/hooks/useApolloFactory.ts @@ -54,8 +54,8 @@ export const useApolloFactory = (options: Partial> = {}) => { }), }, defaultOptions: { - query: { - fetchPolicy: 'cache-first', + watchQuery: { + fetchPolicy: 'cache-and-network', }, }, connectToDevTools: isDebugMode,