【问题标题】:Orchard core GraphiQL does not display my added fieldOrchard 核心 GraphiQL 不显示我添加的字段
【发布时间】:2022-07-25 18:58:56
【问题描述】:

我使用 .NET 6 在 Orchard Core Cms 上开始了我的项目。当我尝试在 Orchard Core 上的 GraphiQL 工具上执行 graphql 查询时,它不显示我添加到 ProductCategory 内容项字段中的字段“描述” 查询如下:

query MyQuery {
  productCategory {
    id
    description
    bag {
      contentItems {
        ... on ProductCategory {
          description
          bag {
            contentItems {
              ... on ProductCategory {
                id
                description
                displayText
              }
            }
          }
        }
      }
    }
  }
}

响应如下:

{
  "data": {
    "productCategory": [
      {
        "id": 1,
        "description": "Product Category 1 Description",
        "bag": {
          "contentItems": [
            {
              "bag": {
                "contentItems": [
                  {
                    "id": 15,
                    // description field is absent
                    "displayText": "Product Category 3"
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

ProductCategory 内容类型有两个字段:Id 和 Description 并享有 Title、Flow、Bag、Alias 部分。此外,该内容类型可以是 ProductCategory 内容类型的包。正如在代码中可见,第一项显示 description 字段,但子项忽略它

【问题讨论】:

    标签: graphql orchardcms


    【解决方案1】:

    我只需要启用Autoroute 功能,现在一切正常

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-07
      • 2018-06-15
      • 2020-05-10
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      • 1970-01-01
      • 2021-03-26
      相关资源
      最近更新 更多