You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.
still use the default InMemoryCache in Apollo Client
once user do any mutate operation, then clear the cache store
key code:
constdoMutate=(mutation,variables)=>client.mutate({
mutation,
variables,
context,}).then(res=>{// once login user has mutation to server// then clear all the cache store in Apollo clientclient.clearStore()returnres.data}).catch(formatGraphErrors)
Apollo Client has the ability to cache query in client side:
the tricky part is to refresh cache when user do some mutate operation, like create post (post list should then be update)。
the official
writeQuery
solution mentioned in apollo doc is complex and adjectived.need better solution.
The text was updated successfully, but these errors were encountered: