RetryOnErrorInterceptor

Returns an ApolloInterceptor that monitors network errors and possibly retries the Flow when an ApolloNetworkException happens.

The returned RetryOnErrorInterceptor:

Use with com.apollographql.apollo.ApolloClient.Builder.retryOnErrorInterceptor:

apolloClient = ApolloClient.Builder()
.serverUrl("https://...")
.retryOnErrorInterceptor(RetryOnErrorInterceptor(NetworkMonitor(context)))
.build()

Some other types of error than ApolloNetworkException might be recoverable as well (rate limit, ...) but are out of scope for this interceptor.

See also