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
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Wrap it with the graphql HOC (import { graphql } from 'react-apollo')
Note that I haven't tried simplifying this test case and its possible less setup is required.
Buggy Behavior
Rather than raising this.thisMethodIsntReal is not a function, Apollo catches the error, and passes it into the component as data, wiping out the actual data returned from the query. In doing so it (likely) causes a different obscure error in your component, because the component depended on the now missing data.
Here's my example with a debugger in render() to show the contents of this.props.data
Expected Behavior
Apollo should not catch errors it did not cause, this error should propagate to the console and so the second state, with no data, should never be reached.
This is my current workaround, which may be helpful to others. I wrap components in a HOC that doesn't swallow the error so its apollo(throwApolloError(component))
Steps to Reproduce
My case is produced as follows:
render()
, when a query is complete e.g.graphql
HOC (import { graphql } from 'react-apollo'
)Note that I haven't tried simplifying this test case and its possible less setup is required.
Buggy Behavior
Rather than raising
this.thisMethodIsntReal is not a function
, Apollo catches the error, and passes it into the component asdata
, wiping out the actual data returned from the query. In doing so it (likely) causes a different obscure error in your component, because the component depended on the now missing data.Here's my example with a
debugger
inrender()
to show the contents ofthis.props.data
Expected Behavior
Apollo should not catch errors it did not cause, this error should propagate to the console and so the second state, with no data, should never be reached.
Version
The text was updated successfully, but these errors were encountered: