Interface: DefinedTRPCInfiniteQueryOptionsIn<TInput, TQueryFnData, TData, TError>
Extends
DistributiveOmit
<DefinedInitialDataInfiniteOptions
<TQueryFnData
,TError
,InfiniteData
<TData
,NonNullable
<ExtractCursorType
<TInput
>> |null
>,TRPCQueryKey
,NonNullable
<ExtractCursorType
<TInput
>> |null
>,TRPCInfiniteOptionOverrides
>.TRPCQueryBaseOptions
Type Parameters
Type Parameter |
---|
TInput |
TQueryFnData |
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
_optimisticResults?
optional
_optimisticResults:"optimistic"
|"isRestoring"
Inherited from
DistributiveOmit._optimisticResults
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:713
behavior?
optional
behavior:QueryBehavior
<TQueryFnData
,TError
,InfiniteData
<TQueryFnData
,null
|NonNullable
<ExtractCursorType
<TInput
>>>,TRPCQueryKey
>
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
enabled?
optional
enabled:Enabled
<TQueryFnData
,TError
,InfiniteData
<TQueryFnData
,null
|NonNullable
<ExtractCursorType
<TInput
>>>,TRPCQueryKey
>
Set this to false
or a function that returns 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.
Accepts a boolean or function that returns a boolean.
Defaults to true
.
Inherited from
DistributiveOmit.enabled
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:636
experimental_prefetchInRender?
optional
experimental_prefetchInRender:boolean
Enable prefetching during rendering
Inherited from
DistributiveOmit.experimental_prefetchInRender
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:717
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
getNextPageParam
getNextPageParam:
GetNextPageParamFunction
<null
|NonNullable
<ExtractCursorType
<TInput
>>,TQueryFnData
>
This function can be set to automatically get the next cursor for infinite queries.
The result will also be used to determine the value of hasNextPage
.
Inherited from
DistributiveOmit.getNextPageParam
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:626
getPreviousPageParam?
optional
getPreviousPageParam:GetPreviousPageParamFunction
<null
|NonNullable
<ExtractCursorType
<TInput
>>,TQueryFnData
>
This function can be set to automatically get the previous cursor for infinite queries.
The result will also be used to determine the value of hasPreviousPage
.
Inherited from
DistributiveOmit.getPreviousPageParam
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:621
initialCursor?
optional
initialCursor:null
|NonNullable
<ExtractCursorType
<TInput
>>
Defined in
packages/react-query/src/shared/types.ts:173
initialData
initialData:
undefined
| (InfiniteData<TQueryFnData, NonNullable<ExtractCursorType<TInput>> | null> | InitialDataFunction<InfiniteData<TQueryFnData, NonNullable<...> | null>>) & (InfiniteData<...> | (() => InfiniteData<...>))
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
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.
Inherited from
DistributiveOmit.notifyOnChangeProps
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:690
persister?
optional
persister:QueryPersister
<NoInfer
<TQueryFnData
>,TRPCQueryKey
,NoInfer
<null
|NonNullable
<ExtractCursorType
<TInput
>>>>
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
placeholderData?
optional
placeholderData:InfiniteData
<TQueryFnData
,null
|NonNullable
<ExtractCursorType
<TInput
>>> |PlaceholderDataFunction
<InfiniteData
<TQueryFnData
,null
|NonNullable
<ExtractCursorType
<TInput
>>>,TError
,InfiniteData
<TQueryFnData
,null
|NonNullable
<ExtractCursorType
<TInput
>>>,TRPCQueryKey
>
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.
Inherited from
DistributiveOmit.placeholderData
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:712
queryKeyHashFn?
optional
queryKeyHashFn:QueryKeyHashFunction
<TRPCQueryKey
>
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
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
.
Inherited from
DistributiveOmit.refetchInterval
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:648
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
.
Inherited from
DistributiveOmit.refetchIntervalInBackground
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:653
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
.
Inherited from
DistributiveOmit.refetchOnMount
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:677
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
)
Inherited from
DistributiveOmit.refetchOnReconnect
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:669
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
.
Inherited from
DistributiveOmit.refetchOnWindowFocus
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:661
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
retryOnMount?
optional
retryOnMount:boolean
If set to false
, the query will not be retried on mount if it contains an error.
Defaults to true
.
Inherited from
DistributiveOmit.retryOnMount
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:682
select()?
optional
select: (data
) =>InfiniteData
<TData
,null
|NonNullable
<ExtractCursorType
<TInput
>>>
This option can be used to transform or select a part of the data returned by the query function.
Parameters
Parameter | Type |
---|---|
data | InfiniteData <TQueryFnData , null | NonNullable <ExtractCursorType <TInput >>> |
Returns
InfiniteData
<TData
, null
| NonNullable
<ExtractCursorType
<TInput
>>>
Inherited from
DistributiveOmit.select
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:702
staleTime?
optional
staleTime:StaleTime
<TQueryFnData
,TError
,InfiniteData
<TQueryFnData
,null
|NonNullable
<ExtractCursorType
<TInput
>>>,TRPCQueryKey
>
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
.
Inherited from
DistributiveOmit.staleTime
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:642
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
throwOnError?
optional
throwOnError:ThrowOnError
<TQueryFnData
,TError
,InfiniteData
<TQueryFnData
,null
|NonNullable
<ExtractCursorType
<TInput
>>>,TRPCQueryKey
>
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
.
Inherited from
DistributiveOmit.throwOnError
Defined in
node_modules/.pnpm/@tanstack+query-core@5.62.8/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H.d.ts:698
trpc?
optional
trpc:TRPCReactRequestOptions
tRPC-related options