customerCategoryChildren
Requires a customer (portal or buyer app) session.
Lists the direct child categories of one category, one page at a time, with the number of products under each. Without a parent it lists the top-level categories.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query CustomerCategoryChildren {
customerCategoryChildren {
hasNextPage
nextCursor
totalCount
items {
id
code
name
description
imageUrl
level
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query CustomerCategoryChildren {\n customerCategoryChildren {\n hasNextPage\n nextCursor\n totalCount\n items {\n id\n code\n name\n description\n imageUrl\n level\n }\n }\n}"
}
EOF
Response:
{
"data": {
"customerCategoryChildren": {
"hasNextPage": true,
"nextCursor": "string",
"totalCount": 0,
"items": [
{
"id": "id",
"code": "string",
"name": "string",
"description": "string",
"imageUrl": "string",
"level": 0
}
]
}
}
}
customerCategoryChildren(
cursor: String
limit: Int = 50
parentId: ID
search: String
slug: String
): CustomerCategoryConnection!
Arguments
customerCategoryChildren.cursor ● String scalar
The cursor from the previous page; leave empty for the first page.
customerCategoryChildren.limit ● Int scalar
Children per page, from 1 to 100. Defaults to 50.
customerCategoryChildren.parentId ● ID scalar
The category whose children to list. Leave empty, with no slug, for the top level.
customerCategoryChildren.search ● String scalar
Only children whose name matches this text.
customerCategoryChildren.slug ● String scalar
The parent category's code, used when no parent ID is given.
Type
CustomerCategoryConnection object
A page of categories.