Skip to main content
Version: 11.x

Interface: TRPCQueryOptions<TData, TError>

Extends

Type Parameters

Type Parameter
TData
TError

Properties

_defaulted?

optional _defaulted: boolean

Inherited from

DistributiveOmit._defaulted

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:602


behavior?

optional behavior: QueryBehavior<TData, TError, TData, any>

Inherited from

DistributiveOmit.behavior

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:595


gcTime?

optional gcTime: number

The time in milliseconds that unused/inactive cache data remains in memory. When a query's cache becomes unused or inactive, that cache data will be garbage collected after this duration. When different garbage collection times are specified, the longest one will be used. Setting it to Infinity will disable garbage collection.

Inherited from

DistributiveOmit.gcTime

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:587


initialData?

optional initialData: TData | InitialDataFunction<TData>

Inherited from

DistributiveOmit.initialData

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:593


initialDataUpdatedAt?

optional initialDataUpdatedAt: number | () => undefined | number

Inherited from

DistributiveOmit.initialDataUpdatedAt

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:594


maxPages?

optional maxPages: number

Maximum number of pages to store in the data of an infinite query.

Inherited from

DistributiveOmit.maxPages

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:611


meta?

optional meta: Record<string, unknown>

Additional payload to be stored on each query. Use this property to pass information that can be used in other places.

Inherited from

DistributiveOmit.meta

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:607


networkMode?

optional networkMode: NetworkMode

Inherited from

DistributiveOmit.networkMode

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:580


persister()?

optional persister: (queryFn, context, query) => NoInfer<TData> | Promise<NoInfer<TData>>

Parameters

ParameterTypeDescription
queryFnQueryFunction<NoInfer<TData>, any, never>-
contextobject-
context.direction?unknownDeprecated if you want access to the direction, you can add it to the pageParam
context.metaundefined | Record<string, unknown>-
context.pageParam?unknown-
context.queryKeyany-
context.signalAbortSignal-
queryQuery<unknown, Error, unknown, QueryKey>-

Returns

NoInfer<TData> | Promise<NoInfer<TData>>

Inherited from

DistributiveOmit.persister

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:589


queryFn?

optional queryFn: typeof skipToken | QueryFunction<TData, any, never>

Inherited from

DistributiveOmit.queryFn

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:588


queryHash?

optional queryHash: string

Inherited from

DistributiveOmit.queryHash

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:590


queryKey

queryKey: TRPCQueryKey

Defined in

packages/react-query/src/shared/hooks/types.ts:101


queryKeyHashFn?

optional queryKeyHashFn: QueryKeyHashFunction<any>

Inherited from

DistributiveOmit.queryKeyHashFn

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:592


retry?

optional retry: RetryValue<TError>

If false, failed queries will not retry by default. If true, failed queries will retry infinitely., failureCount: num If set to an integer number, e.g. 3, failed queries will retry until the failed query count meets that number. If set to a function (failureCount, error) => boolean failed queries will retry until the function returns false.

Inherited from

DistributiveOmit.retry

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:578


retryDelay?

optional retryDelay: RetryDelayValue<TError>

Inherited from

DistributiveOmit.retryDelay

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:579


structuralSharing?

optional structuralSharing: boolean | (oldData, newData) => unknown

Set this to false to disable structural sharing between query results. Set this to a function which accepts the old and new data and returns resolved data of the same type to implement custom structural sharing logic. Defaults to true.

Inherited from

DistributiveOmit.structuralSharing

Defined in

node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:601


trpc?

optional trpc: TRPCReactRequestOptions

tRPC-related options

Inherited from

TRPCUseQueryBaseOptions.trpc

Defined in

packages/react-query/src/shared/hooks/types.ts:57