我的 CMS 向我返回了一个节点列表,每个节点都有自己的节点类型。对于每个节点类型,我定义了一个相应的 GraphQL 类型。
type getContent {
content: [ContentNode]
}
我想要一个像这样的查询:
{
content{
contentType
properties {
${ContentType.getFragment('content', type: $contentType???)}
}
}
}
ContentType 将根据提供给它的类型变量返回正确的片段定义。但是我如何$contentType
从父级结果中获得?