QueryOptions<T> constructor
const
QueryOptions<T> ({
- required List<
Object> queryKey, - QueryFetcher<
T> ? queryFn, - Duration staleTime = const Duration(minutes: 5),
- Duration cacheTime = const Duration(minutes: 30),
- RetryConfig retryConfig = const RetryConfig(),
- bool refetchOnWindowFocus = true,
- bool refetchOnReconnect = true,
- bool refetchOnMount = true,
- bool enabled = true,
- T? initialData,
- T? placeholderData,
- bool keepPreviousData = false,
- bool structuralSharing = true,
- void onSuccess(
- T data
- void onError(
- Object error
- void onSettled(
- T? data,
- Object? error
- R select<
R>( - T data
- NetworkMode networkMode = NetworkMode.online,
- Map<
String, dynamic> ? meta,
Implementation
const QueryOptions({
required this.queryKey,
this.queryFn,
this.staleTime = const Duration(minutes: 5),
this.cacheTime = const Duration(minutes: 30),
this.retryConfig = const RetryConfig(),
this.refetchOnWindowFocus = true,
this.refetchOnReconnect = true,
this.refetchOnMount = true,
this.enabled = true,
this.initialData,
this.placeholderData,
this.keepPreviousData = false,
this.structuralSharing = true,
this.onSuccess,
this.onError,
this.onSettled,
this.select,
this.networkMode = NetworkMode.online,
this.meta,
});