Table of Contents

Class QueryResult<T>

Namespace
Velvet
Assembly
Velvet.Docs.dll

What UseQuery<TQueryFnData, TData>(QueryOptions<TQueryFnData, TData>, QueryClient?) returns: the entry's state as this render reads it, TanStack Query's UseQueryResult. Reading a property marks it as one the component depends on, which is what NotifyOnChangeProps leaves to decide when the component re-renders.

public sealed class QueryResult<T>

Type Parameters

T
Inheritance
object
QueryResult<T>

Properties

Data

The last successful result, kept through a later failure and through a refetch, or the placeholder data; default while there is neither.

Error

The last request's failure, under Error; null otherwise.

FailureCount

How many times the request in flight or the last one has failed, TanStack Query's failureCount: zero once a request lands, and one more than the retries made when the last request failed for good.

FailureReason

The exception of the latest failure of the request in flight or the last one, TanStack Query's failureReason; null once a request lands.

IsError

True under Error.

IsFetching

True while a request for the entry is in flight, retries waiting out their delay included, or is about to start because this component is mounting over, or has just changed its key to, an entry with no data or stale data.

IsPending

True under Pending.

IsPlaceholderData

True when Data is PlaceholderData's rather than the entry's, TanStack Query's isPlaceholderData.

IsStale

True when the query is enabled and the entry has no data, has been invalidated, or holds data at least as old as the query's stale time.

IsSuccess

True under Success.

Status

Whether the query has data; see QueryStatus.

Methods

Refetch()

Fetches the entry again, TanStack Query's refetch(), whether or not the query is enabled: a request in flight over data the entry holds is cancelled and started over, and one for an entry still waiting on its first result is joined. Does nothing before the component's effects have run, and after it unmounts.