-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Intended outcome:
The following @client only query:
const GET_COUNT = gql`
query GetCount {
count @client
}
`;
<Query query={GET_COUNT}>
{({ loading, error, data }) => {
if (loading) {
return <p>Loading GET_COUNT query</p>;
}
if (error) {
return <p>An error ocurred: {error.message}</p>;
}
return <p>Page ready</p>
}}
</Query>Should be capable of handling an error returned by the resolver:
const resolvers = {
Query: {
count() {
throw new Error('Oh no!')
}
}
};Actual outcome:
The query renders again with error set with the thrown error, but it renders again immediately after with error as undefined, so It's not possible to actually handle the error.
How to reproduce the issue:
I created a repo showing the error, which also shows a error with apollo dev tools: https://github.com/lfades/apollo-state-issue. It's important to notice that I'm not using a GraphQL backend and just using local state management.
Versions
Check the versions in the repo 🙏
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels