-
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
Include possible field, argument, type names when validation fails #355
Conversation
Changes Unknown when pulling 10997c5 on namesuggestions into * on master*. |
@@ -0,0 +1,78 @@ | |||
/* @flow */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file should go in the jsutils folder - that is where we keep the dependency-free JS utilities that are not specific to graphql, just happen to be used here.
This is looking awesome! |
…options, remove redundant warning
Changes Unknown when pulling 8982f88 on namesuggestions into * on master*. |
expect(suggestionList('input', [])).to.deep.equal([]); | ||
}); | ||
|
||
it('Returns options sorted based on simularity', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/simularity/similarity/
@yuzhi This will be helpful! |
Changes Unknown when pulling 5a9fb1e on namesuggestions into * on master*. |
@leebyron thoughts on the update? |
Most excellent |
- Test should had broke for changes in graphql#355 which improved validation messages with suggestions. - But `expect().to.deep.equal()` checks for the right number of errors but does not check for equality of error messages.
) - Test should had broke for changes in #355 which improved validation messages with suggestions. - But `expect().to.deep.equal()` checks for the right number of errors but does not check for equality of error messages.
Currently, if one misspelled something or flipped the order of words, GraphQL validation does not give any suggestions. Engineers would have to go through the schema to find the valid field/type/argument or check in GraphiQL. This should give useful suggestions for most of these cases so engineers can perform the proper fix much faster.