Skip to main content
Version: 11.x

Interface: UseTRPCPrefetchQueryOptions<TOutput, TData, TError>

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

Extendsโ€‹

Type Parametersโ€‹

Type Parameter
TOutput
TData
TError

Propertiesโ€‹

_defaulted?โ€‹

optional _defaulted: boolean

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:620

Inherited fromโ€‹

DistributiveOmit._defaulted


behavior?โ€‹

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:613

Inherited fromโ€‹

DistributiveOmit.behavior


gcTime?โ€‹

optional gcTime: number

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:605

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.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:611

Inherited fromโ€‹

DistributiveOmit.initialData


initialDataUpdatedAt?โ€‹

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:612

Inherited fromโ€‹

DistributiveOmit.initialDataUpdatedAt


initialPageParam?โ€‹

optional initialPageParam: undefined

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:746

Inherited fromโ€‹

DistributiveOmit.initialPageParam


maxPages?โ€‹

optional maxPages: number

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:629

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.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:625

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.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:598

Inherited fromโ€‹

DistributiveOmit.networkMode


persister()?โ€‹

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:607

Parametersโ€‹

ParameterTypeDescription
queryFnQueryFunction<NoInfer<TOutput>, 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<TOutput> | Promise<NoInfer<TOutput>>

Inherited fromโ€‹

DistributiveOmit.persister


queryFn?โ€‹

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:606

Inherited fromโ€‹

DistributiveOmit.queryFn


queryHash?โ€‹

optional queryHash: string

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:608

Inherited fromโ€‹

DistributiveOmit.queryHash


queryKeyHashFn?โ€‹

optional queryKeyHashFn: QueryKeyHashFunction<any>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:610

Inherited fromโ€‹

DistributiveOmit.queryKeyHashFn


retry?โ€‹

optional retry: RetryValue<TError>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:596

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.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:597

Inherited fromโ€‹

DistributiveOmit.retryDelay


staleTime?โ€‹

optional staleTime: StaleTimeFunction<TOutput, TError, TData, any>

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:751

The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache.

Inherited fromโ€‹

DistributiveOmit.staleTime


structuralSharing?โ€‹

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

Defined in: node_modules/.pnpm/@tanstack+query-core@5.80.2/node_modules/@tanstack/query-core/build/modern/hydration-DYrnn9Jo.d.ts:619

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