flutter_graphql_hooks library


useLazyQuery({QueryOptions queryOptions, GraphQLClient client, HookOptions hookOptions = const HookOptions(true)}) QueryOperationResult<Map<String, dynamic>, _FetchFunction>
Similar to useQuery, however, this hook won't run immediately, making it more similar to the useMutation hook, which returns a function that is bound to the hook internal state. The fetch function returns a Future<Map<String, dynamic>> that will also throw an Exception, allowing imperative usage.
useMutation({MutationOptions mutationOptions, GraphQLClient client, HookOptions hookOptions = const HookOptions(true)}) MutationOperationResult<Map<String, dynamic>, _MutationFunction>
This hook creates a mutation function that is bound to the state being held by the hook (data, loading, error); The function is also a Future that returns a Map<String, dynamic> and throws, allowing imperative usage.
useQuery(QueryOptions queryOptions, {GraphQLClient client}) QueryOperationResult<Map<String, dynamic>, _RefetchFunction>
Runs the given query defined by the options param(QueryOptions) immediately after the Widget is built (see useEffect usage). The fetcher function is not meant to throw errors and these are stored in the error field.
useSubscription(SubscriptionOptions subscriptionOptions, {GraphQLClient client}) OperationResult<Map<String, dynamic>>
This hook is very similar to the useQuery but don't expose a refetch function, since it's nature is the one of a Stream. It will subscribe to the given subscription and unsubscribe thanks to the internal usage of useStream.