Interface UseQueryOptions

Options for useQuery.

interface UseQueryOptions {
    drainAllPages?: boolean;
    enabled?: boolean;
    staleTimeMs?: number;
    suspense?: boolean;
    throwOnError?: boolean;
}

Properties

drainAllPages?: boolean

Use source.queryAll() (drain every page) instead of a single page.

enabled?: boolean

When false, the query is not executed and stays in idle. Default true.

staleTimeMs?: number

Stale-while-revalidate window in milliseconds. When a consumer (re)mounts or the query key changes and the cached result is at least this old, the cached data keeps rendering while a background refetch runs (isFetching: true, data preserved). 0 revalidates on every mount. Omitted keeps the historical behavior: cached results are served without revalidation until refetch() or an explicit invalidation.

suspense?: boolean

Suspense mode: while the first fetch (no cached data yet) is in flight the hook suspends, and errors are thrown to the nearest error boundary. Wrap consumers in <Suspense fallback={…}>. Background refetches do not suspend — cached data keeps rendering stale-while-revalidate style.

throwOnError?: boolean

Throw query errors during render so the nearest React error boundary receives them (typed errors such as HonuaCapabilityNotSupportedError arrive intact). Default false: errors are returned on the snapshot.