Skip to main content

categoryChildren

Requires permission categories:category:list.

Returns one page of the direct subcategories of a category, or of the top-level categories when no parent is given. Pages are ordered by sort order, then name, and carry a total count for the same filters. Requires permission to list 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:

query CategoryChildren {
categoryChildren {
hasNextPage
nextCursor
totalCount
items {
id
code
name
createdAt
childrenCount
deletedAt
}
}
}

Response:

{
"data": {
"categoryChildren": {
"hasNextPage": true,
"nextCursor": "string",
"totalCount": 0,
"items": [
{
"id": "id",
"code": "string",
"name": "string",
"createdAt": "2025-01-15T00:00:00Z",
"childrenCount": 0,
"deletedAt": "2025-01-15T00:00:00Z"
}
]
}
}
}
categoryChildren(
cursor: String
isActive: Boolean
limit: Int = 50
parentId: ID
search: String
): CategoryChildrenConnection!

Arguments​

categoryChildren.cursor ● String scalar​

The cursor from the previous page's nextCursor. Omit it for the first page.

categoryChildren.isActive ● Boolean scalar​

Only return active subcategories (true) or inactive ones (false). Omit it to return every status.

categoryChildren.limit ● Int scalar​

How many subcategories to return per page, from 1 to 100. Defaults to 50.

categoryChildren.parentId ● ID scalar​

The ID of the category whose direct subcategories to list. Omit it to list top-level categories.

Only return subcategories whose name contains this text, ignoring case.

Type​

CategoryChildrenConnection object​

A page of child categories.