mageworx/module-seoxtemplates-graph-ql
最新稳定版本:2.0.0
Composer 安装命令:
composer require mageworx/module-seoxtemplates-graph-ql
包简介
N/A
README 文档
README
GraphQL API module for Mageworx Magento 2 SEO Suite Ultimate extension.
Installation
1) Copy-to-paste method
- Download this module and upload it to the
app/code/MageWorx/SeoXTemplatesGraphQldirectory (create "SeoXTemplatesGraphQl" first if missing)
2) Installation using composer (from packagist)
- Execute the following command:
composer require mageworx/module-seoxtemplates-graph-ql
How to use
Categories query example
All Category SEO-attributes (meta title, meta description, ...) set in "Bags[ - Filters: {filter_all}]"query GetCategories($id: String!, $pageSize: Int!, $currentPage: Int!, $filters: ProductAttributeFilterInput!, $sort: ProductAttributeSortInput) { categories(filters: {ids: {in: [$id]}}) { items { uid ...CategoryFragment } } products(pageSize: $pageSize, currentPage: $currentPage, filter: $filters, sort: $sort) { ...ProductsFragment mw_seo_category_data { meta_title meta_description meta_keywords category_seo_name } } } fragment CategoryFragment on CategoryTree { uid meta_title meta_keywords meta_description category_seo_name } fragment ProductsFragment on Products { items { id uid name sku url_key } page_info { total_pages } total_count }
Query Variables:
{
"currentPage": 1,
"id": "4",
"filters": {
"color": {
"eq": "49"
},
"category_id": {
"eq": "4"
}
},
"pageSize": 1,
"sort": {
"position": "ASC"
}
}
Answer:
{
"data": {
"categories": {
"items": [
{
"uid": "NA==",
"meta_title": "Bags",
"meta_keywords": "Bags",
"meta_description": "Bags",
"category_seo_name": "Bags"
}
]
},
"products": {
"items": [
{
"id": 7,
"uid": "Nw==",
"name": "Impulse Duffle",
"sku": "24-UB02",
"url_key": "impulse-duffle"
}
],
"page_info": {
"total_pages": 4
},
"total_count": 4,
"mw_seo_category_data": {
"meta_title": "Bags - Filters: Color: Black",
"meta_description": "Bags - Filters: Color: Black",
"meta_keywords": "Bags - Filters: Color: Black",
"category_seo_name": "Bags - Filters: Color: Black"
}
}
}
}
Products query example
All Product SEO-attributes (meta title, meta description, ...) set in "Wayfarer Messenger Bag[ in {categories}]"
query getProductDetailForProductPage($urlKey: String!) { products(filter: {url_key: {eq: $urlKey}}) { items { id uid ...ProductDetailsFragment } } } fragment ProductDetailsFragment on ProductInterface { categories { uid breadcrumbs { category_uid } } id uid meta_title meta_description meta_keyword product_seo_name name sku url_key ... on ConfigurableProduct { configurable_options { attribute_code attribute_id uid label values { uid default_label label store_label use_default_value } } variants { attributes { code value_index } product { uid media_gallery_entries { uid disabled file label position } sku stock_status } } } }
Query Variables:
{
"currentPage": 1,
"id": "4",
"filters": {
"color": {
"eq": "49"
},
"category_id": {
"eq": "4"
}
},
"pageSize": 1,
"sort": {
"position": "ASC"
}
}
Answer:
{
"data": {
"products": {
"items": [
{
"id": 4,
"uid": "NA==",
"categories": [
{
"uid": "Mw==",
"breadcrumbs": null
},
{
"uid": "NA==",
"breadcrumbs": [
{
"category_uid": "Mw=="
}
]
},
{
"uid": "Nw==",
"breadcrumbs": null
},
{
"uid": "OA==",
"breadcrumbs": null
}
],
"meta_title": "Wayfarer Messenger Bag",
"meta_description": "Wayfarer Messenger Bag",
"meta_keyword": "Wayfarer Messenger Bag",
"product_seo_name": "Wayfarer Messenger Bag",
"name": "Wayfarer Messenger Bag",
"sku": "24-MB05",
"url_key": "wayfarer-messenger-bag"
}
]
}
}
}
统计信息
- 总下载量: 49.96k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2020-10-19