0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/solid/reference/interfaces/InfiniteQueryObserverBaseResult.md
Wonsuk Choi 0ca0523f31
docs({query-core,react,preact,vue,solid,svelte,angular}-query): describe the query result's 'status', its derived booleans and the error result types by the query's data and error (#12602)
* docs(query-core/types): describe 'status', 'isPending', 'isSuccess' and 'isError' of the query result by its current data and error

* docs(query-core/types): describe 'isLoadingError', 'isRefetchError' and the error result types by the current data and error, including 'select' failures

* docs(query-core/types): note that 'isRefetchError' is 'false' after a failed page fetch in infinite queries

* docs({query-core,react,preact,vue,solid,svelte,angular}-query): describe 'success' and 'pending' by cached data and 'placeholderData' since 'select' can return 'undefined'

* docs({query-core,react,preact,vue,solid,svelte,angular}-query): describe 'success' by cached data or data from 'placeholderData', and limit the 'select' returning 'undefined' case to cached data

* docs(docs/framework): revert generated reference pages to leave them to the post-merge workflow

* docs(docs/framework): regenerate reference pages with 'generate-docs'
2026-11-16 21:04:52 +09:00

7.6 KiB

id title
InfiniteQueryObserverBaseResult InfiniteQueryObserverBaseResult

Defined in: packages/query-core/src/types.ts:1409

The properties shared by every state of an infinite query result: those of QueryObserverBaseResult, plus fetchNextPage, fetchPreviousPage, and the flags about them, like hasNextPage and isFetchingNextPage.

Extends

Extended by

Type Parameters

TData

TData = unknown

TError

TError = DefaultError

Properties

Property Type Description
data TData | undefined The last successfully resolved data for the query.
dataUpdatedAt number The timestamp for when the query most recently returned the status as "success".
error TError | null The error object for the query, if an error was thrown. - Defaults to null.
errorUpdateCount number The sum of all errors.
errorUpdatedAt number The timestamp for when the query most recently returned the status as "error".
failureCount number The failure count for the query. - Incremented every time the query fails. - Reset to 0 when the query succeeds.
failureReason TError | null The failure reason for the query retry. - Reset to null when the query succeeds.
fetchNextPage (options?: FetchNextPageOptions) => Promise<InfiniteQueryObserverResult<TData, TError>> This function allows you to fetch the next "page" of results.
fetchPreviousPage (options?: FetchPreviousPageOptions) => Promise<InfiniteQueryObserverResult<TData, TError>> This function allows you to fetch the previous "page" of results.
fetchStatus "fetching" | "paused" | "idle" The fetch status of the query. - fetching: Is true whenever the queryFn is executing, which includes initial pending as well as background refetch. - paused: The query wanted to fetch, but has been paused. - idle: The query is not fetching. - See Network Mode for more information.
hasNextPage boolean Will be true if there is a next page to be fetched (known via the getNextPageParam option).
hasPreviousPage boolean Will be true if there is a previous page to be fetched (known via the getPreviousPageParam option).
isEnabled boolean true if this observer is enabled, false otherwise.
isError boolean A derived boolean from the status variable, provided for convenience. - true if the query has an error from a fetch that failed after its retries, or if select threw.
isFetched boolean Will be true if the query has been fetched.
isFetchedAfterMount boolean 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 boolean A derived boolean from the fetchStatus variable, provided for convenience. - true whenever the queryFn is executing, which includes initial pending as well as background refetch.
isFetchingNextPage boolean Will be true while fetching the next page with fetchNextPage.
isFetchingPreviousPage boolean Will be true while fetching the previous page with fetchPreviousPage.
isFetchNextPageError boolean Will be true if the query failed while fetching the next page.
isFetchPreviousPageError boolean Will be true if the query failed while fetching the previous page.
isInitialLoading boolean Deprecated isInitialLoading is being deprecated in favor of isLoading and will be removed in the next major version.
isLoading boolean Is true whenever the first fetch for a query is in-flight. - Is the same as isFetching && isPending.
isLoadingError boolean Will be true if the query has an error and no data to display.
isPaused boolean A derived boolean from the fetchStatus variable, provided for convenience. - The query wanted to fetch, but has been paused.
isPending boolean Will be true if the query has no cached data, no data from placeholderData and no error.
isPlaceholderData boolean Will be true if the data shown is the placeholder data.
isRefetchError boolean Will be true if the query has an error and still has data to display (for infinite queries, not after a failed page fetch).
isRefetching boolean Is true whenever a background refetch is in-flight, which does not include initial pending. - Is the same as isFetching && !isPending.
isStale boolean Will be true if the data in the cache is invalidated or if the data is older than the given staleTime.
isSuccess boolean A derived boolean from the status variable, provided for convenience. - true if the query has cached data or data from placeholderData, and no error.
refetch (options?: RefetchOptions) => Promise<QueryObserverResult<TData, TError>> A function to manually refetch the query.
status "error" | "pending" | "success" The status of the query. - Will be: - error if the query has an error from a fetch that failed after its retries, or if select threw. - success if the query has cached data (even if select returns undefined) or data from placeholderData, and no error. - pending otherwise, since the query has no cached data, no data from placeholderData and no error.