Skip to content

Catalog Category — Detail (GraphQL)

GraphQL item query that returns a single category by its IRI, including the full translations array (every locale present in the database) and the list of filterable attribute IDs configured for the category.

This is the query to call when an admin needs complete metadata for a category — e.g. when pre-populating the edit form in Catalog → Categories.

Operation

OperationType
adminCategoryQuery (item)

Authentication

Every request must include an admin Bearer token:

Authorization: Bearer <token>

Obtain a token via the createAdminLogin mutation.

Arguments

ArgumentTypeRequiredDescription
idID!YesAPI Platform IRI of the category (e.g. "/api/admin/catalog/categories/7")

Finding the IRI

The IRI can be taken directly from id in any adminCategories or adminCategoryTrees edge node, or constructed as /api/admin/catalog/categories/{numericId}.

Node Fields

FieldTypeDescription
idIDAPI Platform IRI (e.g. /api/admin/catalog/categories/7)
_idIntRaw category ID
nameStringCategory name in the current app locale
slugStringURL slug in the current app locale
statusInt1 = enabled, 0 = disabled
positionIntDisplay order position
parentIdIntParent category ID; null for root nodes
displayModeStringCategory display mode (e.g. products_and_description)
logoUrlStringStorage URL for the category logo; null if not set
bannerUrlStringStorage URL for the category banner; null if not set
descriptionStringCategory description in the current app locale
localeStringApp locale used for top-level scalar fields
createdAtStringISO 8601 creation timestamp
updatedAtStringISO 8601 last-update timestamp
translationsscalar (JSON array)All locale translations (see below)
filterableAttributeIdsscalar (JSON array)Integer IDs of filterable attributes configured for this category

translations item shape

translations is returned as a plain JSON array (scalar in GraphQL). Each element corresponds to one locale row in category_translations:

KeyTypeDescription
localestringLocale code (e.g. en, fr)
namestring|nullCategory name in this locale
slugstring|nullURL slug in this locale
descriptionstring|nullDescription in this locale
metaTitlestring|nullSEO meta title
metaDescriptionstring|nullSEO meta description
metaKeywordsstring|nullSEO meta keywords

Example Query

graphql
query AdminCatalogCategory($id: ID!) {
  adminCategory(id: $id) {
    id
    _id
    name
    slug
    status
    position
    parentId
    displayMode
    logoUrl
    bannerUrl
    description
    locale
    createdAt
    updatedAt
    translations
    filterableAttributeIds
  }
}
json
{
  "id": "/api/admin/catalog/categories/7"
}

Example Response

json
{
  "data": {
    "adminCategory": {
      "id": "/api/admin/catalog/categories/7",
      "_id": 7,
      "name": "Apparel",
      "slug": "apparel",
      "status": 1,
      "position": 1,
      "parentId": 1,
      "displayMode": "products_and_description",
      "logoUrl": "https://example.com/storage/category/7/logo.webp",
      "bannerUrl": null,
      "description": "Men's and women's apparel",
      "locale": "en",
      "createdAt": "2026-01-12T08:15:00+00:00",
      "updatedAt": "2026-04-30T14:20:09+00:00",
      "translations": [
        {
          "locale": "en",
          "name": "Apparel",
          "slug": "apparel",
          "description": "Men's and women's apparel",
          "metaTitle": null,
          "metaDescription": null,
          "metaKeywords": null
        },
        {
          "locale": "fr",
          "name": "Vêtements",
          "slug": "vetements",
          "description": null,
          "metaTitle": null,
          "metaDescription": null,
          "metaKeywords": null
        }
      ],
      "filterableAttributeIds": [11, 23]
    }
  }
}

Errors

ScenarioGraphQL errors[]HTTP Status
Unknown ID"Category not found" in errors[], data.adminCategory: null200 (GraphQL convention)
Missing auth"Unauthenticated" in errors[]200

Notes

  • translations is a plain JSON scalar, not a typed GraphQL object list. You access it as a regular JSON array. This avoids API Platform serializing nested DTO objects as IRI strings instead of inline objects.
  • translations contains every locale in the DB, not just the current app locale. If the store has 3 locale rows (en, fr, de), all three are returned. Fields without content for a locale are null.
  • filterableAttributeIds is a plain JSON scalar array of integers. An empty array [] means no filterable attributes have been configured for this category.
  • The id argument is the IRI, not the numeric integer. Use the _id field from listing or tree queries and construct "/api/admin/catalog/categories/{_id}", or pass the id field directly.
  • translations and filterableAttributeIds are returned whole — query each as a bare field (no sub-selection); the entire structure resolves over GraphQL. The REST detail endpoint returns the same data.

Released under the MIT License.