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

Improves error messages when an empty key is generated #30

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

gwardwell
Copy link
Collaborator

Description

In cases where FROID schema schema generation results in empty @key fields (such as when only __typename is used as a key), FROID would return an unhelpful message:

Syntax Error: Expected Name, found "}".

This PR catches that error and instead throws an improved error to better explain what's going on:

Failed to parse key fields "" for type "SomeType" due to error: Syntax Error: Expected Name, found "}". 

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the
    contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@gwardwell gwardwell marked this pull request as ready for review August 20, 2024 14:04
@gwardwell gwardwell requested a review from a team as a code owner August 20, 2024 14:04
@gwardwell gwardwell merged commit 8e6e41f into main Aug 20, 2024
5 checks passed
@gwardwell gwardwell deleted the gwardwell_improve_empty_froid_key_errors branch August 20, 2024 15:31
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