TanStack
API Reference

InfiniteQueryObserverPendingResult

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

An infinite query result in the pending state: the query has no data yet.

Extends

Type Parameters

TData

TData = unknown

TError

TError = DefaultError

Properties

PropertyTypeDescriptionOverrides
dataundefinedundefined, since the query has no data yet.InfiniteQueryObserverBaseResult.data
dataUpdatedAtnumberThe timestamp for when the query most recently returned the status as "success".-
errornullnull, since the query isn't in the error state.InfiniteQueryObserverBaseResult.error
errorUpdateCountnumberThe sum of all errors.-
errorUpdatedAtnumberThe timestamp for when the query most recently returned the status as "error".-
failureCountnumberThe failure count for the query. - Incremented every time the query fails. - Reset to 0 when the query succeeds.-
failureReasonTError | nullThe 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.-
hasNextPagebooleanWill be true if there is a next page to be fetched (known via the getNextPageParam option).-
hasPreviousPagebooleanWill be true if there is a previous page to be fetched (known via the getPreviousPageParam option).-
isEnabledbooleantrue if this observer is enabled, false otherwise.-
isErrorfalsefalse, since the query isn't in the error state.InfiniteQueryObserverBaseResult.isError
isFetchedbooleanWill be true if the query has been fetched.-
isFetchedAfterMountbooleanWill be true if the query has been fetched after the component mounted. - This property can be used to not show any previously cached data.-
isFetchingbooleanA derived boolean from the fetchStatus variable, provided for convenience. - true whenever the queryFn is executing, which includes initial pending as well as background refetch.-
isFetchingNextPagebooleanWill be true while fetching the next page with fetchNextPage.-
isFetchingPreviousPagebooleanWill be true while fetching the previous page with fetchPreviousPage.-
isFetchNextPageErrorfalsefalse, since fetching the next page didn't fail.InfiniteQueryObserverBaseResult.isFetchNextPageError
isFetchPreviousPageErrorfalsefalse, since fetching the previous page didn't fail.InfiniteQueryObserverBaseResult.isFetchPreviousPageError
isInitialLoadingbooleanDeprecated isInitialLoading is being deprecated in favor of isLoading and will be removed in the next major version.-
isLoadingbooleanIs true whenever the first fetch for a query is in-flight. - Is the same as isFetching && isPending.-
isLoadingErrorfalsefalse, since the query didn't fail while fetching for the first time.InfiniteQueryObserverBaseResult.isLoadingError
isPausedbooleanA derived boolean from the fetchStatus variable, provided for convenience. - The query wanted to fetch, but has been paused.-
isPendingtruetrue, since there's no cached data and no query attempt has finished yet.InfiniteQueryObserverBaseResult.isPending
isPlaceholderDatafalsefalse, since the data shown isn't the placeholderData.InfiniteQueryObserverBaseResult.isPlaceholderData
isRefetchErrorfalsefalse, since the query didn't fail while refetching.InfiniteQueryObserverBaseResult.isRefetchError
isRefetchingbooleanIs true whenever a background refetch is in-flight, which does not include initial pending. - Is the same as isFetching && !isPending.-
isStalebooleanWill be true if the data in the cache is invalidated or if the data is older than the given staleTime.-
isSuccessfalsefalse, since the query isn't in the success state.InfiniteQueryObserverBaseResult.isSuccess
refetch(options?: RefetchOptions) => Promise<QueryObserverResult<TData, TError>>A function to manually refetch the query.-
status"pending"'pending', since there's no cached data and no query attempt has finished yet.InfiniteQueryObserverBaseResult.status