MageSmith
QueryCatalog · Magento 2.4.9

categories

categories is a Magento 2 GraphQL query in the Catalog module. Return a list of categories that match the specified filter. It returns CategoryResult and is callable anonymously.

Last verified: against Magento 2.4.9.

Returns

CategoryResult

Resolver class

Magento\CatalogGraphQl\Model\Resolver\CategoriesQuery

Cache

identity: Magento\CatalogGraphQl\Model\Resolver\Category\CategoriesIdentity

Arguments

Identifies which Category filter inputs to search for and return.

pageSize Int default: 20

Specifies the maximum number of results to return at once. The default value is 20.

currentPage Int default: 1

Specifies which page of results to return. The default value is 1.

Example request

Auto-generated from the SDL — paste-ready against your store's /graphql endpoint. Replace the host, store code, and any required values before running.

Headers

Content-Type
application/json
Store
default store view code; use 'default' for the single-store baseline

Query

query {
  categories {
    items {
      children { ... }
    }
    page_info {
      page_size
      current_page
      total_pages
    }
    total_count
  }
}

Variables

{}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.