mageworx / module-seobase-graph-ql
不适用
1.1.1
2021-09-22 16:09 UTC
Requires
- magento/framework: >=102.0.0 < 104
- magento/module-catalog-graph-ql: >= 100.3.1 < 101
- magento/module-cms-graph-ql: >= 100.3.1 < 101
- mageworx/module-seobase: >= 2.11.2
This package is auto-updated.
Last update: 2024-09-22 22:51:52 UTC
README
为 Mageworx Magento 2 SEO Suite Ultimate 扩展提供的 GraphQL API 模块。
安装
1) 复制粘贴方法
- 下载此模块并将其上传到
app/code/MageWorx/SeoBaseGraphQl
目录(如果不存在,请先创建“SeoBaseGraphQl”)
2) 使用 composer(从 packagist)安装
- 执行以下命令:
composer require mageworx/module-seobase-graph-ql
如何使用
SeoBaseGraphQL 模块扩展了产品、类别、CMS 页面查询的现有输出属性并包含
- mw_canonical_url
-
- url
-
- code
- meta_robots
- mw_hreflangs
-
- items
-
-
- url
-
-
-
- code
-
注意! 在规范 URL 的上下文中,代码表示 商店代码。在 hreflang URL 的上下文中,代码表示 hreflang 代码 - 例如 x-default、en、en_US 等。
其他属性根据指南定义: https://devdocs.magento.com/guides/v2.4/graphql/queries/products.html#productfilterinput-attributes。
产品、类别、CMS 页面查询的语法类似于 Magento 用户指南。
例如,产品查询的语法如下
products(
search: String
filter: ProductAttributeFilterInput
pageSize: Int
currentPage: Int
sort: ProductAttributeSortInput
): Products
请求
{
products(filter: {sku: {eq: "24-WG02"}}) {
total_count
items {
mw_canonical_url {
url
code
}
meta_robots
mw_hreflangs {
items {
url
code
}
}
name
sku
}
}
}
响应
{
"data": {
"products": {
"items": [
{
"mw_canonical_url": {
"url": "didi-sport-watch.html",
"code": "store_code"
}
"meta_robots": null,
"mw_hreflangs": {
"items": [
{
"url": "didi-sport-watch.html",
"code": "en"
},
{
"url": "didi-sport-uhr.html",
"code": "de"
}
]
},
"name": "Didi Sport Watch",
"sku": "24-WG02"
}
]
}
}
}