Skip to main content
Version: 11.x

Interface: UseTRPCQueryOptions<TOutput, TData, TError, TQueryOptsData>

Extends

  • DistributiveOmit< UseBaseQueryOptions< TOutput, TError, TData, TQueryOptsData, any >, "queryKey" >.TRPCUseQueryBaseOptions

Type parameters

ParameterDefault
TOutput-
TData-
TError-
TQueryOptsDataTOutput

Properties

_defaulted

optional _defaulted: boolean

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:586

Inherited from

DistributiveOmit._defaulted


_optimisticResults

optional _optimisticResults: "optimistic" | "isRestoring"

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:695

Inherited from

DistributiveOmit._optimisticResults


behavior

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

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:579

Inherited from

DistributiveOmit.behavior


enabled

optional enabled: boolean

Set this to false to disable automatic refetching when the query mounts or changes query keys. To refetch the query, use the refetch method returned from the useQuery instance. Defaults to true.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:619

Inherited from

DistributiveOmit.enabled


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.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:571

Inherited from

DistributiveOmit.gcTime


initialData

optional initialData: TQueryOptsData | InitialDataFunction< TQueryOptsData >

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:577

Inherited from

DistributiveOmit.initialData


initialDataUpdatedAt

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

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:578

Inherited from

DistributiveOmit.initialDataUpdatedAt


maxPages

optional maxPages: number

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

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:595

Inherited from

DistributiveOmit.maxPages


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.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:591

Inherited from

DistributiveOmit.meta


networkMode

optional networkMode: NetworkMode

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:564

Inherited from

DistributiveOmit.networkMode


notifyOnChangeProps

optional notifyOnChangeProps: NotifyOnChangeProps

If set, the component will only re-render if any of the listed properties change. When set to ['data', 'error'], the component will only re-render when the data or error properties change. When set to 'all', the component will re-render whenever a query is updated. When set to a function, the function will be executed to compute the list of properties. By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:672

Inherited from

DistributiveOmit.notifyOnChangeProps


persister

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

Parameters

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

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:573

Inherited from

DistributiveOmit.persister


placeholderData

optional placeholderData: NonFunctionGuard< TQueryOptsData > | PlaceholderDataFunction< NonFunctionGuard< TQueryOptsData >, TError, NonFunctionGuard< TQueryOptsData >, any >

If set, this value will be used as the placeholder data for this particular query observer while the query is still in the loading data and no initialData has been provided.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:694

Inherited from

DistributiveOmit.placeholderData


queryFn

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

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:572

Inherited from

DistributiveOmit.queryFn


queryHash

optional queryHash: string

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:574

Inherited from

DistributiveOmit.queryHash


queryKeyHashFn

optional queryKeyHashFn: QueryKeyHashFunction< any >

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:576

Inherited from

DistributiveOmit.queryKeyHashFn


refetchInterval

optional refetchInterval: number | false | (query) => undefined | number | false

If set to a number, the query will continuously refetch at this frequency in milliseconds. If set to a function, the function will be executed with the latest data and query to compute a frequency Defaults to false.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:630

Inherited from

DistributiveOmit.refetchInterval


refetchIntervalInBackground

optional refetchIntervalInBackground: boolean

If set to true, the query will continue to refetch while their tab/window is in the background. Defaults to false.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:635

Inherited from

DistributiveOmit.refetchIntervalInBackground


refetchOnMount

optional refetchOnMount: boolean | "always" | (query) => boolean | "always"

If set to true, the query will refetch on mount if the data is stale. If set to false, will disable additional instances of a query to trigger background refetch. If set to 'always', the query will always refetch on mount. If set to a function, the function will be executed with the latest data and query to compute the value Defaults to true.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:659

Inherited from

DistributiveOmit.refetchOnMount


refetchOnReconnect

optional refetchOnReconnect: boolean | "always" | (query) => boolean | "always"

If set to true, the query will refetch on reconnect if the data is stale. If set to false, the query will not refetch on reconnect. If set to 'always', the query will always refetch on reconnect. If set to a function, the function will be executed with the latest data and query to compute the value. Defaults to the value of networkOnline (true)

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:651

Inherited from

DistributiveOmit.refetchOnReconnect


refetchOnWindowFocus

optional refetchOnWindowFocus: boolean | "always" | (query) => boolean | "always"

If set to true, the query will refetch on window focus if the data is stale. If set to false, the query will not refetch on window focus. If set to 'always', the query will always refetch on window focus. If set to a function, the function will be executed with the latest data and query to compute the value. Defaults to true.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:643

Inherited from

DistributiveOmit.refetchOnWindowFocus


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.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:562

Inherited from

DistributiveOmit.retry


retryDelay

optional retryDelay: RetryDelayValue< TError >

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:563

Inherited from

DistributiveOmit.retryDelay


retryOnMount

optional retryOnMount: boolean

If set to false, the query will not be retried on mount if it contains an error. Defaults to true.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:664

Inherited from

DistributiveOmit.retryOnMount


select

optional select: (data) => TData

This option can be used to transform or select a part of the data returned by the query function.

Parameters

ParameterType
dataTQueryOptsData

Returns

TData

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:684

Inherited from

DistributiveOmit.select


staleTime

optional staleTime: number

The time in milliseconds after data is considered stale. If set to Infinity, the data will never be considered stale.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:624

Inherited from

DistributiveOmit.staleTime


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.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:585

Inherited from

DistributiveOmit.structuralSharing


suspense

optional suspense: boolean

If set to true, the query will suspend when status === 'pending' and throw errors when status === 'error'. Defaults to false.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:690

Inherited from

DistributiveOmit.suspense


throwOnError

optional throwOnError: ThrowOnError< TOutput, TError, TQueryOptsData, any >

Whether errors should be thrown instead of setting the error property. If set to true or suspense is true, all errors will be thrown to the error boundary. If set to false and suspense is false, errors are returned as state. If set to a function, it will be passed the error and the query, and it should return a boolean indicating whether to show the error in an error boundary (true) or return the error as state (false). Defaults to false.

Source

node_modules/.pnpm/@tanstack+query-core@5.40.0_patch_hash=7ja3td4letobdpqmvjcy7vchqm/node_modules/@tanstack/query-core/build/legacy/hydration-yBB_smkL.d.ts:680

Inherited from

DistributiveOmit.throwOnError


trpc

optional trpc: TRPCReactRequestOptions

tRPC-related options

Source

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

Inherited from

TRPCUseQueryBaseOptions.trpc


Generated using TypeDoc and typedoc-plugin-markdown