-
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
Improve validation error message when field names conflict #363
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! |
Changes Unknown when pulling aa72089 on robzhu:master into * on graphql:master*. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
If the reason is an array, |
Agree with @yuzhi - can you take a look at some of the output messages? I patched this in to test. For example https://github.com/graphql/graphql-js/blob/master/src/validation/__tests__/OverlappingFieldsCanBeMerged-test.js#L308 now produces:
|
Changes Unknown when pulling 7d2f191 on robzhu:master into * on graphql:master*. |
Ace |
Thanks for the quick review and merge! |
graphql/graphql-js#363 * Improve validation error message when field names conflict * Remove extra hint and add unit test
graphql/graphql-js#363 * Improve validation error message when field names conflict * Remove extra hint and add unit test
graphql/graphql-js#363 * Improve validation error message when field names conflict * Remove extra hint and add unit test
graphql/graphql-js#363 * Improve validation error message when field names conflict * Remove extra hint and add unit test
When I submit a query with overlapping field names like so:
node {
echo(val: "test"),
echo(val: "foo")
}
I get the following validation error:
"Fields "echo" conflict because they have differing arguments."
This PR modifies the error message to suggest using aliases when this occurs:
"Fields "echo" conflict because they have differing arguments. Use aliases on the fields to fetch both if this was intentional."