When using useMutation and mocking this via graphQL mock to fail (.fail('...')), the result is an error is thrown. But when a graphQL error normally occurs with useMutation no error is thrown, the error is just returned via the error variable.
In the tests this isn't occuring because there is a { onError: noop } passed to the useMutation hook. But this shouldn't be necessary and is masking the problem.
When using useMutation and mocking this via graphQL mock to fail (
.fail('...')
), the result is an error is thrown. But when a graphQL error normally occurs with useMutation no error is thrown, the error is just returned via the error variable.In the tests this isn't occuring because there is a
{ onError: noop }
passed to the useMutation hook. But this shouldn't be necessary and is masking the problem.https://github.com/MadRabbit/graphql-mock/blob/master/test/mutations_test.tsx#L41