Skip to content

Commit

Permalink
Change Apollo cache policy (twentyhq#9296)
Browse files Browse the repository at this point in the history
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"
/>
  • Loading branch information
FelixMalfait authored Dec 31, 2024
1 parent 2277952 commit 03370b4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const useApolloFactory = (options: Partial<Options<any>> = {}) => {
}),
},
defaultOptions: {
query: {
fetchPolicy: 'cache-first',
watchQuery: {
fetchPolicy: 'cache-and-network',
},
},
connectToDevTools: isDebugMode,
Expand Down

0 comments on commit 03370b4

Please sign in to comment.