Headless Server Developer Manual / Version 2101
Table Of ContentsSimilar to products, categories can be retrieved as a part of a catalog query, or by navigating from a CMExternalChannel content query to the corresponding category.
And, as with products, categories may be queried by their external ID. The following query fetches a root category together with the child categories up to the second level:
{
commerce {
category(categoryId: "ibm:///catalog/category/techId:ROOT",
siteId: "99c8ef576f385bc322564d5694df6fc2") {
name
externalId
...CategoryFragment
children {
...CategoryFragment
children {
...CategoryFragment
}
}
}
}
}
fragment CategoryFragment on Category {
name
externalId
products {
name
externalId
listPrice
}
}

