fquery library

Classes

DefaultQueryOptions
InfiniteQueryData<TPage, TPageParam>
MutationBuilder<TData, TError, TVariables, TContext>
QueryBuilder<TData, TError>
QueryClient
It is used to interact with the query cache. Can also be used to configure queries on a global basis using DefaultQueryOptions.
QueryClientProvider
This can be used to provide a QueryClient throughout the application.
UseInfiniteQueryOptions<TData, TError, TPageParam>
UseInfiniteQueryResult<TData, TError, TPageParam>
UseMutationOptions<TData, TError, TVariables, TContext>
UseMutationResult<TData, TError, TVariables>
UseQueriesOptions<TData, TError>
UseQueryOptions<TData, TError>
UseQueryResult<TData, TError>

Functions

useInfiniteQuery<TData, TError, TPageParam>(QueryKey queryKey, InfiniteQueryFn<TData, TPageParam> queryFn, {required TPageParam initialPageParam, required TPageParam? getNextPageParam(TData, List<TData>, TPageParam, List<TPageParam>), TPageParam? getPreviousPageParam(TData, List<TData>, TPageParam, List<TPageParam>)?, int? maxPages, bool enabled = true, RefetchOnMount? refetchOnMount, Duration? staleDuration, Duration? cacheDuration, Duration? refetchInterval, int retryCount = 3, Duration retryDelay = const Duration(seconds: 1, milliseconds: 500)}) UseInfiniteQueryResult<TData, TError, TPageParam>
Used for infinite query. In addition to queryKey and queryFn, it requires an initialPageParam and getNextPageParam option. The query function receives the pageParam parameter that can be used to fetch the current page.
useIsFetching() int
useMutation<TData, TError, TVariables, TContext>(Future<TData> mutationFn(TVariables), {FutureOr<TContext>? onMutate(TVariables)?, void onSuccess(TData, TVariables, TContext?)?, void onError(TError, TVariables, TContext?)?, void onSettled(TData?, TError?, TVariables, TContext?)?}) UseMutationResult<TData, TError, TVariables>
Builds a mutation and subscribes to it. Takes a mutation function which either resolves or throws an error. Returns a UseMutationResult Example:
useQueries<TData, TError>(List<UseQueriesOptions<TData, TError>> options) List<UseQueryResult<TData, TError>>
useQuery<TData, TError>(QueryKey queryKey, QueryFn<TData> fetcher, {bool enabled = true, RefetchOnMount? refetchOnMount, Duration? staleDuration, Duration? cacheDuration, Duration? refetchInterval, int retryCount = 3, Duration retryDelay = const Duration(seconds: 1, milliseconds: 500)}) UseQueryResult<TData, TError>
Builds and subscribes to a query stored in the cache. Takes a query key and a fetcher function which either resolves or throws an error. Returns a UseQueryResult
useQueryClient() QueryClient
Obtains the provided instance of QueryClient from the nearest QueryClientProvider ancestor.