将Magento与AEM集成为安装了CIF附加组件的云服务SDK后,Venia代码出现错误

2022-04-04 00:00:00 sdk magento javascript aem

我们使用AEM作为云服务SDK,并使用CIF附加组件与Magento连接。部署Venia代码后,我们无法在控制台中看到类别和产品图像并看到此错误:

Could not fetch storefront instance context Error: Cannot query field "dataServicesStorefrontInstanceContext" on type" Query"。 当云服务中的配置正确完成后,我们可以在商务页面(http://localhost:4502/aem/products.html/var/commerce/products)上看到产品。

在错误.log文件中出现以下错误:

GET /content/venia/us/en.html HTTP/1.1] com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl GraphQL request {categoryList(filters:{category_uid:{eq:"52"}}){uid,name,url_path,position,children{uid,name,url_path,position,children{uid,name,url_path,position}}}} returned some errors [{"message":"Field "category_uid" is not defined by type CategoryFilterInput.","locations":[{"line":1,"column":24}]},{"message":"Cannot query field "uid" on type "CategoryTree".","locations":[{"line":1,"column":49}]},{"message":"Cannot query field "uid" on type "CategoryTree".","locations":[{"line":1,"column":85}]},{"message":"Cannot query field "uid" on type "CategoryTree".","locations":[{"line":1,"column":121}]}]

如果有任何推荐人,请指教。提前谢谢。


解决方案

如果您没有按照文档中的here在商务端安装magento/module-data-services-graphql模块(步骤3),则会出现此错误。安装该程序并重新签入AEM后,该错误应该会消失。该功能是Adobe Commerce中的产品推荐功能所必需的。

相关文章