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.

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

Operation

OperationTypePagination
adminAttributesQueryCursor (first / after)

Arguments

ArgumentTypeDescriptionExample
firstIntNumber of items per page (default 10, max 50)10
afterStringCursor from a previous pageInfo.endCursor for keyset pagination"MA=="
lastIntPage size when paging backwards10
beforeStringCursor from a previous pageInfo.startCursor"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"

Every filter is a first-class GraphQL argument — pass them alongside first and after, not inside a nested filter object. Filters combine with AND, so each one narrows the result. Most filter names are snake_case (admin_name, is_required) while the node fields they filter are camelCase (adminName, isRequired); that mismatch is the literal schema.

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

Fields That Stay Null on the Listing

translations, options, validation, defaultValue, isComparable, enableWysiwyg, and regex are declared on the type but resolve only on the item query adminAttribute(id:). Selecting them here is not an error — you simply get null.

swatchType and position are also frequently null on the listing, but for a different reason: they are genuinely unset on most attributes rather than withheld.

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.

Behaviour Worth Knowing

  • The boolean flags are integers, not booleans. isRequired, isUnique, isFilterable, isConfigurable, isVisibleOnFront, isUserDefined, valuePerLocale, and valuePerChannel all come back as 0 or 1. Note 0 is falsy in JavaScript but "0" would not be — these are real Ints here, unlike the product listing where the same concepts are strings.
  • System attributes are included. The listing returns both Bagisto's built-in attributes and admin-created ones. Pass is_user_defined: 1 for admin-created only — useful because system attributes cannot be deleted.
  • swatchType is only meaningful for swatch-capable types. It stays null on a plain text or select attribute rather than carrying a default.
  • REST returns the same rows through GET /api/admin/catalog/attributes, with identical filter and sort semantics.

Released under the MIT License.