CLASS
CodableInterceptorProvider
open class CodableInterceptorProvider<FlexDecoder: FlexibleDecoder>: InterceptorProviderThe 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
URLSessionClientevery time you create a new provider, you should do this to prevent memory leaks. Defaults to true, since by default we provide aURLSessionClientto new instances.- decoder: A
FlexibleDecoderwhich can decodeCodableobjects.
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
deinitinterceptors(for:)
open func interceptors<Operation: GraphQLOperation>(for operation: Operation) -> [ApolloInterceptor]Parameters
| Name | Description |
|---|---|
| operation | The operation to provide interceptors for |