GraphQL对象类型是多个联合类型的成员?

时间:2020-08-25 20:09:43

标签: graphql

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

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

1 个答案:

答案 0 :(得分:0)

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