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

improve(validation): add location to error messages #4145

Open
wants to merge 1 commit into
base: 16.x.x
Choose a base branch
from

Conversation

KonstantinSimeonov
Copy link

Having no locations on errors can be frustrating when debugging errors on large schemas. Append a location to each error message in schema validation.

Before:

Error: Unknown directive "@id".

Unknown directive "@createdAt".

Unknown directive "@label".

Unknown directive "@updatedAt".

Unknown directive "@searchField".

Unknown directive "@label".

After:

Error: Unknown directive "@id". (254:11)

Unknown directive "@createdAt". (255:24)

Unknown directive "@label". (255:35)

Unknown directive "@updatedAt". (256:24)

Unknown directive "@searchField". (258:17)

Unknown directive "@label". (258:30)

Copy link

linux-foundation-easycla bot commented Jul 15, 2024

CLA Signed

  • ✅login: KonstantinSimeonov / (91e0b64)

The committers listed above are authorized under a signed CLA.

Copy link

Hi @KonstantinSimeonov, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

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

I like this change, we however need to test these changes and as the messages change a lot I would target this to graphql:main instead.

@KonstantinSimeonov
Copy link
Author

@JoviDeCroock I'll look into it

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