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
<img width="829" alt="Screenshot 2024-12-31 at 10 59 56"
src="https://github.com/user-attachments/assets/30ea74be-0907-422f-8e84-6c352d379337"
/>
This commit is contained in:
Félix Malfait
2024-12-31 12:12:07 +01:00
committed by GitHub
parent 2277952403
commit 03370b4a1b

View File

@ -54,8 +54,8 @@ export const useApolloFactory = (options: Partial<Options<any>> = {}) => {
}),
},
defaultOptions: {
query: {
fetchPolicy: 'cache-first',
watchQuery: {
fetchPolicy: 'cache-and-network',
},
},
connectToDevTools: isDebugMode,