-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
Hey, I've encountered a bug when running mutations and providing an invalid input.
Given the following schema
type Query {
hello: String
}
input AddFavoriteFoodInput {
id: ID!
comment: String!
foodNames: [String!]!
}
type Mutation {
addFavoriteFood(input: AddFavoriteFoodInput!): Boolean!
}
if you run the mutation
mutation AddFavoriteFood($input: AddFavoriteFoodInput!) {
addFavoriteFood(input: $input)
}
with variables
{
"input": {
"id": "123",
"comment": "Hello",
"foodNames": [
"Pizza",
"Apple",
null,
"Pineapple"
]
}
}
the expected error message is:
"Variable \"$input\" got invalid value null at \"input.foodNames[2]\";
Expected non-nullable type \"String!\" not to be null."
However with GraphQL Complexity enabled, this turns into
"Argument \"input\" of required type \"AddFavoriteFoodInput!\" was provided the
variable \"$input\" which was not provided a runtime value."
Here's a repo reproducing the issue: https://github.com/adamors/graphql-complexity-bug
P4sca1 and eduardoyuidy
Metadata
Metadata
Assignees
Labels
No labels