fquery
library
Classes
ChildWidgetWrapper
DefaultQueryOptions
InfiniteQueryBuilder <TData , TError , TPageParam >
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 .
QueryClientBuilder <TData , TError >
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 > (RawQueryKey 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 , Duration ? retryDelay })
→ 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 > (RawQueryKey queryKey , QueryFn<TData > fetcher , {bool enabled = true , RefetchOnMount ? refetchOnMount , Duration ? staleDuration , Duration ? cacheDuration , Duration ? refetchInterval , int ? retryCount , Duration ? retryDelay })
→ 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.