# BaseQueryConfig

Defined in: [react/src/types.ts:68](https://github.com/B3Pay/ic-reactor/blob/ad82a03d03149c25f0d0f63e453f62e284c28b02/packages/react/src/types.ts#L68)

Base configuration for query wrappers (shared between regular and suspense).

## Extends

- `Omit`\<`QueryObserverOptions`\<[`QueryFnData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/queryfndata/)\<`Service`, `Method`, `Transform`\>, [`ReactorReturnErr`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnerr/)\<`Service`, `Method`, `Transform`\>, `Selected`, [`QueryFnData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/queryfndata/)\<`Service`, `Method`, `Transform`\>, `QueryKey`\>, `"queryFn"` \| `"queryKey"`\>

## Type Parameters

### Service

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

The actor interface type

### 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`\>

The method name on the actor

### Transform

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

The transformation key (identity, display, etc.)

### Selected

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

The type returned after select transformation

## Properties

### functionName

> **functionName**: `Method`

Defined in: [react/src/types.ts:84](https://github.com/B3Pay/ic-reactor/blob/ad82a03d03149c25f0d0f63e453f62e284c28b02/packages/react/src/types.ts#L84)

The method to call on the canister

***

### args?

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

Defined in: [react/src/types.ts:86](https://github.com/B3Pay/ic-reactor/blob/ad82a03d03149c25f0d0f63e453f62e284c28b02/packages/react/src/types.ts#L86)

Arguments to pass to the method (if any)

***

### callConfig?

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

Defined in: [react/src/types.ts:105](https://github.com/B3Pay/ic-reactor/blob/ad82a03d03149c25f0d0f63e453f62e284c28b02/packages/react/src/types.ts#L105)

Call configuration for the method, as `Reactor.callMethod` takes it: a
`canisterId` sends the query to another canister of the same interface,
an `agent` sends it through another agent, `effectiveCanisterId` routes
it. The query key carries what it sets, as the hooks' keys do, so the
answer is cached apart from the reactor's own canister and agent, and
`getQueryKey()`, `invalidate()` and the other cache controls act on that
entry.

#### Example

```typescript
// The same ledger interface, another token's canister
const ckbtcSymbol = createQuery(ledger, {
  functionName: "icrc1_symbol",
  callConfig: { canisterId: "mxzaz-hqaaa-aaaar-qaada-cai" },
})
```

***

### queryKey?

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

Defined in: [react/src/types.ts:107](https://github.com/B3Pay/ic-reactor/blob/ad82a03d03149c25f0d0f63e453f62e284c28b02/packages/react/src/types.ts#L107)

The query key to use for this query

***

### staleTime?

> `optional` **staleTime?**: `number`

Defined in: [react/src/types.ts:119](https://github.com/B3Pay/ic-reactor/blob/ad82a03d03149c25f0d0f63e453f62e284c28b02/packages/react/src/types.ts#L119)

How long data stays fresh before refetching, in milliseconds.

`createQuery`, `createSuspenseQuery` and their factories default to 5
minutes. The bound `useActorQuery` and `useActorSuspenseQuery` hooks (from
`createActorHooks` or `defineReactor`) set no default and leave it to
TanStack Query, which reads the QueryClient's
`defaultOptions.queries.staleTime`. With that unset too, `useActorQuery`
uses 0 and `useActorSuspenseQuery` uses 1 second, TanStack Query's
fallback for suspense queries.

#### Overrides

`Omit.staleTime`

***

### select?

> `optional` **select?**: (`data`) => `Selected`

Defined in: [react/src/types.ts:121](https://github.com/B3Pay/ic-reactor/blob/ad82a03d03149c25f0d0f63e453f62e284c28b02/packages/react/src/types.ts#L121)

Transform the raw result before returning

#### Parameters

##### data

[`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`\>\>

#### Returns

`Selected`

#### Overrides

`Omit.select`