ApolloInterceptor
PROTOCOL
ApolloInterceptor
Swift
1public protocol ApolloInterceptorA protocol to set up a chainable unit of networking work.
Methods
interceptAsync(chain:request:response:completion:)
Swift
1func interceptAsync<Operation: GraphQLOperation>(
2 chain: RequestChain,
3 request: HTTPRequest<Operation>,
4 response: HTTPResponse<Operation>?,
5 completion: @escaping (Result<GraphQLResult<Operation.Data>, Error>) -> Void)Called when this interceptor should do its work.
Parameters:
chain: The chain the interceptor is a part of.
request: The request, as far as it has been constructed
response: [optional] The response, if received
completion: The completion block to fire when data needs to be returned to the UI.
Parameters
| Name | Description |
|---|---|
| chain | The chain the interceptor is a part of. |
| request | The request, as far as it has been constructed |
| response | [optional] The response, if received |
| completion | The completion block to fire when data needs to be returned to the UI. |