Skip to content
IC Reactor

InfiniteQueryConfig

Defined in: react/src/createInfiniteQuery.ts:105

Configuration for createActorInfiniteQuery. Extends InfiniteQueryObserverOptions to accept standard TanStack Query infinite-query options at the create level (e.g. refetchInterval, refetchOnMount, refetchOnWindowFocus, retry, gcTime, networkMode).

Service = BaseActor

The actor interface type

Method extends FunctionName<Service> = FunctionName<Service>

The method name on the actor

Transform extends TransformKey = "candid"

The transformation key (identity, display, etc.)

TPageParam = unknown

The type of the page parameter

Selected = InfiniteData<InfiniteQueryPageData<Service, Method, Transform>, TPageParam>

The type returned after select transformation

functionName: Method

Defined in: react/src/createInfiniteQuery.ts:125

The method to call on the canister


optional callConfig?: CallConfig

Defined in: react/src/createInfiniteQuery.ts:127

Call configuration for the actor method


optional queryKey?: readonly unknown[]

Defined in: react/src/createInfiniteQuery.ts:129

Custom query key (optional, auto-generated if not provided)


initialPageParam: TPageParam

Defined in: react/src/createInfiniteQuery.ts:131

Initial page parameter

Omit.initialPageParam


getArgs: (pageParam) => ReactorArgs<Service, Method, Transform>

Defined in: react/src/createInfiniteQuery.ts:133

Function to get args from page parameter

TPageParam

ReactorArgs<Service, Method, Transform>


optional getKeyArgs?: (args) => unknown

Defined in: react/src/createInfiniteQuery.ts:143

Narrows what the cache key derives from the call arguments.

By default the key is scoped by getArgs(initialPageParam), so two infinite queries on the same method with different arguments stay in separate cache entries. Supply this when those args embed the cursor and only part of them identifies the query — return the stable, serializable portion (typically everything except the pagination field).

ReactorArgs<Service, Method, Transform>

unknown


getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => TPageParam | null | undefined

Defined in: react/src/createInfiniteQuery.ts:145

Function to determine next page parameter

ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>

ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>[]

TPageParam

TPageParam[]

TPageParam | null | undefined

Omit.getNextPageParam


optional getPreviousPageParam?: (firstPage, allPages, firstPageParam, allPageParams) => TPageParam | null | undefined

Defined in: react/src/createInfiniteQuery.ts:152

Function to determine previous page parameter (for bi-directional)

ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>

ReactorQueryData<ReactorReturnOk<Service, Method, Transform>>[]

TPageParam

TPageParam[]

TPageParam | null | undefined

Omit.getPreviousPageParam