addInterceptor

Adds an ApolloInterceptor to this ApolloClient.

ApolloInterceptors monitor, rewrite and retry an ApolloCall. Internally, ApolloInterceptor is used for features such as normalized cache and auto persisted queries. ApolloClient also inserts a terminating ApolloInterceptor that executes the request.

The order is important. The ApolloInterceptors are added in the order they are added and always added before the built-in intercepted:

  • user interceptors

  • cacheInterceptor

  • autoPersistedQueriesInterceptor

  • retryOnErrorInterceptor

  • networkInterceptor

See also