You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Orchard Core GraphiQL中ProductCategory子项description字段不显示问题

Orchard Core GraphQL子ProductCategory的description字段缺失问题解决

以下是针对该问题的排查和解决步骤:

  • 检查字段GraphQL可见性配置
    进入Orchard Core后台,找到ProductCategory内容类型的Description字段编辑页,切换到"GraphQL"选项卡,确认已勾选"Expose in GraphQL"。父项能返回字段说明父级配置正常,但嵌套的子项可能需要确保该配置对Bag内的内容项同样生效。

  • 确认子项字段值是否存在
    直接在后台打开ID为15的ProductCategory内容项,检查Description字段是否已填写内容。字段缺失有可能只是子项本身未设置该值,并非查询或配置问题。

  • 补全查询片段的字段请求
    观察你的查询语句,中间层的ProductCategory片段未请求id和displayText,虽然这不是字段缺失的直接原因,但补全后能确保查询结构一致,也便于排查:

    query MyQuery {
      productCategory {
        id
        description
        bag {
          contentItems {
            ... on ProductCategory {
              id
              description
              displayText
              bag {
                contentItems {
                  ... on ProductCategory {
                    id
                    description
                    displayText
                  }
                }
              }
            }
          }
        }
      }
    }
    
  • 验证Bag部件的内容类型配置
    检查ProductCategory的Bag部件设置,确认"Content Types"列表中已选中ProductCategory,且没有添加限制字段的投影规则,确保嵌套的内容项能完整暴露自身字段。

  • 清理GraphQL schema缓存
    修改字段或内容类型配置后,Orchard Core的GraphQL schema可能仍使用缓存版本。进入后台Configuration > Cache页面,点击"Clear All"清理缓存,再重新执行查询。

内容的提问来源于stack exchange,提问作者amin mohammadi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 21:48:28