Magento 2 GraphQL ProductInterface 表示“String”,但模式表示“ComplexTextValue”

问题描述 投票:0回答:1

我对 Magento 2 (2.4.4-p2) 和 GraphQL 有疑问。

我正在尝试使用以下属性过滤产品:

short_description {
    html
}
description {
    html
}

并得到以下错误:

{
  "errors": [
    {
      "message": "Field \"description\" of type \"String\" must not have a sub selection.",
      "extensions": {
        "category": "graphql"
      },
      "locations": [
        {
          "line": 5,
          "column": 18
        }
      ]
    }
  ]
}

如果我使用 ChromeiQL 并检查架构定义,则显示: 描述字符串

但根据

magento/vendor/magento/module-catalog-graph-ql/etc/schema.graphqls
,它被设置为“ComplexTextValue”。 (见下文,我只是剪短了一点)

interface ProductInterface @typeResolver(class: "Magento\\CatalogGraphQl\\Model\\ProductInterfaceTypeResolverComposite") @doc(description: "Contains fields that are common to all types of products.") {
    description: ComplexTextValue @doc(description: "Detailed information about the product. The value can include simple HTML tags.") @resolver(class: "\\Magento\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductComplexTextAttribute")
}

我找不到任何其他模块可以修改

ProductInterface

我尝试定义自己的

schema.graphqls
模式,但这不起作用。

graphql magento2
1个回答
0
投票

您找到上述问题的解决方案了吗,因为我也面临同样的问题@Dzemal Becirevic

© www.soinside.com 2019 - 2024. All rights reserved.