Docs
Launch GraphOS Studio
You're viewing documentation for a previous version of this software. Switch to the latest stable version.


CLASS

DefaultInterceptorProvider

open class DefaultInterceptorProvider: InterceptorProvider

The default interceptor provider for typescript-generated code

Methods

init(client:shouldInvalidateClientOnDeinit:store:)

public init(client: URLSessionClient = URLSessionClient(),
shouldInvalidateClientOnDeinit: Bool = true,
store: 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 a URLSessionClient to new instances.
    • store: The ApolloStore to use when reading from or writing to the cache. Make sure you pass the same store to the ApolloClient instance you're planning to use.

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.
storeThe ApolloStore to use when reading from or writing to the cache. Make sure you pass the same store to the ApolloClient instance you’re planning to use.

deinit

deinit

interceptors(for:)

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

Parameters

NameDescription
operationThe operation to provide interceptors for

additionalErrorInterceptor(for:)

open func additionalErrorInterceptor<Operation: GraphQLOperation>(for operation: Operation) -> ApolloErrorInterceptor?

Parameters

NameDescription
operationThe operation to provide an additional error interceptor for
Next
Introduction
Edit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc.

Privacy Policy

Company