Catalog Attribute Families — Datagrid Listing (GraphQL)
Cursor-paginated GraphQL query that mirrors the Bagisto admin Catalog → Attribute Families datagrid. Returns the flat family list with filtering, sorting, and cursor pagination.
How this menu works
For how a family's attribute groups + attributes are structured and the delete guards, see the Attribute Families overview.
Operation
| Operation | Type | Pagination |
|---|---|---|
adminAttributeFamilies | Query | Cursor (first / after) |
Operation name
API Platform derives the GraphQL operation name from the resource shortName. AdminAttributeFamily has shortName: 'AdminAttributeFamily', so the collection query is adminAttributeFamilies and the item query is adminAttributeFamily(id: ID!).
Authentication
Every request must include an admin Bearer token:
Authorization: Bearer <token>Obtain a token via the createAdminLogin mutation.
Arguments
| Argument | Type | Description | Example |
|---|---|---|---|
first | Int | Number of items per page (default 10, max 50) | 10 |
after | String | Cursor from a previous pageInfo.endCursor for keyset pagination | "MA==" |
id | String | Filter by family ID — single integer or comma-separated list (e.g. "1" or "1,2") | "1" |
code | String | Partial family code match (SQL LIKE %value%) | "default" |
name | String | Partial family name match (SQL LIKE %value%) | "Apparel" |
sort | String | Column to sort by (see Sorting section below) | "id" |
order | String | Sort 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:
| Field | Type | Description |
|---|---|---|
id | ID | API Platform IRI (e.g. /api/admin/catalog/families/1) |
_id | Int | Raw family ID |
code | String | Family code (e.g. default, apparel) |
name | String | Family display name (e.g. Default, Apparel) |
No timestamps or attribute groups in the listing
The listing returns only 3 data fields. The attribute_families table has no timestamps ($timestamps = false), so createdAt / updatedAt do not exist. Attribute groups and nested attributes are only available via the item query adminAttributeFamily(id: ID!).
Example Query
query AdminAttributeFamilies(
$first: Int
$after: String
$code: String
$name: String
$sort: String
$order: String
) {
adminAttributeFamilies(
first: $first
after: $after
code: $code
name: $name
sort: $sort
order: $order
) {
edges {
cursor
node {
id
_id
code
name
}
}
pageInfo {
hasNextPage
hasPreviousPage
endCursor
startCursor
}
totalCount
}
}{
"first": 10,
"sort": "id",
"order": "desc"
}Example Response
{
"data": {
"adminAttributeFamilies": {
"edges": [
{
"cursor": "MA==",
"node": {
"id": "/api/admin/catalog/families/3",
"_id": 3,
"code": "apparel",
"name": "Apparel"
}
},
{
"cursor": "MQ==",
"node": {
"id": "/api/admin/catalog/families/1",
"_id": 1,
"code": "default",
"name": "Default"
}
}
],
"pageInfo": {
"hasNextPage": false,
"hasPreviousPage": false,
"endCursor": "MQ==",
"startCursor": "MA=="
},
"totalCount": 2
}
}
}Sorting
Pass sort with the column name and order for direction.
Sortable columns:
sort value | Sorts by |
|---|---|
id | Family ID (default) |
code | Family code |
name | Family display name |
Cursor Pagination
firstcontrols the page size (default10, max50).- To fetch the next page, pass the
pageInfo.endCursorvalue asafterin the next request. totalCountreflects the full count of matching families across all pages.
Notes
- Same provider as the REST endpoint —
AdminAttributeFamilyCollectionProviderserves both transports with identical filter and sort semantics. - Only 3 node fields are available. The listing is intentionally slim —
id,_id,code,name. No timestamps exist on the table and attribute groups are not embedded in the listing. extraArgsdeclares custom arguments. The filter/sort arguments are not part of the standard API Platform GraphQL schema forQueryCollection— they are explicitly declared viaextraArgson the operation. Pass them at the top level of the query, alongsidefirstandafter.attributeGroupsis not a field in this query. It is only populated by the item queryadminAttributeFamily(id: ID!). RequestingattributeGroupsin the collection query will cause a GraphQL schema error.

