apollographql / apollo-rs

Spec compliant GraphQL Tools in Rust.
Apache License 2.0
566 stars 45 forks source link

validation allows `null` for non-nullable list items #738

Closed qwerdenkerXD closed 10 months ago

qwerdenkerXD commented 10 months ago

Description

When having arguments of type List with non-nullable items, such as e.g. [String!], the validation doesn't recognize a violation if I pass a list with null-values.

Steps to reproduce

Imagine having this schema:

type Query {
  foo(arg: [String!]!): String!
  bar(arg: [String!]): String!
}

and validating the following query:

{
  a: foo(arg: [null])
  b: foo(arg: [null, null, "hello"])
  bar(arg: [null])
}

Here a code sample.

Expected result

The validation should identify the violation and append it to the diagnostic list.

Actual result

The validation doesn't notice the violation, no such error in diagnostics. (also in version 0.11.3)

Environment

qwerdenkerXD commented 10 months ago

Just checked it for input objects, same issue if an input object field expects such list type.