yireo / magento2-byattribute-graph-ql
在 GraphQL 中显示任何产品属性的任何列表
0.1.1
2020-07-29 12:44 UTC
Requires
- php: >=7.0.0
- laminas/laminas-db: *
- magento/framework: ^100.0|^101.0|^102.0|^103.0
- magento/module-catalog: ^101.0|^102.0|^103.0|^104.0
- magento/module-eav: ^100.0|^101.0|^102.0
- magento/module-graph-ql: ^100.3
Requires (Dev)
- composer/composer: *@dev
- phpunit/phpunit: *
Suggests
- yireo/magento2-byattribute2: *
This package is auto-updated.
Last update: 2024-09-22 01:01:13 UTC
README
此 Magento 2 扩展添加了一个 GraphQL 端点,用于通过 GraphQL 访问产品属性。这至少需要 Magento 2.3 或更高版本。
要安装此模块,运行
composer require yireo/magento2-byattribute-graph-ql
./bin/magento module:enable Yireo_ByAttributeGraphQl
示例 GraphQL 查询
以下是一些示例 GraphQL 查询,用于展示此扩展的使用方法
{ productAttribute(code:"material") { id code label default_value options { value label product_count } } }
或者如果您想返回更少的信息(并包括类别过滤器)
{ productAttribute(code:"color", category_id: 42) { id options { value } } }
待办事项
- 缓存产品计数的关键部分
- 重构
ProductCounter
并将其拆分为更小的类