Skip to content

Listing categories through GraphQL doesn’t work

When I try to retrieve a list of categories with the below GraphQL query, I only get one result instead of the expected 8.

All the configuration options for the categories are default.

Listing Categories

query Categories {
  categories(pageSize: 50) {
    items {
      name
      uid
    }
    total_count
  }
}

Result

{
  "data": {
    "categories": {
      "items": [
        {
          "name": "Osobní Automobil",
          "uid": "NQ=="
        }
      ],
      "total_count": 1
    }
  }
}

Expected Result

A list of all the defined categories.

My category tree

category tree