Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Error Handling Behaviour #127

Merged
merged 3 commits into from
May 2, 2023
Merged

Fix Error Handling Behaviour #127

merged 3 commits into from
May 2, 2023

Conversation

maticzav
Copy link
Owner

@maticzav maticzav commented May 2, 2023

This PR fixes an issue where a response containing errors and no data would fail if the selection expected a non-null field. I wrongly assumed that if the error may be raised, it's going to only be raised with nullable fields. In reality, that assumption is wrong and the client should be able to handle a faulty response regardless of the GraphQL schema.

This PR is a breaking change that changes the error type of the client interface.

This PR is related to #99 which served as a basis for this PR. Even though I created a new PR, VladNaimark lay the ground work and should deserve the credit for the work.

You can read more about the pattern here in urql documentation which served as inspiration for the new functionality.

@vercel
Copy link

vercel bot commented May 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
swift-graphql ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 2, 2023 4:32pm

@maticzav maticzav self-assigned this May 2, 2023
@maticzav maticzav merged commit f63c57c into main May 2, 2023
4 checks passed
@maticzav maticzav deleted the fix/error-handling branch May 2, 2023 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant