Skip to content

Include expected type in validation error message #221

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

Conversation

swalkinshaw
Copy link
Collaborator

The inspiration behind this was the more helpful error messages that GraphiQL has.

image

Two questions/possible changes:

  1. I could unwrap arg_defn but I'm on the fence as to what's more helpful.
  2. I initially wanted to output node.value as well but it could be nested with arguments. I couldn't find an existing way to get to the underlying value so leaving it out for now.

This is still an improvement regardless.

@rmosolgo
Copy link
Owner

💰 Thanks, this is awesome! I think you're right to leave arg_defn as-is. I'll make a to-do item about putting the actual received value in the error message. Thanks for this improvement!

@rmosolgo rmosolgo merged commit 156276e into rmosolgo:master Aug 27, 2016
@swalkinshaw swalkinshaw deleted the improve-argument-validation-error-messages branch August 27, 2016 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants