# SkippableInfiniteQueryConfig

Defined in: [react/src/createInfiniteQuery.ts:198](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L198)

Configuration for the non-suspense infinite query hook of
`createActorHooks` and `defineReactor` (`useActorInfiniteQuery`): an
[InfiniteQueryConfig](https://ic-reactor.b3pay.net/v3/libs/interfaces/infinitequeryconfig/) whose `getArgs` may also be TanStack Query's
`skipToken`, for a list whose arguments are not known yet.

A skipped list does not fetch. It has an entry of its own under its method
and config `queryKey` (at the canister and agent `callConfig` names), which
no call's key shares, so it shows no data until the arguments arrive. Once
`getArgs` is a function, the list is keyed and fetched as usual. Its
`refetch()` has nothing to run: TanStack Query answers it with a "Missing
queryFn" error. `useActorSuspenseInfiniteQuery` does not take `skipToken`.

## Example

```typescript
import { skipToken } from "@ic-reactor/react"

const { data } = useActorInfiniteQuery({
  functionName: "get_transactions",
  getArgs: account
    ? (start: bigint) => [{ account, start, length: 20n }]
    : skipToken,
  initialPageParam: 0n,
  getNextPageParam: (lastPage) => lastPage.next[0],
})
```

## Extends

- `Omit`\<[`InfiniteQueryConfig`](https://ic-reactor.b3pay.net/v3/libs/interfaces/infinitequeryconfig/)\<`Service`, `Method`, `Transform`, `TPageParam`, `Selected`\>, `"getArgs"`\>

## Type Parameters

### Service

`Service` = [`BaseActor`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/baseactor/)

### Method

`Method` *extends* [`FunctionName`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/functionname/)\<`Service`\> = [`FunctionName`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/functionname/)\<`Service`\>

### Transform

`Transform` *extends* [`TransformKey`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/transformkey/) = `"candid"`

### TPageParam

`TPageParam` = `unknown`

### Selected

`Selected` = `InfiniteData`\<[`InfiniteQueryPageData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/infinitequerypagedata/)\<`Service`, `Method`, `Transform`\>, `TPageParam`\>

## Properties

### functionName

> **functionName**: `Method`

Defined in: [react/src/createInfiniteQuery.ts:136](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L136)

The method to call on the canister

#### Inherited from

`Omit.functionName`

***

### callConfig?

> `optional` **callConfig?**: `CallConfig`

Defined in: [react/src/createInfiniteQuery.ts:138](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L138)

Call configuration for the actor method

#### Inherited from

`Omit.callConfig`

***

### queryKey?

> `optional` **queryKey?**: readonly `unknown`[]

Defined in: [react/src/createInfiniteQuery.ts:140](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L140)

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

#### Inherited from

`Omit.queryKey`

***

### initialPageParam

> **initialPageParam**: `TPageParam`

Defined in: [react/src/createInfiniteQuery.ts:142](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L142)

Initial page parameter

#### Inherited from

`Omit.initialPageParam`

***

### getKeyArgs?

> `optional` **getKeyArgs?**: (`args`) => `unknown`

Defined in: [react/src/createInfiniteQuery.ts:154](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L154)

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

#### Parameters

##### args

[`ReactorArgs`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorargs/)\<`Service`, `Method`, `Transform`\>

#### Returns

`unknown`

#### Inherited from

`Omit.getKeyArgs`

***

### getNextPageParam

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

Defined in: [react/src/createInfiniteQuery.ts:156](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L156)

Function to determine next page parameter

#### Parameters

##### lastPage

[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>

##### allPages

[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>[]

##### lastPageParam

`TPageParam`

##### allPageParams

`TPageParam`[]

#### Returns

`TPageParam` \| `null` \| `undefined`

#### Inherited from

`Omit.getNextPageParam`

***

### getPreviousPageParam?

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

Defined in: [react/src/createInfiniteQuery.ts:163](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L163)

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

#### Parameters

##### firstPage

[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>

##### allPages

[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>[]

##### firstPageParam

`TPageParam`

##### allPageParams

`TPageParam`[]

#### Returns

`TPageParam` \| `null` \| `undefined`

#### Inherited from

`Omit.getPreviousPageParam`

***

### getArgs

> **getArgs**: *typeof* `skipToken` \| ((`pageParam`) => [`ReactorArgs`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorargs/)\<`Service`, `Method`, `Transform`\>)

Defined in: [react/src/createInfiniteQuery.ts:215](https://github.com/B3Pay/ic-reactor/blob/f1956947ae037304fce1675a38695964c1aa9e32/packages/react/src/createInfiniteQuery.ts#L215)

Function to get args from page parameter, or `skipToken` while the args
are not known: the list then waits without fetching.