README
Apollo Hooks Extended
Let's start with big kudos for the authors and maintainers of Apollo, fantastic work :)
This package is a complementary library providing additional features for @apollo/client.
Installation
Using Yarn:
$ yarn add apollo-hooks-extended
# or
$ yarn add apollo-hooks-extended
Using Npm:
$ npm install apollo-hooks-extended
# or
$ npm i apollo-hooks-extended
Features
Resettable Hook
It is not currently possible to reset the state returned by the useMutation hook.
useResettableMutation
is a swap in replacement which wraps useMutation
and provides a reset
function.
import {useResettableMutation} from 'apollo-hooks-extended';
// ...
const [performMutation, {data, loading, error, reset}] = useResettableMutation(query);