Skip to content

categoryList Graphql request returns only 2 children_conut of children category

Magento version 2.4.5, venia sample data ( might be any sample data, or just create caregories manually )

Graphql Request:

{
  categoryList {
    uid
    name
    children {
      uid
      include_in_menu
      name
      position
      url_path
      children_count
      children {
        uid
        include_in_menu
        name
        position
        url_path
      }
    }
  }
}

Graphql Response:

"data": {
    "categoryList": [
      {
        "uid": "Mg==",
        "name": "Default Category",
        "children": [
          {
            "uid": "MjI=",
            "include_in_menu": 1,
            "name": "Tops",
            "position": 1,
            "url_path": "venia-tops",
            "children_count": "2",
            "children": [
              {
                "uid": "MjM=",
                "include_in_menu": 1,
                "name": "Blouses & Shirts",
                "position": 1,
                "url_path": "venia-tops/venia-blouses"
              },
              {
                "uid": "MjQ=",
                "include_in_menu": 1,
                "name": "Sweaters",
                "position": 2,
                "url_path": "venia-tops/venia-sweaters"
              }
            ]
          }

children_count of venia-tops category should be more than 2, why it returns 2 of any category, except parent?