dannegwork/attribute-of-type-select-graphql-magento2
Composer 安装命令:
composer require dannegwork/attribute-of-type-select-graphql-magento2
包简介
GraphQL plugin that accesses custom attributes. To be used on Magento2.4.* setup
关键字:
README 文档
README
This is a Magento2 plugin with the purpose of customizing the output for the select/dropdown Magento2 catalog attributes.
Functionality
In a clean Magento2 project, the GraphQL endpoint will display the numeric value of the option id for the the single-value / select / dropdown attribute (instead of the textual option). This repository will allow you to:
- Access attribute values based on the entity ID & store view
- Access any select/dropdown/filterable attribute in a simple JSON format The output of the GraphQL query will be in the format:
<attribute-code>:{ "code":"<attribute-option-key-for-admin-view>", "value":"<attribute-option-value>" }
Exceptions
The dropdown attributes which have a back-end model predefined (are of type "varchar") are not affected.
Requirements
This integration has been developed on Magento 2.4.3
Setup
If you wish to use this simple flow for customizing any Magento2 select attribute, please install the repository as is:
composer require dannegwork/attribute-of-type-select-graphql-magento2
bin/magento module:enable DannegWork_CatalogGraphql
bin/magento setup:upgrade
Sample GraphQL Request
The provided QL works on a Magento 2.4.3 setup, deployed with sample data:
{ products (search: "fusion", pageSize: 5) { items { uid name sku color { code value } format { code value } } } }
Color & format are select fields.
Contact me!
If you have any question, just contact me at contact@danneg.work
统计信息
- 总下载量: 26
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2021-09-13