The following schema contains not null field in an object that is optional (the entire object is allowed to be null). It defines a list of Parent objects that have optional field Child - some Parents are allowed to have null Child.
type People {
people : [Parent]
}
type Parent {
child : Child
}
type Child {
key : String!
}
The following GraphQL query returns an expected list of Parent objects (some with null Child values). But it also returns an error attached to the result. Is this a bug in GraphQL (Child is optional)? Or is it expected behaviour?
Cannot return null for non-nullable type: 'String' within parent 'Child'