Apollo-client-devtools: How to wipe the cache

Created on 11 Dec 2020  路  4Comments  路  Source: apollographql/apollo-client-devtools

Hello ! 馃憢馃徎
I'm pretty new to Gql and Apollo so my question may be a bit basic but I didn't found any info.

I'm using those devtools w/ Nuxt (Vue) and for some testing, I sometimes need to get a clean empty cache but I cannot find how to do it. Is there a simple solution from the devtools or elsewhere to simply clean it ? ^^

鈦夛笍 question

All 4 comments

Hi @kissu! I'm not exactly sure what you are asking. For Apollo Client, you can clear the cache manually with cache.reset. There is no option to clear the cache in the devtools themselves. However, you might also be referring to a known issue with the current version (2.3.3) where the cache is not properly updating. We're aware of the issue but we're also heads-down on delivering a new, written-from-the-ground-up 3.0 version of the devtools early next year. We're not addressing issues with the previous version at this time. Hope this helps!

Actually, I'm talking about the basic cache.reset here, not sure where to do that one. ^^

@kissu That wouldn't be part of the devtools! You can do it in the browser console if you like though by calling window.__APOLLO_CLIENT__.cache.reset()

Closing as this isn't part of the devtools!

Was this page helpful?
0 / 5 - 0 ratings