copyWith method
QueryObserverOptions<TData>
copyWith({
- QueryKey? queryKey,
- QueryFn<
TData> ? queryFn, - Enabled? enabled,
- StaleTime? staleTime,
- GcTime? gcTime,
- RetryPolicy? retry,
- RetryDelay? retryDelay,
- NetworkMode? networkMode,
- InitialData<
TData> ? initialData, - DateTime? initialDataUpdatedAt,
- DateTime? initialDataUpdatedAtCompute()?,
- StructuralSharing<
TData> ? structuralSharing, - Object? meta,
- PlaceholderData<
TData> ? placeholderData, - RefetchOn? refetchOnMount,
- RefetchOn? refetchOnWindowFocus,
- RefetchOn? refetchOnReconnect,
- RefetchInterval? refetchInterval,
- bool? refetchIntervalInBackground,
- bool? retryOnMount,
override
This, with the given fields replaced; each shape returns its own type.
select is not a field here — it is what tells the two shapes apart —
so only QuerySelectOptions.copyWith accepts one.
Implementation
@override
QueryObserverOptions<TData> copyWith({
QueryKey? queryKey,
QueryFn<TData>? queryFn,
Enabled? enabled,
StaleTime? staleTime,
GcTime? gcTime,
RetryPolicy? retry,
RetryDelay? retryDelay,
NetworkMode? networkMode,
InitialData<TData>? initialData,
DateTime? initialDataUpdatedAt,
DateTime? Function()? initialDataUpdatedAtCompute,
StructuralSharing<TData>? structuralSharing,
Object? meta,
PlaceholderData<TData>? placeholderData,
RefetchOn? refetchOnMount,
RefetchOn? refetchOnWindowFocus,
RefetchOn? refetchOnReconnect,
RefetchInterval? refetchInterval,
bool? refetchIntervalInBackground,
bool? retryOnMount,
}) =>
QueryObserverOptions<TData>(
queryKey: queryKey ?? this.queryKey,
queryFn: queryFn ?? this.queryFn,
enabled: enabled ?? this.enabled,
staleTime: staleTime ?? this.staleTime,
gcTime: gcTime ?? this.gcTime,
retry: retry ?? this.retry,
retryDelay: retryDelay ?? this.retryDelay,
networkMode: networkMode ?? this.networkMode,
initialData: initialData ?? this.initialData,
initialDataUpdatedAt: initialDataUpdatedAt ??
(initialDataUpdatedAtCompute == null
? this.initialDataUpdatedAt
: null),
initialDataUpdatedAtCompute: initialDataUpdatedAtCompute ??
(initialDataUpdatedAt == null
? this.initialDataUpdatedAtCompute
: null),
structuralSharing: structuralSharing ?? this.structuralSharing,
meta: meta ?? this.meta,
behavior: behavior,
placeholderData: placeholderData ?? this.placeholderData,
refetchOnMount: refetchOnMount ?? this.refetchOnMount,
refetchOnWindowFocus: refetchOnWindowFocus ?? this.refetchOnWindowFocus,
refetchOnReconnect: refetchOnReconnect ?? this.refetchOnReconnect,
refetchInterval: refetchInterval ?? this.refetchInterval,
refetchIntervalInBackground:
refetchIntervalInBackground ?? this.refetchIntervalInBackground,
retryOnMount: retryOnMount ?? this.retryOnMount,
);