MaxRetryInterceptor


CLASS

MaxRetryInterceptor

Swift
1public class MaxRetryInterceptor: ApolloInterceptor

An 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

NameDescription
maxRetriesAllowedHow 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

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