NetworkFetchInterceptor


CLASS

NetworkFetchInterceptor

Swift
1public class NetworkFetchInterceptor: ApolloInterceptor, Cancellable

An interceptor which actually fetches data from the network.

Methods

init(client:)

Swift
1public init(client: URLSessionClient)

Designated initializer.

  • Parameter client: The URLSessionClient to use to fetch data

Parameters

NameDescription
clientThe URLSessionClient to use to fetch data

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.

cancel()

Swift
1public func cancel()
Feedback

Edit on GitHub

Forums