Class CacheAndNetworkFetcher
- java.lang.Object
-
- com.apollographql.apollo.internal.fetcher.CacheAndNetworkFetcher
-
- All Implemented Interfaces:
ResponseFetcher
public final class CacheAndNetworkFetcher extends java.lang.Object implements ResponseFetcher
Signal the apollo client to fetch the data from both the network and the cache. If cached data is not present, only network data will be returned. If cached data is available, but network experiences an error, cached data is returned. If cache data is not available, and network data is not available, the error of the network request will be propagated. If both network and cache are available, both will be returned. Cache data is guaranteed to be returned first.
-
-
Constructor Summary
Constructors Constructor Description CacheAndNetworkFetcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ApolloInterceptorprovideInterceptor(com.apollographql.apollo.api.internal.ApolloLogger apolloLogger)
-
-
-
Method Detail
-
provideInterceptor
public ApolloInterceptor provideInterceptor(com.apollographql.apollo.api.internal.ApolloLogger apolloLogger)
- Specified by:
provideInterceptorin interfaceResponseFetcher- Parameters:
apolloLogger- AApolloLoggerto log relevant fetch information.- Returns:
- The
ApolloInterceptorthat executes the fetch logic.
-
-