Skip to content

Magento 2 get categories graphql fails with “There is no attribute class assigned to field categoryList”

Request:

query {
  categories {
    items {
      name
    }
  }
}

Error Response:

{
  "errors": [
    {
      "debugMessage": "There is no attribute class assigned to field categoryList",
      "message": "Internal server error",
      "extensions": {
        "category": "internal"
      },
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "categories"
      ]
    }
  ],
  "data": {
    "categories": null
  }
}