# roles

Query · GraphQL API

A paginated list of roles that match the RoleSearchInput.

## Authentication

- SERVER

## Input

- `input` (`RoleSearchInput!`) — required
- `first` (`Int`)
- `after` (`String`)

## Returns [RoleSearchConnection](/braintree/graphql/reference/types/role-search-connection)

A paginated list of searched merchant roles.

### Returned fields

- `edges` (`[RoleConnectionEdge]`): A list of merchant roles.
- `pageInfo` (`PageInfo!`) — non-null: Information about the page of roles contained in `edges`.

## Examples

### Search roles

A paginated list of roles that match the RoleSearchInput.

```graphql
query searchRoles($input: RoleSearchInput!, $first: Int, $after: String)  {
  roles(input: $input, first: $first, after: $after) {
    edges {
      cursor
      node {
        id
        name
        isAccountAdmin
        rights {
          name
        }
      }
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

---

[View the complete GraphQL schema on GitHub](https://raw.githubusercontent.com/braintree/graphql-api/refs/heads/master/schema.graphql)