-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Provide nicer validation errors? #160
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
Comments
I agree with your suspicion that the first error is "cascading"! Agreed, it would be nice to include a human-readable path to the validation error instead of just the line & col. Feel free to take a crack at it if you're so inclined, but I think |
Adding |
working on a rewrite now ... |
Just jumping in, did this happen in a branch somewhere, @rmosolgo ? |
Yes, #268 , but I gave up. I took some parts from there into When I got to the part about making up new errors, I realized it was going to be impossible to preserve backwards compatibility. In retrospect, I think the right thing to've done would've been to target GraphqQL-CATS error messages. |
@rmosolgo cc @dylanahsmith @lreeves
Right now if I run a mutation with invalid input (e.g. from a custom scalar definition):
I'll get back:
There are two things that would be nice here:
input
is, as far as I can tell, entirely redundant and occurs because the input formyField
is invalid. It would be good if this was not returned since we already have a more precise error formyField
.myField
also returnedfields: [String!]
in the form["doTheThing", "input", "myField"]
for callers to be able to easily (and programatically) determine which field was malformed.I'm willing to work on this but a quick dive into
argument_literals_are_compatible.rb
didn't make either change look easy so I thought I'd ask for opinions and maybe hints first.The text was updated successfully, but these errors were encountered: