copyWith method

  1. @override
QueryObserverOptions<TData> copyWith({
  1. QueryKey? queryKey,
  2. QueryFn<TData>? queryFn,
  3. Enabled? enabled,
  4. StaleTime? staleTime,
  5. GcTime? gcTime,
  6. RetryPolicy? retry,
  7. RetryDelay? retryDelay,
  8. NetworkMode? networkMode,
  9. InitialData<TData>? initialData,
  10. DateTime? initialDataUpdatedAt,
  11. DateTime? initialDataUpdatedAtCompute()?,
  12. StructuralSharing<TData>? structuralSharing,
  13. Object? meta,
  14. PlaceholderData<TData>? placeholderData,
  15. RefetchOn? refetchOnMount,
  16. RefetchOn? refetchOnWindowFocus,
  17. RefetchOn? refetchOnReconnect,
  18. RefetchInterval? refetchInterval,
  19. bool? refetchIntervalInBackground,
  20. 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,
    );