graphql - CraftQL - 无法在矩阵字段中找到标签字段
问题描述
我有一个矩阵字段,里面有一个“标签”字段:
我正在使用 CraftQL 来获取此条目中的所有字段,并且通常它工作得非常好,除了那个标签字段。
当我在管理面板的 CraftQL 控制台中运行以下查询时,theBasicsIndustries按预期返回标签数组。
query StoryQuery($slug: String!) {
entry(siteId: 2, slug: $slug) {
... on StoriesStory {
id
contentBlock {
... on ContentBlockTheBasics {
__typename
id
theBasicsName
theBasicsIndustries {
id
title
}
}
}
}
}
}
产生:
{
"data": {
"entry": {
"id": 26,
"contentBlock": [
{
"__typename": "ContentBlockTheBasics",
"id": "112",
"theBasicsName": "Some name",
"theBasicsIndustries": [
{
"id": 108,
"title": "Hospitality"
},
{
"id": 109,
"title": "Technology"
}
]
}
]
}
}
}
但是,当我通过 API 运行相同的确切查询时,它会返回
无法查询类型“ContentBlockTheBasics”的字段“theBasicsIndustries”。
- 是否有特殊的查询标签?我尝试通过 Postman 运行相同的查询,但出现了相同的错误。
- 为什么它在管理控制台中起作用,而不是在 API 中?
谢谢!
解决方案
推荐阅读
- ios - 从远程 api 配置 NSLocalizedString
- node.js - NPM 在错误的地方寻找 React 模块
- c# - 天蓝色移动服务无法在 xamarin.android 上运行
- python - 如何显示我的多项式回归线?
- java - 在while循环中分配一个定义的变量
- javascript - 如何使用 useState 钩子和异步调用来更改数组?
- c# - 我的 WPF DataGrid 正在设置样式,但我不知道它在哪里做
- angular - 在不使用 ngModel 的情况下与反应形式进行两种方式绑定
- javascript - 开玩笑 - 测试 eventChannel Redux-saga
- javascript - 如何将 snap.svg 与外部文件一起使用?