Stylianos Gakis
03/11/2022, 7:24 PMapolloClient.clearHttpCache()
apolloClient.clearNormalizedCache(
object : ApolloStoreOperation.Callback<Boolean> { ... },
)
And I see that there is an alternative for the normalizedCache with apolloClient.apolloStore.clearAll() as shown by the annotation, but can’t see something for clearHttpCache. Is it part of something else? Something else I’m missing?mbonnin
03/11/2022, 7:50 PMfun ApolloClient.clearHttpCache() {
val httpNetworkTransport = networkTransport as? HttpNetworkTransport ?: error("cannot get the HttpCache, networkTransport is not a HttpNetworkTransport")
val cachingHttpInterceptor = httpNetworkTransport.interceptors.firstOrNull { it is CachingHttpInterceptor }
?: error("no http cache configured")
(cachingHttpInterceptor as CachingHttpInterceptor).delete()
}Stylianos Gakis
03/11/2022, 7:54 PM