fquery
library
Functions
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:
useQuery <TData , TError > (QueryKey queryKey , QueryFn<TData > fetcher , {bool enabled = true , RefetchOnMount ? refetchOnMount , Duration ? staleDuration , Duration ? cacheDuration , Duration ? refetchInterval })
→ 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.