I’m migrating from v3 to v4 and don’t understand how CacheFirst
is different from CacheOnly
now that always throws errors from cache misses:
In v4, this is now the default behavior and
emitCacheMisses
has been removed. With theCacheFirst
,NetworkFirst
andCacheAndNetwork
policies, cache misses and network errors are now emitted inApolloResponse.exception
.
I know that I could enable ApolloClient.Builder.useV3ExceptionHandling(true)
, but this is just a temporary workaround that is already deprecated and will be removed on the next major release.
So, what would be the v4 way to CacheFirst
so that it will try to get first from the cache and, in case of cache miss, it will fetch it from the network without using workarounds like useV3ExceptionHandling(true)
?