Skip to content

Catalog Attribute — Detail (GraphQL)

GraphQL item query that returns a single attribute by its IRI, including the full translations array (every locale present in the database) and — for select, multiselect, and checkbox types — all options with their own locale translations.

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

Operation

OperationType
adminAttributeQuery (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 attribute (e.g. "/api/admin/catalog/attributes/12")

Finding the IRI

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

Fields

FieldTypeDescription
idIDAPI Platform IRI (e.g. /api/admin/catalog/attributes/12)
_idIntRaw attribute ID
codeStringAttribute code (e.g. color, size)
typeStringAttribute type (e.g. select, text, boolean)
adminNameStringInternal admin-facing label
isRequiredInt1 = required on product forms
isUniqueInt1 = value must be unique across products
valuePerLocaleInt1 = separate value per store locale
valuePerChannelInt1 = separate value per channel
isFilterableInt1 = appears in layered navigation
isConfigurableInt1 = used as a configurable variant axis
isVisibleOnFrontInt1 = shown on the storefront product page
isUserDefinedInt1 = admin-created (not a system attribute)
swatchTypeStringSwatch mode (color, image, text); null for non-swatch types
positionIntDisplay order position
localeStringApp locale used for top-level scalar fields
validationStringValidation rule string (e.g. numeric, email); null if none
defaultValueStringDefault value; null if not configured
isComparableInt1 if shown in the storefront product-compare table, else 0
enableWysiwygInt1 if a rich-text editor is used for a textarea attribute, else 0
regexStringCustom regex pattern, used when validation is regex; null otherwise
createdAtStringISO 8601 creation timestamp
updatedAtStringISO 8601 last-update timestamp
translationsscalar (JSON array)All locale translations — see shape below
optionsscalar (JSON array|null)Options for select/multiselect/checkbox types; null for other types

translations item shape

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

KeyTypeDescription
localestringLocale code (e.g. en, fr)
namestring|nullLocale-specific attribute display name

options[] item shape

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

KeyTypeDescription
idintegerOption ID
adminNamestringInternal admin label for the option
sortOrderintegerDisplay sort order
swatchValuestring|nullSwatch value (hex for color, path for image, text for text); null otherwise
swatchValueUrlstring|nullFull URL to the swatch image for image swatches; null for other types
translationsarrayLocale translations for this option (see below)

options[].translations[] item shape

KeyTypeDescription
localestringLocale code (e.g. en, fr)
labelstring|nullLocale-specific display label for the option

translations and options are returned whole

translations and options (each option with its nested translations) are returned as whole JSON — query each as a bare field (translations, not translations { … }). The entire structure comes back, and they resolve over GraphQL.

Example Query

graphql
query AdminCatalogAttribute($id: ID!) {
  adminAttribute(id: $id) {
    id
    _id
    code
    type
    adminName
    isRequired
    isUnique
    valuePerLocale
    valuePerChannel
    isFilterable
    isConfigurable
    isVisibleOnFront
    isUserDefined
    swatchType
    position
    locale
    validation
    defaultValue
    createdAt
    updatedAt
    translations
    options
  }
}
json
{
  "id": "/api/admin/catalog/attributes/12"
}

Example Response

json
{
  "data": {
    "adminAttribute": {
      "id": "/api/admin/catalog/attributes/12",
      "_id": 12,
      "code": "color",
      "type": "select",
      "adminName": "Color",
      "isRequired": 0,
      "isUnique": 0,
      "valuePerLocale": 0,
      "valuePerChannel": 0,
      "isFilterable": 1,
      "isConfigurable": 1,
      "isVisibleOnFront": 1,
      "isUserDefined": 1,
      "swatchType": "color",
      "position": 5,
      "locale": "en",
      "validation": null,
      "defaultValue": null,
      "isComparable": 0,
      "enableWysiwyg": 0,
      "regex": null,
      "createdAt": "2026-01-12T08:15:00+00:00",
      "updatedAt": "2026-04-30T14:20:09+00:00",
      "translations": [
        { "locale": "en", "name": "Color" },
        { "locale": "fr", "name": "Couleur" }
      ],
      "options": [
        {
          "id": 33,
          "adminName": "Red",
          "sortOrder": 1,
          "swatchValue": "#FF0000",
          "swatchValueUrl": null,
          "translations": [
            { "locale": "en", "label": "Red" },
            { "locale": "fr", "label": "Rouge" }
          ]
        },
        {
          "id": 34,
          "adminName": "Blue",
          "sortOrder": 2,
          "swatchValue": "#0000FF",
          "swatchValueUrl": null,
          "translations": [
            { "locale": "en", "label": "Blue" },
            { "locale": "fr", "label": "Bleu" }
          ]
        }
      ]
    }
  }
}

Errors

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

Notes

  • translations and options are plain JSON scalars, not typed GraphQL object lists. You access them as regular JSON arrays in the response. This avoids API Platform serializing nested objects as IRI strings instead of inline objects — a known behaviour when using nested DTO types in API Platform GraphQL.
  • options is null for non-option types. Only select, multiselect, and checkbox attributes have options. For all other types, options is null.
  • translations contains every locale in the DB, not just the current app locale. If the store has translations for en, fr, and de, all three entries are returned. Missing locale entries have null name.
  • The id argument is the IRI, not the numeric integer. Use the _id field from listing queries and construct "/api/admin/catalog/attributes/{_id}", or pass the id field directly from a listing result.
  • GraphQL and REST return identical data for this query — both return translations and options as plain JSON arrays queried bare (no sub-selection), and every camelCase flag field (isRequired, isConfigurable, adminName, etc.) resolves over GraphQL.

Released under the MIT License.