You are viewing documentation for a previous version of this software.

Switch to the latest stable version.

CacheWriteInterceptor


STRUCT

CacheWriteInterceptor

Swift
1public struct CacheWriteInterceptor: ApolloInterceptor

An interceptor which writes data to the cache, following the HTTPRequest's cachePolicy.

Properties

store

Swift
1public let store: ApolloStore

Methods

init(store:)

Swift
1public init(store: ApolloStore)

Designated initializer

  • Parameter store: The store to use when writing to the cache.

Parameters

NameDescription
storeThe store to use when writing to the cache.

interceptAsync(chain:request:response:completion:)

Swift
1public func interceptAsync<Operation: GraphQLOperation>(
2  chain: RequestChain,
3  request: HTTPRequest<Operation>,
4  response: HTTPResponse<Operation>?,
5  completion: @escaping (Result<GraphQLResult<Operation.Data>, Error>) -> Void)

Parameters

NameDescription
chainThe chain the interceptor is a part of.
requestThe request, as far as it has been constructed
response[optional] The response, if received
completionThe completion block to fire when data needs to be returned to the UI.
Feedback

Edit on GitHub

Forums