Skip to content

API ReferenceReact provider and hooksInterface

UseCollectionQueryResult\<T\>

SDK-owned progressive collection state; no TanStack result types leak.

Type Parameters

Type Parameter
T

Properties

error

error: Error | undefined;

Initial-page error; later failures are reported by nextPageError.


fetchNextPage

fetchNextPage: () => void;

Advances pagination when hasNextPage is true. When the next page has already been requested and failed, this refetches that page rather than appending a further cursor, so a transient page failure does not wedge pagination.

Returns

void


hasNextPage

hasNextPage: boolean;

Whether the last successful page supplies an exact next cursor. Stays true while that next page is in a failed state, because the collection is not exhausted — fetchNextPage recovers it.


isFetchingNextPage

isFetchingNextPage: boolean;

Whether an explicit next-page request is in flight.


isLoading

isLoading: boolean;

Initial-load state. True while the first page is fetching, and also while a first read is paused rather than in flight — an offline request has neither a page nor an error, and TanStack reports isLoading: false because nothing is currently fetching. A hook with no definition is idle, not loading, so it settles false immediately.


items

items: T[];

Flattened items from every successfully fetched page.


nextPageError

nextPageError: Error | undefined;

Later-page error. Successful earlier pages remain available.


pages

pages: CollectionPage < T > [];

Atomic pages retained in fetch order.


retry

retry: () => void;

Re-runs the latest completed or failed page request.

Returns

void