【问题标题】:GraphQL object types members of multiple union types?GraphQL 对象类型的多个联合类型的成员?
【发布时间】:2023-03-03 04:23:01
【问题描述】:

在 GraphQL 中,一个对象类型可以属于多个联合类型吗?

type Foo {
    id: String!
}
type Bar {
    number: Int!
}
union UnionA = Foo | Bar
union UnionB = Foo

【问题讨论】:

    标签: graphql


    【解决方案1】:

    是的,一个对象类型可以属于任意数量的联合类型。 the spec 中没有任何内容明确禁止这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-03
      • 2018-10-01
      • 2019-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-05
      • 2018-09-28
      • 2019-07-01
      相关资源
      最近更新 更多