Skip to main content
Version: 11.x

Interface: TRPCQueryOptions<TData, TError>

Defined in: packages/react-query/src/shared/hooks/types.ts:99

Extends

Type Parameters

Type Parameter
TData
TError

Properties

_defaulted?

optional _defaulted: boolean

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:609

Inherited from

DistributiveOmit._defaulted


behavior?

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:602

Inherited from

DistributiveOmit.behavior


gcTime?

optional gcTime: number

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:594

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


initialData?

optional initialData: TData | InitialDataFunction<TData>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:600

Inherited from

DistributiveOmit.initialData


initialDataUpdatedAt?

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:601

Inherited from

DistributiveOmit.initialDataUpdatedAt


maxPages?

optional maxPages: number

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:618

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

Inherited from

DistributiveOmit.maxPages


meta?

optional meta: Record<string, unknown>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:614

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


networkMode?

optional networkMode: NetworkMode

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:587

Inherited from

DistributiveOmit.networkMode


persister()?

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:596

Parameters

ParameterTypeDescription
queryFnQueryFunction<NoInfer<TData>, any, never>-
context{ client: QueryClient; direction: unknown; meta: undefined | Record<string, unknown>; pageParam: unknown; queryKey: any; signal: AbortSignal; }-
context.clientQueryClient-
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-

Returns

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

Inherited from

DistributiveOmit.persister


queryFn?

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:595

Inherited from

DistributiveOmit.queryFn


queryHash?

optional queryHash: string

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:597

Inherited from

DistributiveOmit.queryHash


queryKey

queryKey: TRPCQueryKey

Defined in: packages/react-query/src/shared/hooks/types.ts:102


queryKeyHashFn?

optional queryKeyHashFn: QueryKeyHashFunction<any>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:599

Inherited from

DistributiveOmit.queryKeyHashFn


retry?

optional retry: RetryValue<TError>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:585

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


retryDelay?

optional retryDelay: RetryDelayValue<TError>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:586

Inherited from

DistributiveOmit.retryDelay


structuralSharing?

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.66.0/node_modules/@tanstack/query-core/build/legacy/hydration-De1u5VYH.d.ts:608

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


trpc?

optional trpc: TRPCReactRequestOptions

Defined in: packages/react-query/src/shared/hooks/types.ts:58

tRPC-related options

Inherited from

TRPCUseQueryBaseOptions.trpc