Skip to content

Catalog Attributes — Datagrid Listing (GraphQL)

Cursor-paginated GraphQL query that mirrors the Bagisto admin Catalog → Attributes datagrid. Returns the flat attribute list with filtering, sorting, and cursor pagination.

How this menu works

For attribute types, options, and the configurable/filterable flags, see the Attributes overview.

Operation

OperationTypePagination
adminAttributesQueryCursor (first / after)

Operation name

API Platform derives the GraphQL operation name from the resource shortName. AdminAttribute has shortName: 'AdminAttribute', so the collection query is adminAttributes (the Catalog segment is the API tag, not part of the name). The item query is adminAttribute(id: ID!).

Authentication

Every request must include an admin Bearer token:

Authorization: Bearer <token>

Obtain a token via the createAdminLogin mutation.

Arguments

ArgumentTypeDescriptionExample
firstIntNumber of items per page (default 10, max 50)10
afterStringCursor from a previous pageInfo.endCursor for keyset pagination"MA=="
idStringFilter by attribute ID — single integer or comma-separated list (e.g. "1" or "1,2")"12"
codeStringPartial attribute code match (SQL LIKE %value%)"color"
typeStringExact attribute type filter"select"
admin_nameStringPartial admin name match (SQL LIKE %value%)"Color"
is_requiredIntFilter by is_required: 0 = no, 1 = yes1
is_uniqueIntFilter by is_unique: 0 = no, 1 = yes0
is_filterableIntFilter by is_filterable: 0 = no, 1 = yes1
is_configurableIntFilter by is_configurable: 0 = no, 1 = yes1
is_visible_on_frontIntFilter by is_visible_on_front: 0 = no, 1 = yes1
is_user_definedIntFilter by is_user_defined: 0 = no, 1 = yes1
localeStringLocale code for translation resolution (default: app locale)"en"
sortStringColumn to sort by (see Sorting section below)"id"
orderStringSort direction: "asc" or "desc" (default "desc")"desc"

extraArgs convention

API Platform does not automatically expose filter arguments in the GraphQL schema for QueryCollection operations. This query uses extraArgs declared on the QueryCollection operation to surface all filter/sort arguments as first-class GraphQL arguments. Pass them directly alongside first and after.

Node Fields

Each edges[].node object contains:

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
localeStringLocale code used for name resolution
createdAtStringISO 8601 creation timestamp
updatedAtStringISO 8601 last-update timestamp

translations and options not available in listing

translations and options are not returned in this query — they are only available in the item query adminAttribute(id: ID!). Use the item query when you need per-locale display names or option lists for a specific attribute.

Example Query

graphql
query AdminCatalogAttributes(
  $first: Int
  $after: String
  $type: String
  $is_configurable: Int
  $locale: String
) {
  adminAttributes(
    first: $first
    after: $after
    type: $type
    is_configurable: $is_configurable
    locale: $locale
  ) {
    edges {
      cursor
      node {
        id
        _id
        code
        type
        adminName
        isRequired
        isUnique
        valuePerLocale
        valuePerChannel
        isFilterable
        isConfigurable
        isVisibleOnFront
        isUserDefined
        swatchType
        position
        locale
        createdAt
        updatedAt
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      endCursor
      startCursor
    }
    totalCount
  }
}
json
{
  "first": 10,
  "type": "select",
  "is_configurable": 1,
  "locale": "en"
}

Example Response

json
{
  "data": {
    "adminAttributes": {
      "edges": [
        {
          "cursor": "MA==",
          "node": {
            "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",
            "createdAt": "2026-01-12T08:15:00+00:00",
            "updatedAt": "2026-04-30T14:20:09+00:00"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "endCursor": "MA==",
        "startCursor": "MA=="
      },
      "totalCount": 1
    }
  }
}

Sorting

Pass sort with the column name and order for direction.

Sortable columns:

sort valueSorts by
idAttribute ID (default)
codeAttribute code
admin_nameAdmin label
typeAttribute type
positionDisplay order position

Cursor Pagination

  • first controls the page size (default 10, max 50).
  • To fetch the next page, pass the pageInfo.endCursor value as after in the next request.
  • totalCount reflects the full count of matching attributes across all pages.

Notes

  • GraphQL and REST share identical filter and sort semantics — the same results are returned over both transports.
  • No automatic filter applied. All attributes (system and user-defined) are returned by default. Pass is_user_defined: 1 to restrict to admin-created attributes.
  • Pass filter and sort arguments at the top level of the query, alongside first and after.
  • Every camelCase flag field resolves over GraphQLisRequired, isConfigurable, isFilterable, etc. all come back populated; GraphQL and REST return the same values.

Released under the MIT License.