You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am testing my React Native app which includes Apollo queries with Jest, and I noticed that the MockedProvider does not validate the GraphQL query, such as for undefined references. Here is a reproduce-able test file using react-testing-library and MockedProvider:
Actual outcome:
Even though the above BAD_QUERY includes undefined references $undefined_foo1, $undefined_foo2, the test still passes. However, if rendering TestComp with a non-mocked Apollo client the correct undefined GraphQL error is thrown:
[GraphQL error]: Message: Variable "$undefined_foo1" is not defined by operation "bob".
Intended outcome:
I am testing my React Native app which includes Apollo queries with Jest, and I noticed that the
MockedProvider
does not validate the GraphQL query, such as for undefined references. Here is a reproduce-able test file usingreact-testing-library
andMockedProvider
:Actual outcome:
Even though the above
BAD_QUERY
includes undefined references$undefined_foo1, $undefined_foo2
, the test still passes. However, if renderingTestComp
with a non-mocked Apollo client the correct undefined GraphQL error is thrown:How to reproduce the issue:
See the above code block.
Versions
Using SDK 40.
The text was updated successfully, but these errors were encountered: