-
Notifications
You must be signed in to change notification settings - Fork 2k
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
standardize error messages prior to introducing schema coordinates #4177
Conversation
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
extracted from graphql#3808 PR graphql#3808 uses schema coordinates to improve GraphQL-JS error messages. To reduce the size of the PR, this commit standardizes error messages according to the general pattern that will be introduced with schema coordinates without introducing the coordinates themselves, in the hopes of aiding review of the later PR. Parenthetically, extracting these changes out of graphql#3808 demonstrates how the use of schema coordinates improves our error messages. For example, it is difficult when printing an error message regarding an argument to easily look up the field of that argument, and, if it a nested input field, the full field path. It is similarly sometimes difficult to know the type of the field or argument triggering the error. Embedding schema coordinates within GraphQL-JS makes this trivial. This PR simply omits the changes from graphql#3808 that are directly enabled by the use of schema coordinates. graphql#3808 can then be rebased on top of this PR to demonstrate the code changes and the direct improvement in the various error messages.
fcecd91
to
e184259
Compare
This comment was marked as outdated.
This comment was marked as outdated.
604bd20
to
ccd814a
Compare
Actually, I was able to minimize the diff everywhere except for the errors in |
extracted from #3808
PR #3808 uses schema coordinates to improve GraphQL-JS error messages. To reduce the size of the PR, this commit standardizes error messages according to the general pattern that will be introduced with schema coordinates without introducing the coordinates themselves, in the hopes of aiding review of the later PR.
EDITED 8/26/2024:
I was able to reproduce all of the standardized error messages from #3808 except for the ones in getArgumentValues when it is passed a Field Definition, because the parent type is not passed. Everything else can be calculated for the error messages we are currently printing, although schema coordinates simplifies things.
Extracting these changes out of #3808 and rebasing #3808 on main will therefore will better demonstrate how schema coordinates improves the clarity of some of our error messages (namely, getArgumentValues) and simplifies printing them.