Table of Contents

Method FetchQuery

Namespace
Velvet
Assembly
Velvet.Docs.dll

FetchQuery<T>(QueryOptions<T, T>)

The data options' entry holds when it is fresh for the query's stale time, and otherwise the data a request for it returns, TanStack Query's fetchQuery. A request in flight is joined. The entry is created when there is none and, with nothing reading it, collected after the query's garbage-collection time.

public VelvetTask<T> FetchQuery<T>(QueryOptions<T, T> options)

Parameters

options QueryOptions<T, T>

The key, the query function and the options of QueryOptions<TQueryFnData, TData> that shape a request: its stale time, garbage-collection time, retries, retry delay and structural sharing. Unlike a mounted query, a request retries nothing unless Retry says so, as v5's fetchQuery sets retry: false.

Returns

VelvetTask<T>

A task of the entry's data; it faults with the request's failure, and is cancelled when something cancels the request.

Type Parameters

T

Exceptions

InvalidOperationException

The entry holds data of another type.