Skip to content

categories

Queryin Catalog

Get a paginated list of product categories with optional search and sorting

Arguments

ArgumentTypeDescription
pageInt!Default 1
pageSizeInt!Default 20
searchTermString
sortCategorySortOrderType

Returns

ProductCategoriesResult!

FieldTypeDescription
items[ProductCategoryPage!]!List of category pages in the result
paginationPagination!Where this page sits within the full result set

Example

query {
categories(
page: 1
pageSize: 50
searchTerm: "electronics"
sort: NAME_ASCENDING
) {
pagination {
totalCount
hasNextPage
}
items {
path
category {
id
key
name
description
ancestors {
id
name
}
}
}
}
}

The query is the example the schema documents. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved
@evolve-framework/sfccResolved