TanStack
API Reference

InfiniteQueryObserverLoadingErrorResult

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

Extends

Type Parameters

TData

TData = unknown

TError

TError = DefaultError

Properties

data

ts
data: undefined;

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

The last successfully resolved data for the query.

Overrides

InfiniteQueryObserverBaseResult.data


dataUpdatedAt

ts
dataUpdatedAt: number;

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

The timestamp for when the query most recently returned the status as "success".

Inherited from

InfiniteQueryObserverBaseResult.dataUpdatedAt


error

ts
error: TError;

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

The error object for the query, if an error was thrown.

  • Defaults to null.

Overrides

InfiniteQueryObserverBaseResult.error


errorUpdateCount

ts
errorUpdateCount: number;

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

The sum of all errors.

Inherited from

InfiniteQueryObserverBaseResult.errorUpdateCount


errorUpdatedAt

ts
errorUpdatedAt: number;

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

The timestamp for when the query most recently returned the status as "error".

Inherited from

InfiniteQueryObserverBaseResult.errorUpdatedAt


failureCount

ts
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 0 when the query succeeds.

Inherited from

InfiniteQueryObserverBaseResult.failureCount


failureReason

ts
failureReason: TError | null;

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

The failure reason for the query retry.

  • Reset to null when the query succeeds.

Inherited from

InfiniteQueryObserverBaseResult.failureReason


fetchNextPage()

ts
fetchNextPage: (options?) => Promise<InfiniteQueryObserverResult<TData, TError>>;

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

This function allows you to fetch the next "page" of results.

Parameters

options?

FetchNextPageOptions

Returns

Promise<InfiniteQueryObserverResult<TData, TError>>

Inherited from

InfiniteQueryObserverBaseResult.fetchNextPage


fetchPreviousPage()

ts
fetchPreviousPage: (options?) => Promise<InfiniteQueryObserverResult<TData, TError>>;

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

This function allows you to fetch the previous "page" of results.

Parameters

options?

FetchPreviousPageOptions

Returns

Promise<InfiniteQueryObserverResult<TData, TError>>

Inherited from

InfiniteQueryObserverBaseResult.fetchPreviousPage


fetchStatus

ts
fetchStatus: FetchStatus;

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

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.

Inherited from

InfiniteQueryObserverBaseResult.fetchStatus


hasNextPage

ts
hasNextPage: boolean;

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

Will be true if there is a next page to be fetched (known via the getNextPageParam option).

Inherited from

InfiniteQueryObserverBaseResult.hasNextPage


hasPreviousPage

ts
hasPreviousPage: boolean;

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

Will be true if there is a previous page to be fetched (known via the getPreviousPageParam option).

Inherited from

InfiniteQueryObserverBaseResult.hasPreviousPage


isEnabled

ts
isEnabled: boolean;

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

true if this observer is enabled, false otherwise.

Inherited from

InfiniteQueryObserverBaseResult.isEnabled


isError

ts
isError: true;

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

A derived boolean from the status variable, provided for convenience.

  • true if the query attempt resulted in an error.

Overrides

InfiniteQueryObserverBaseResult.isError


isFetched

ts
isFetched: boolean;

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

Will be true if the query has been fetched.

Inherited from

InfiniteQueryObserverBaseResult.isFetched


isFetchedAfterMount

ts
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.

Inherited from

InfiniteQueryObserverBaseResult.isFetchedAfterMount


isFetching

ts
isFetching: boolean;

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

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.

Inherited from

InfiniteQueryObserverBaseResult.isFetching


isFetchingNextPage

ts
isFetchingNextPage: boolean;

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

Will be true while fetching the next page with fetchNextPage.

Inherited from

InfiniteQueryObserverBaseResult.isFetchingNextPage


isFetchingPreviousPage

ts
isFetchingPreviousPage: boolean;

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

Will be true while fetching the previous page with fetchPreviousPage.

Inherited from

InfiniteQueryObserverBaseResult.isFetchingPreviousPage


isFetchNextPageError

ts
isFetchNextPageError: false;

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

Will be true if the query failed while fetching the next page.

Overrides

InfiniteQueryObserverBaseResult.isFetchNextPageError


isFetchPreviousPageError

ts
isFetchPreviousPageError: false;

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

Will be true if the query failed while fetching the previous page.

Overrides

InfiniteQueryObserverBaseResult.isFetchPreviousPageError


isInitialLoading

ts
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.

Inherited from

InfiniteQueryObserverBaseResult.isInitialLoading


isLoading

ts
isLoading: false;

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

Is true whenever the first fetch for a query is in-flight.

  • Is the same as isFetching && isPending.

Overrides

InfiniteQueryObserverBaseResult.isLoading


isLoadingError

ts
isLoadingError: true;

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

Will be true if the query failed while fetching for the first time.

Overrides

InfiniteQueryObserverBaseResult.isLoadingError


isPaused

ts
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.

Inherited from

InfiniteQueryObserverBaseResult.isPaused


isPending

ts
isPending: false;

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

Will be pending if there's no cached data and no query attempt was finished yet.

Overrides

InfiniteQueryObserverBaseResult.isPending


isPlaceholderData

ts
isPlaceholderData: false;

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

Will be true if the data shown is the placeholder data.

Overrides

InfiniteQueryObserverBaseResult.isPlaceholderData


isRefetchError

ts
isRefetchError: false;

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

Will be true if the query failed while refetching.

Overrides

InfiniteQueryObserverBaseResult.isRefetchError


isRefetching

ts
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.

Inherited from

InfiniteQueryObserverBaseResult.isRefetching


isStale

ts
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.

Inherited from

InfiniteQueryObserverBaseResult.isStale


isSuccess

ts
isSuccess: false;

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

A derived boolean from the status variable, provided for convenience.

  • true if the query has received a response with no errors and is ready to display its data.

Overrides

InfiniteQueryObserverBaseResult.isSuccess


refetch()

ts
refetch: (options?) => Promise<QueryObserverResult<TData, TError>>;

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

A function to manually refetch the query.

Parameters

options?

RefetchOptions

Returns

Promise<QueryObserverResult<TData, TError>>

Inherited from

InfiniteQueryObserverBaseResult.refetch


status

ts
status: "error";

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

The status of the query.

  • Will be:
    • pending if there's no cached data and no query attempt was finished yet.
    • error if the query attempt resulted in an error.
    • success if the query has received a response with no errors and is ready to display its data.

Overrides

InfiniteQueryObserverBaseResult.status