-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
@rmosolgo cc @dylanahsmith @lreeves
Right now if I run a mutation with invalid input (e.g. from a custom scalar definition):
mutation {
doTheThing(input: { myField: "someInvalidValue" }) {
myField
}
}
I'll get back:
{
"errors": [
{
"message": "Argument 'input' on Field 'doTheThing' has an invalid value",
"locations": [
{
"line": 2,
"column": 3
}
]
},
{
"message": "Argument 'myField' on InputObject 'DoTheThingInput' has an invalid value",
"locations": [
{
"line": 2,
"column": 21
}
]
}
]
}
There are two things that would be nice here:
- The first error complaining about
inputis, as far as I can tell, entirely redundant and occurs because the input formyFieldis invalid. It would be good if this was not returned since we already have a more precise error formyField. - If the error for
myFieldalso 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.
Metadata
Metadata
Assignees
Labels
No labels