Interface: EnsureQueryDataOptions<TQueryFnData, TError, TData, TQueryKey, TPageParam>#
Defined in: packages/query-core/src/types.ts:509
Extends#
FetchQueryOptions<TQueryFnData,TError,TData,TQueryKey,TPageParam>
Type Parameters#
TQueryFnData#
TQueryFnData = unknown
TError#
TError = DefaultError
TData#
TData = TQueryFnData
TQueryKey#
TQueryKey extends QueryKey = QueryKey
TPageParam#
TPageParam = never
Properties#
_defaulted?#
optional _defaulted: boolean;
Defined in: packages/query-core/src/types.ts:268
Inherited from#
behavior?#
optional behavior: QueryBehavior<TQueryFnData, TError, TData, TQueryKey>;
Defined in: packages/query-core/src/types.ts:259
Inherited from#
gcTime?#
optional gcTime: number;
Defined in: packages/query-core/src/types.ts:247
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#
initialData?#
optional initialData:
| TData
| InitialDataFunction<TData>;
Defined in: packages/query-core/src/types.ts:257
Inherited from#
initialDataUpdatedAt?#
optional initialDataUpdatedAt: number | () => number | undefined;
Defined in: packages/query-core/src/types.ts:258
Inherited from#
FetchQueryOptions.initialDataUpdatedAt
initialPageParam?#
optional initialPageParam: undefined;
Defined in: packages/query-core/src/types.ts:501
Inherited from#
FetchQueryOptions.initialPageParam
maxPages?#
optional maxPages: number;
Defined in: packages/query-core/src/types.ts:277
Maximum number of pages to store in the data of an infinite query.
Inherited from#
meta?#
optional meta: Record<string, unknown>;
Defined in: packages/query-core/src/types.ts:273
Additional payload to be stored on each query. Use this property to pass information that can be used in other places.
Inherited from#
networkMode?#
optional networkMode: NetworkMode;
Defined in: packages/query-core/src/types.ts:240
Inherited from#
persister?#
optional persister: QueryPersister<NoInfer<TQueryFnData>, NoInfer<TQueryKey>, NoInfer<TPageParam>>;
Defined in: packages/query-core/src/types.ts:249
Inherited from#
queryFn?#
optional queryFn:
| typeof skipToken
| QueryFunction<TQueryFnData, TQueryKey, TPageParam>;
Defined in: packages/query-core/src/types.ts:248
Inherited from#
queryHash?#
optional queryHash: string;
Defined in: packages/query-core/src/types.ts:254
Inherited from#
queryKey#
queryKey: TQueryKey & object;
Defined in: packages/query-core/src/types.ts:255
Inherited from#
queryKeyHashFn?#
optional queryKeyHashFn: QueryKeyHashFunction<TQueryKey>;
Defined in: packages/query-core/src/types.ts:256
Inherited from#
FetchQueryOptions.queryKeyHashFn
retry?#
optional retry: RetryValue<TError>;
Defined in: packages/query-core/src/types.ts:238
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#
retryDelay?#
optional retryDelay: RetryDelayValue<TError>;
Defined in: packages/query-core/src/types.ts:239
Inherited from#
revalidateIfStale?#
optional revalidateIfStale: boolean;
Defined in: packages/query-core/src/types.ts:522
staleTime?#
optional staleTime: StaleTimeFunction<TQueryFnData, TError, TData, TQueryKey>;
Defined in: packages/query-core/src/types.ts:506
The time in milliseconds after data is considered stale. If the data is fresh it will be returned from the cache.
Inherited from#
structuralSharing?#
optional structuralSharing: boolean | (oldData, newData) => unknown;
Defined in: packages/query-core/src/types.ts:265
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.