ecwhim/module-canonical-url-graph-ql
最新稳定版本:1.0.0
Composer 安装命令:
composer require ecwhim/module-canonical-url-graph-ql
包简介
N/A
README 文档
README
This module provides support of Magento GraphQL for Magento 2 Canonical URL Extension by Ecwhim.
Installation
You can install the module in the following ways:
Install the module using Composer via packagist.com
- Log in to your Magento server as, or switch to, the file system owner.
- Navigate to your Magento project directory.
- Get the latest version of the module:
composer require ecwhim/module-canonical-url-graph-ql
Download package from github.com
- Download the latest version of the package from github.
- Extract the package to the
<magento root directory>/app/code/Ecwhim/CanonicalUrlGraphQldirectory. - Enable the module.
How to use
CategoryInterface attribute
The following table defines the CategoryInterface attribute added by our extension.
| ATTRIBUTE | DATA TYPE | DESCRIPTION |
|---|---|---|
| ecw_canonical_url | String | The absolute canonical URL. |
Example Usage
The following query shows how to get the canonical URL for a category:
Request:
{
categoryList(filters: {ids: {eq: "14"}}){
id
name
ecw_canonical_url
}
}
Response:
{
"data": {
"categoryList": [
{
"id": 14,
"name": "Jackets",
"ecw_canonical_url": "https://example.com/men/tops-men/jackets-men.html"
}
]
}
}
CmsPage attribute
The following table defines the CmsPage attribute added by our extension.
| ATTRIBUTE | DATA TYPE | DESCRIPTION |
|---|---|---|
| ecw_canonical_url | String | The absolute canonical URL. |
Example Usage
The following query shows how to get the canonical URL for a CMS page:
Request:
{
cmsPage(identifier: "customer-service") {
identifier
title
ecw_canonical_url
}
}
Response:
{
"data": {
"cmsPage": {
"identifier": "customer-service",
"title": "Customer Service",
"ecw_canonical_url": "https://example.com/customer-service"
}
}
}
ProductInterface attribute
The following table defines the ProductInterface attribute added by our extension.
| ATTRIBUTE | DATA TYPE | DESCRIPTION |
|---|---|---|
| ecw_canonical_url | String | The absolute canonical URL. |
Example Usage
The following query shows how to get the canonical URL for a product:
Request:
{
products(filter: { sku: { eq: "24-MB01" } }) {
items {
name
sku
ecw_canonical_url
}
}
}
Response:
{
"data": {
"products": {
"items": [
{
"name": "Joust Duffle Bag",
"sku": "24-MB01",
"ecw_canonical_url": "https://example.com/joust-duffle-bag.html"
}
]
}
}
}
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2022-10-24