magesource / product-attribute-graphql
Magesource Product Attribute in Graph Ql for Magento 2.
dev-main
2024-05-30 06:31 UTC
This package is auto-updated.
Last update: 2024-09-30 07:21:29 UTC
README
Magesource Product Attribute in Graph Ql for Magento 2.
安装
-
通过运行
composer require magesource/product-attribute-graphql:dev-main
安装模块 composer -
通过运行
php bin/magento module:enable Magesource_ProductAttributeGraphQl
启用模块 -
通过运行以下命令执行 Magento 命令
php bin/magento set:up;php bin/magento s:d:c;php bin/magento s:s:d -f;php bin/magento c:f
功能
创建自定义产品属性并在 GraphQL 产品 API 中获取值。
测试
在 Magento 2 基础 URL 后使用 GraphQL {Magento 2 Base Url}/graphql
查询
{ products( filter: { sku: { eq: "{Product Sku}" } } ){ items { id sku name is_type } } }