Skip to content

mageworx/MageWorx_HtmlSitemapGraphQl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MageWorx_HtmlSitemapGraphQl

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/HtmlSitemapGraphQl directory (create "HtmlSitemapGraphQl" first if missing)

2) Installation using composer (from packagist)

  • Execute the following command: composer require mageworx/module-htmlsitemap-graph-ql

How to use

HtmlSitemapGraphQl module allows displaying the HTML sitemap:

Syntax:

products(
  search: String
  filter: ProductAttributeFilterInput
  pageSize: Int
  currentPage: Int
  sort: ProductAttributeSortInput
): Products

The query includes the following attributes:

  • meta_description
  • meta_keywords
  • categories
  • cms_pages
  • additional_links
  • custom_links

Request:

{mwHtmlSitemap (storeId: 1) {
  categories {
    items {
      title
      url
      level
    }
  }
}
}

Response:

{
  "data": {
    "mwHtmlSitemap": {
      "categories": {
        "items": [
          {
            "title": "What's New",
            "url": "https://store_url/default/what-is-new.html",
            "level": 2
          },
          {
            "title": "test",
            "url": "https://store_url/default/test.html",
            "level": 2
          }
        ]
      }
    }
  }
}