copyWith method

QueryOptions<T> copyWith({
  1. List<Object>? queryKey,
  2. QueryFetcher<T>? queryFn,
  3. Duration? staleTime,
  4. Duration? cacheTime,
  5. RetryConfig? retryConfig,
  6. bool? refetchOnWindowFocus,
  7. bool? refetchOnReconnect,
  8. bool? refetchOnMount,
  9. bool? enabled,
  10. T? initialData,
  11. T? placeholderData,
  12. bool? keepPreviousData,
  13. bool? structuralSharing,
  14. void onSuccess(
    1. T data
    )?,
  15. void onError(
    1. Object error
    )?,
  16. void onSettled(
    1. T? data,
    2. Object? error
    )?,
  17. R select<R>(
    1. T data
    )?,
  18. NetworkMode? networkMode,
  19. Map<String, dynamic>? meta,
})

Implementation

QueryOptions<T> copyWith({
  List<Object>? queryKey,
  QueryFetcher<T>? queryFn,
  Duration? staleTime,
  Duration? cacheTime,
  RetryConfig? retryConfig,
  bool? refetchOnWindowFocus,
  bool? refetchOnReconnect,
  bool? refetchOnMount,
  bool? enabled,
  T? initialData,
  T? placeholderData,
  bool? keepPreviousData,
  bool? structuralSharing,
  void Function(T data)? onSuccess,
  void Function(Object error)? onError,
  void Function(T? data, Object? error)? onSettled,
  R Function<R>(T data)? select,
  NetworkMode? networkMode,
  Map<String, dynamic>? meta,
}) {
  return QueryOptions<T>(
    queryKey: queryKey ?? this.queryKey,
    queryFn: queryFn ?? this.queryFn,
    staleTime: staleTime ?? this.staleTime,
    cacheTime: cacheTime ?? this.cacheTime,
    retryConfig: retryConfig ?? this.retryConfig,
    refetchOnWindowFocus: refetchOnWindowFocus ?? this.refetchOnWindowFocus,
    refetchOnReconnect: refetchOnReconnect ?? this.refetchOnReconnect,
    refetchOnMount: refetchOnMount ?? this.refetchOnMount,
    enabled: enabled ?? this.enabled,
    initialData: initialData ?? this.initialData,
    placeholderData: placeholderData ?? this.placeholderData,
    keepPreviousData: keepPreviousData ?? this.keepPreviousData,
    structuralSharing: structuralSharing ?? this.structuralSharing,
    onSuccess: onSuccess ?? this.onSuccess,
    onError: onError ?? this.onError,
    onSettled: onSettled ?? this.onSettled,
    select: select ?? this.select,
    networkMode: networkMode ?? this.networkMode,
    meta: meta ?? this.meta,
  );
}