【发布时间】:2019-08-06 10:16:50
【问题描述】:
以下模式在可选的对象中包含非空字段(允许整个对象为空)。 它定义了一个具有可选字段 Child 的 Parent 对象列表 - 一些父母被允许拥有 null Child。
type People {
people : [Parent]
}
type Parent {
child : Child
}
type Child {
key : String!
}
以下 GraphQL 查询返回预期的 Parent 对象列表(一些具有 null Child 值)。 但它也会返回附加到结果的错误。 这是 GraphQL 中的错误吗(孩子是可选的)?还是预期的行为?
Cannot return null for non-nullable type: 'String' within parent 'Child'
【问题讨论】:
标签: graphql