apollo 2.x.x had `clearNormalizedCache` function a...
# apollo-kotlin
j
apollo 2.x.x had
clearNormalizedCache
function available on ApolloClient, how do you perform this with apollo3?
m
In 3.x, ApolloClient doesn't know anything about the cache. You'll have to hold a reference to the store and call it from there:
Copy code
store = ApolloStore(MemoryCacheFactory())
    apolloClient = ApolloClient(mockServer.url()).withStore(store)
    // Do something with apolloClient ...
    // Clear the store
    store.clearAll()
We might add an extension function (like we did for
watch
for an example) although I personally find it nice to unbundle client and cache. I find it separates responsibilities a bit more.
It's deprecated for now as the same functionality is available through store.clearAll().
👍 1