function available on ApolloClient, how do you perform this with apollo3?
m
mbonnin
09/13/2021, 6:50 AM
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()
mbonnin
09/13/2021, 6:52 AM
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.