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 crash when GraphQLError is “too many validation errors” #438

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

AnthonyMDev
Copy link
Contributor

When a GraphQLError from the JS parsing step is a “Too many validation errors” error, there is no source in the error object. This was causing a crash. We should make this an optional parameter and check for it to avoid this edge case.

Writing a unit test for this is difficult because we would need to write a large schema document with many errors in it. This is a minor edge case, and I think that an inline comment explaining the problem should suffice to prevent regressions here.

When a GraphQLError from the JS parsing step is a “Too many validation errors” error, there is no `source` in the error object. This was causing a crash. We should make this an optional parameter and check for it to avoid this edge case.

Writing a unit test for this is difficult because we would need to write a large schema document with many errors in it. This is a minor edge case, and I think that an inline comment explaining the problem should suffice to prevent regressions here.
Copy link

netlify bot commented Jul 23, 2024

Deploy Preview for apollo-ios-docc canceled.

Name Link
🔨 Latest commit c9b0322
🔍 Latest deploy log https://app.netlify.com/sites/apollo-ios-docc/deploys/66a0133f405d2e0008222265

Copy link

netlify bot commented Jul 23, 2024

Deploy Preview for eclectic-pie-88a2ba canceled.

Name Link
🔨 Latest commit c9b0322
🔍 Latest deploy log https://app.netlify.com/sites/eclectic-pie-88a2ba/deploys/66a0133f6d710e000871c1ee

@AnthonyMDev AnthonyMDev enabled auto-merge (squash) July 23, 2024 20:36
Copy link
Member

@calvincestari calvincestari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AnthonyMDev AnthonyMDev merged commit 0c77120 into main Jul 23, 2024
34 checks passed
@AnthonyMDev AnthonyMDev deleted the GraphQLError_tooManyErrors_fix branch July 23, 2024 20:38
BobaFetters pushed a commit to apollographql/apollo-ios-codegen that referenced this pull request Jul 23, 2024
BobaFetters pushed a commit that referenced this pull request Jul 23, 2024
9c69435c Fix crash when GraphQLError is “too many validation errors” (#438)

git-subtree-dir: apollo-ios-codegen
git-subtree-split: 9c69435cd84ed7e40f221f9308e53e74c6df66ba
BobaFetters pushed a commit that referenced this pull request Jul 23, 2024
…“too many validation errors”

git-subtree-dir: apollo-ios-codegen
git-subtree-mainline: 7673beb
git-subtree-split: 9c69435cd84ed7e40f221f9308e53e74c6df66ba
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.

2 participants