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

Include possible field, argument, type names when validation fails #355

Merged
merged 8 commits into from
Apr 26, 2016

Conversation

yuzhi
Copy link
Contributor

@yuzhi yuzhi commented Apr 12, 2016

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.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 10997c5 on namesuggestions into * on master*.

@@ -0,0 +1,78 @@
/* @flow */
Copy link
Contributor

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.

@leebyron
Copy link
Contributor

This is looking awesome!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 8982f88 on namesuggestions into * on master*.

expect(suggestionList('input', [])).to.deep.equal([]);
});

it('Returns options sorted based on simularity', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

s/simularity/similarity/

@KyleAMathews
Copy link

@yuzhi This will be helpful!

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5a9fb1e on namesuggestions into * on master*.

@yuzhi
Copy link
Contributor Author

yuzhi commented Apr 22, 2016

@leebyron thoughts on the update?

@leebyron
Copy link
Contributor

Most excellent

sogko added a commit to sogko/graphql-js that referenced this pull request Jun 1, 2016
- 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.
leebyron pushed a commit that referenced this pull request Jul 6, 2016
)

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants