Skip to content

[validator] Add suggested types to incorrect field message #282

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

Merged
merged 1 commit into from
Feb 2, 2016

Conversation

dschafer
Copy link
Contributor

@dschafer dschafer commented Feb 1, 2016

Update the error message for undefinedField to take in a list of suggested type names.

@dschafer
Copy link
Contributor Author

dschafer commented Feb 1, 2016

Oops I opened this off a super old master. Will rebase and update.

@dschafer
Copy link
Contributor Author

dschafer commented Feb 1, 2016

Okay, rebased.

@dschafer dschafer force-pushed the errormessage branch 2 times, most recently from 1eab039 to efa9942 Compare February 2, 2016 00:37
{ message: 'Cannot query field "isHousetrained" on "Dog".' }
{ message: 'Cannot query field "catOrDog" on type "QueryRoot".' },
{ message: 'Cannot query field "furColor" on type "Cat".' },
{ message: 'Cannot query field "isHousetrained" on type "Dog".' }
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe these 3 should actually be calls to undefinedField to match the other tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably; if we do so, I definitely need to add a dedicated test for undefinedField (I'll do that anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I'll keep this as a true "integration" test.

@leebyron
Copy link
Contributor

leebyron commented Feb 2, 2016

This is awesome! Some minor feedback inline, but otherwise this is a huge upgrade on the error quality for this particular validator.

@dschafer
Copy link
Contributor Author

dschafer commented Feb 2, 2016

Updated with @leebyron feedback.

dschafer added a commit that referenced this pull request Feb 2, 2016
[validator] Add suggested types to incorrect field message
@dschafer dschafer merged commit 7011034 into master Feb 2, 2016
@dschafer dschafer deleted the errormessage branch February 2, 2016 22:21
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.

3 participants