CLASS
CodableInterceptorProvider
open class CodableInterceptorProvider<FlexDecoder: FlexibleDecoder>: InterceptorProvider
The default interceptor provider for code generated with Swift Codegen™
Methods
init(client:shouldInvalidateClientOnDeinit:store:decoder:)
public init(client: URLSessionClient = URLSessionClient(),
shouldInvalidateClientOnDeinit: Bool = true,
store: ApolloStore,
decoder: FlexDecoder)
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.- decoder: A
FlexibleDecoder
which can decodeCodable
objects.
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. |
decoder | A FlexibleDecoder which can decode Codable objects. |
deinit
deinit
interceptors(for:)
open func interceptors<Operation: GraphQLOperation>(for operation: Operation) -> [ApolloInterceptor]
Parameters
Name | Description |
---|---|
operation | The operation to provide interceptors for |