CLASS
LegacyInterceptorProvider
open class LegacyInterceptorProvider: InterceptorProvider
The default interceptor provider for typescript-generated code
Methods
init(client:shouldInvalidateClientOnDeinit:store:)
public init(client: URLSessionClient = URLSessionClient(),
shouldInvalidateClientOnDeinit: Bool = true,
store: ApolloStore = ApolloStore())
Designated initializer
Parameters:
- client: The
URLSessionClient
to use. Defaults to the default setup.- shouldInvalidateClientOnDeinit: If the passed-in client should be invalidated when this interceptor provider is deinitialized. If you are recreating the
URLSessionClient
every time you create a new provider, you should do this to prevent memory leaks. Defaults to true, since by default we provide aURLSessionClient
to new instances.- store: The
ApolloStore
to use when reading from or writing to the cache. Defaults to the default initializer for ApolloStore.
Parameters
Name | Description |
---|---|
client | The URLSessionClient to use. Defaults to the default setup. |
shouldInvalidateClientOnDeinit | If the passed-in client should be invalidated when this interceptor provider is deinitialized. If you are recreating the URLSessionClient every time you create a new provider, you should do this to prevent memory leaks. Defaults to true, since by default we provide a URLSessionClient to new instances. |
store | The ApolloStore to use when reading from or writing to the cache. Defaults to the default initializer for ApolloStore. |
deinit
deinit
interceptors(for:)
open func interceptors<Operation: GraphQLOperation>(for operation: Operation) -> [ApolloInterceptor]
Parameters
Name | Description |
---|---|
operation | The operation to provide interceptors for |