-
Notifications
You must be signed in to change notification settings - Fork 494
Closed
Labels
Description
There seems to be a bug in schema validation of query variables.
For this schema:
input SearchFilter {
required: String!
optional: String
}
type SearchResults {
match: String
}
type Query {
search(filter: SearchFilter!): [SearchResults!]!
}
the following query correctly fails schema validation:
query {
search(filter: {}) {
match
}
}
with the error message:
{
"errors": [
{
"message": "Argument \"filter\" has invalid value {}.\nIn field \"required\": Expected \"String!\", found null.",
"locations": [
{
"line": 2,
"column": 17
}
]
}
]
}
but the same query using variables doesn't fail at all:
query s($filter:SearchFilter!) {
search(filter: $filter){
match
}
}
variables:
{
"filter": {}
}
pavelnikolov and eseliger