Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

useMutation incorrectly includes errorPolicy in its option types #3728

Open
Jayphen opened this issue Dec 5, 2019 · 1 comment
Open

useMutation incorrectly includes errorPolicy in its option types #3728

Jayphen opened this issue Dec 5, 2019 · 1 comment

Comments

@Jayphen
Copy link

Jayphen commented Dec 5, 2019

The types for useMutation indicate that it does support errorPolicy.

useMutation is typed with OperationVariables as the second parameter: https://github.com/apollographql/react-apollo/blob/master/packages/hooks/src/useMutation.ts#L8

OperationVariables has an errorPolicy type https://github.com/apollographql/react-apollo/blob/master/packages/common/src/types/types.ts#L34

Thus, the typings for useMutation indicate that it supports errorPolicy, when in fact the setting will be silently ignored.

@apollo/react-hooks 3.0.1

@jamesreggio
Copy link
Contributor

I've opened a PR here: apollographql/apollo-client#5863

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants