/
Launch Apollo Studio


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 a URLSessionClient to new instances.
    • decoder: A FlexibleDecoder which can decode Codable objects.

Parameters

NameDescription
clientThe URLSessionClient to use. Defaults to the default setup.
shouldInvalidateClientOnDeinitIf 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.
decoderA FlexibleDecoder which can decode Codable objects.

deinit

deinit

interceptors(for:)

open func interceptors<Operation: GraphQLOperation>(for operation: Operation) -> [ApolloInterceptor]

Parameters

NameDescription
operationThe operation to provide interceptors for
Edit on GitHub