MaxRetryInterceptor
CLASS
MaxRetryInterceptor
Swift
1public class MaxRetryInterceptor: ApolloInterceptorAn interceptor to enforce a maximum number of retries of any HTTPRequest
Methods
init(maxRetriesAllowed:)
Swift
1public init(maxRetriesAllowed: Int = 3)Designated initializer.
Parameter maxRetriesAllowed: How many times a query can be retried, in addition to the initial attempt before
Parameters
| Name | Description |
|---|---|
| maxRetriesAllowed | How many times a query can be retried, in addition to the initial attempt before |
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
| 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. |