Table of Contents

Class QueryClientOptions

Namespace
Velvet
Assembly
Velvet.Docs.dll

Defaults a QueryClient applies to every query that does not set its own, plus the clock it measures staleness and garbage collection against.

public sealed class QueryClientOptions
Inheritance
object
QueryClientOptions

Properties

Clock

A monotonic clock the client reads instead of its own stopwatch, for a host that measures time differently — game time that pauses, or a clock a test advances by hand.

GcTime

How long an entry nothing observes is kept; after that the client removes it, as the remarks on QueryClient say. TanStack Query's default is five minutes. System.TimeSpan.MaxValue keeps it until Clear().

RefetchOnReconnect

Whether a query fetches again when the device comes back online, as NetworkSignals reads it: TanStack Query's refetchOnReconnect, whose default refetches stale data.

RefetchOnReconnectFn

RefetchOnReconnect given as a function of the entry a query reads, with the terms of RefetchOnWindowFocusFn.

RefetchOnWindowFocus

Whether a query fetches again when the application becomes visible, as NetworkSignals reads it: TanStack Query's refetchOnWindowFocus, whose default refetches stale data.

RefetchOnWindowFocusFn

RefetchOnWindowFocus given as a function of the entry a query reads, for every query that sets neither form of its own; see RefetchOnWindowFocusFn. It replaces RefetchOnWindowFocus when both are set.

Retry

How many times a failed request runs again before the failure is the entry's error: TanStack Query's retry given as a number, whose default is three. Zero or less retries nothing.

RetryDelay

The wait before the next request, from the number of failures before this one and this failure's exception: TanStack Query's retryDelay. When null, one second doubled at each failure and capped at thirty seconds, TanStack Query's default. The wait is measured on Clock and checked once a frame, and lasts at least one frame.

StaleTime

How long a result stays fresh after it lands. TanStack Query's default, zero, makes every result stale at once, so each component mounting over it fetches again in the background. System.TimeSpan.MaxValue keeps a result fresh until it is invalidated.