我的项目有问题,我在互联网上找不到任何解决方案.情况就是这样.
以下是"Zone","Teaser"和"Program"模式的部分:
type Program {
title: String
}
type Teaser {
title: String!
}
union DataResult = Teaser | Program
type Zone {
(...)
data: [DataResult!]
}
Run Code Online (Sandbox Code Playgroud)
当我尝试查询区域数据时,如下面的查询部分所述,我从graphQL得到了一个错误.
zones {
...zoneFieldsWithoutData
data {
... on Program {
...programFields
}
... on Teaser {
...teaserFields
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是错误:
Error: GraphQL error: Fields \"title\" conflict because they return conflicting types String and String!. Use different aliases on the fields to fetch both if this was intentional …Run Code Online (Sandbox Code Playgroud)