RetryOptions class

Configures automatic retry-with-backoff for a query (and, when explicitly set on the request, a mutation or subscription) on transient network failures.

Constructors

RetryOptions({int maxAttempts = 3, Duration initialDelay = const Duration(milliseconds: 200), double backoffMultiplier = 2.0, double jitter = 0.0, bool retryIf(Object error)?})
const

Properties

backoffMultiplier → double
final
hashCode → int
The hash code for this object.
no setterinherited
initialDelay → Duration
Delay before the first retry (attempt 2). Subsequent retries multiply this by backoffMultiplier for each additional attempt.
final
jitter → double
Randomizes each computed delay by up to this fraction (0.0–1.0) in either direction, so many clients that failed at the same moment (e.g. a shared server blip) don't all retry in lockstep and re-cause the spike that failed them the first time. 0.0 (the default) disables jitter — the exact backoff curve prior versions produced.
final
maxAttempts → int
Total attempts including the first — 1 means "no retry".
final
retryIf → bool Function(Object error)?
Overrides the default transient-failure classification. Receives the mapped GraphQLException (via GraphQLExceptionExtension) for the failed attempt.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

delayForAttempt(int attempt) → Duration
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldRetry(Object error) → bool
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

none → const RetryOptions
A single attempt, no retry — pass this to a request to opt a query out of the client's defaultRetry.