hally9k-apollo-hooks-extended
v0.2.0
Published
Library of additional hooks and wrappers for Apollo Client
Maintainers
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-extendedUsing Npm:
$ npm install apollo-hooks-extended
# or
$ npm i apollo-hooks-extendedFeatures
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);