Aller au contenu principal
Version : 11.x

Interface: UseTRPCSuspenseQueryOptions<TOutput, TData, TError>

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

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


_optimisticResults?​

optional _optimisticResults: "optimistic" | "isRestoring"

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

Inherited from​

DistributiveOmit._optimisticResults


behavior?​

optional behavior: QueryBehavior<TOutput, TError, TOutput, 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


experimental_prefetchInRender?​

optional experimental_prefetchInRender: boolean

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

Enable prefetching during rendering

Inherited from​

DistributiveOmit.experimental_prefetchInRender


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: TOutput | InitialDataFunction<TOutput>

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


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


notifyOnChangeProps?​

optional notifyOnChangeProps: NotifyOnChangeProps

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

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.

Inherited from​

DistributiveOmit.notifyOnChangeProps


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: QueryFunction<TOutput, any, never>

Defined in: node_modules/.pnpm/@tanstack+react-query@5.80.3_react@19.1.0/node_modules/@tanstack/react-query/build/modern/types.d.ts:16

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


refetchInterval?​

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

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

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.

Inherited from​

DistributiveOmit.refetchInterval


refetchIntervalInBackground?​

optional refetchIntervalInBackground: boolean

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

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

Inherited from​

DistributiveOmit.refetchIntervalInBackground


refetchOnMount?​

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

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

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.

Inherited from​

DistributiveOmit.refetchOnMount


refetchOnReconnect?​

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

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

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)

Inherited from​

DistributiveOmit.refetchOnReconnect


refetchOnWindowFocus?​

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

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

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.

Inherited from​

DistributiveOmit.refetchOnWindowFocus


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


retryOnMount?​

optional retryOnMount: boolean

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

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

Inherited from​

DistributiveOmit.retryOnMount


select()?​

optional select: (data) => TData

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

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

Parameters​

ParameterType
dataTOutput

Returns​

TData

Inherited from​

DistributiveOmit.select


staleTime?​

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

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

The time in milliseconds after data is considered stale. If set to Infinity, the data will never be considered stale. If set to a function, the function will be executed with the query to compute a staleTime. Defaults to 0.

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


subscribed?​

optional subscribed: boolean

Defined in: node_modules/.pnpm/@tanstack+react-query@5.80.3_react@19.1.0/node_modules/@tanstack/react-query/build/modern/types.d.ts:9

Set this to false to unsubscribe this observer from updates to the query cache. Defaults to true.

Inherited from​

DistributiveOmit.subscribed


trpc?​

optional trpc: TRPCReactRequestOptions

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

tRPC-related options

Inherited from​

TRPCUseQueryBaseOptions.trpc