List Roles (GraphQL)
Returns the paginated list of admin roles. A role is a named permission set assigned to admin users to control which areas of the admin panel they can access.
Operation
| Operation | Type | Purpose |
|---|---|---|
adminSettingsRoles | QueryCollection | List all roles (cursor-paginated) |
Arguments
All arguments are optional and combine in a single query — filter, sort and paginate together.
Pagination
| Argument | Description |
|---|---|
first | Number of records to return. |
after | Cursor to fetch the page after (from pageInfo.endCursor). |
Filters
Each filter narrows the result; supplying more than one combines with logical AND. They mirror the admin Roles datagrid filters.
| Argument | Type | Match | Example |
|---|---|---|---|
name | String | Partial (contains). | "Catalog" |
permission_type | String | Exact — all or custom. | "custom" |
Sorting
| Argument | Type | Values |
|---|---|---|
sort | String | id (default), name |
order | String | asc, desc (default desc) |
Quirks
permissionsis a string array of permission keys for acustomrole. For anallrole it isnull(full access — no explicit key list is stored).- The example trims the
permissionslist to a few entries; a realcustomrole can hold over a hundred keys. - The seeded Administrator role (
_id: 1) hasnulltimestamps — it predates timestamp tracking. - Page forward with
first+after(pass the previous response'sendCursor);totalCountis the unfiltered total.
TIP
All operations require an admin Bearer token — see Authentication.

