8.5 KiB
id, title
| id | title |
|---|---|
| QueryObserverBaseResult | QueryObserverBaseResult |
Defined in: packages/query-core/src/types.ts:764
Extended by
QueryObserverPendingResultQueryObserverLoadingResultQueryObserverLoadingErrorResultQueryObserverRefetchErrorResultQueryObserverSuccessResultQueryObserverPlaceholderResultInfiniteQueryObserverBaseResult
Type Parameters
TData
TData = unknown
TError
TError = DefaultError
Properties
data
data: TData | undefined;
Defined in: packages/query-core/src/types.ts:771
The last successfully resolved data for the query.
dataUpdatedAt
dataUpdatedAt: number;
Defined in: packages/query-core/src/types.ts:775
The timestamp for when the query most recently returned the status as "success".
error
error: TError | null;
Defined in: packages/query-core/src/types.ts:780
The error object for the query, if an error was thrown.
- Defaults to
null.
errorUpdateCount
errorUpdateCount: number;
Defined in: packages/query-core/src/types.ts:799
The sum of all errors.
errorUpdatedAt
errorUpdatedAt: number;
Defined in: packages/query-core/src/types.ts:784
The timestamp for when the query most recently returned the status as "error".
failureCount
failureCount: number;
Defined in: packages/query-core/src/types.ts:790
The failure count for the query.
- Incremented every time the query fails.
- Reset to
0when the query succeeds.
failureReason
failureReason: TError | null;
Defined in: packages/query-core/src/types.ts:795
The failure reason for the query retry.
- Reset to
nullwhen the query succeeds.
fetchStatus
fetchStatus: FetchStatus;
Defined in: packages/query-core/src/types.ts:889
The fetch status of the query.
fetching: Istruewhenever the queryFn is executing, which includes initialpendingas well as background refetch.paused: The query wanted to fetch, but has beenpaused.idle: The query is not fetching.- See Network Mode for more information.
isEnabled
isEnabled: boolean;
Defined in: packages/query-core/src/types.ts:867
true if this observer is enabled, false otherwise.
isError
isError: boolean;
Defined in: packages/query-core/src/types.ts:804
A derived boolean from the status variable, provided for convenience.
trueif the query attempt resulted in an error.
isFetched
isFetched: boolean;
Defined in: packages/query-core/src/types.ts:808
Will be true if the query has been fetched.
isFetchedAfterMount
isFetchedAfterMount: boolean;
Defined in: packages/query-core/src/types.ts:813
Will be true if the query has been fetched after the component mounted.
- This property can be used to not show any previously cached data.
isFetching
isFetching: boolean;
Defined in: packages/query-core/src/types.ts:818
A derived boolean from the fetchStatus variable, provided for convenience.
truewhenever thequeryFnis executing, which includes initialpendingas well as background refetch.
isInitialLoading
isInitialLoading: boolean;
Defined in: packages/query-core/src/types.ts:836
Deprecated
isInitialLoading is being deprecated in favor of isLoading
and will be removed in the next major version.
isLoading
isLoading: boolean;
Defined in: packages/query-core/src/types.ts:823
Is true whenever the first fetch for a query is in-flight.
- Is the same as
isFetching && isPending.
isLoadingError
isLoadingError: boolean;
Defined in: packages/query-core/src/types.ts:831
Will be true if the query failed while fetching for the first time.
isPaused
isPaused: boolean;
Defined in: packages/query-core/src/types.ts:841
A derived boolean from the fetchStatus variable, provided for convenience.
- The query wanted to fetch, but has been
paused.
isPending
isPending: boolean;
Defined in: packages/query-core/src/types.ts:827
Will be pending if there's no cached data and no query attempt was finished yet.
isPlaceholderData
isPlaceholderData: boolean;
Defined in: packages/query-core/src/types.ts:845
Will be true if the data shown is the placeholder data.
isRefetchError
isRefetchError: boolean;
Defined in: packages/query-core/src/types.ts:849
Will be true if the query failed while refetching.
isRefetching
isRefetching: boolean;
Defined in: packages/query-core/src/types.ts:854
Is true whenever a background refetch is in-flight, which does not include initial pending.
- Is the same as
isFetching && !isPending.
isStale
isStale: boolean;
Defined in: packages/query-core/src/types.ts:858
Will be true if the data in the cache is invalidated or if the data is older than the given staleTime.
isSuccess
isSuccess: boolean;
Defined in: packages/query-core/src/types.ts:863
A derived boolean from the status variable, provided for convenience.
trueif the query has received a response with no errors and is ready to display its data.
refetch()
refetch: (options?) => Promise<QueryObserverResult<TData, TError>>;
Defined in: packages/query-core/src/types.ts:871
A function to manually refetch the query.
Parameters
options?
Returns
Promise<QueryObserverResult<TData, TError>>
status
status: QueryStatus;
Defined in: packages/query-core/src/types.ts:881
The status of the query.
- Will be:
pendingif there's no cached data and no query attempt was finished yet.errorif the query attempt resulted in an error.successif the query has received a response with no errors and is ready to display its data.