/
Launch Apollo Studio


CLASS

LegacyCacheReadInterceptor

public class LegacyCacheReadInterceptor: ApolloInterceptor

An interceptor that reads data from the legacy cache for queries, following the HTTPRequest's cachePolicy.

Methods

init(store:)

public init(store: ApolloStore)

Designated initializer

  • Parameter store: The store to use when reading from the cache.

Parameters

NameDescription
storeThe store to use when reading from the cache.

interceptAsync(chain:request:response:completion:)

public func interceptAsync<Operation: GraphQLOperation>(
  chain: RequestChain,
  request: HTTPRequest<Operation>,
  response: HTTPResponse<Operation>?,
  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.
Edit on GitHub