# tagGroups query


`tagGroups` is a GraphQL query of the Chameleoon MAX API. Send it as `POST https://max-api.chameleoon.sk/api/v1/graphql` with your API key, see [Chameleoon MAX](/chameleoon-max).

Returns a page of the organisation's tag groups, by their order in MAX, then name. A group's
tags are read with [`tags`](/chameleoon-max/query/tags) and `filter.groupCode`.

- Requires the same permissions as [`tags`](/chameleoon-max/query/tags).
- Archived groups are left out unless `filter.includeArchived` is `true`.
- The connection has no total count.

Pass exactly one of `first` or `last`, from 1 to 250. `first` (with `after`) pages forward;
`last` (with `before`) pages backward.

A page costs 2 + first (or last) × the cost of one node.

## Arguments

- `filter`: [`TagGroupFilter`](/chameleoon-max/type/tag-group-filter)
- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

## Returns

[`TagGroupConnection!`](/chameleoon-max/type/tag-group-connection): a page of [`TagGroup`](/chameleoon-max/type/tag-group).

## Example

**Query**

```graphql
query tagGroups($first: Int) {
  tagGroups(first: $first) {
    edges {
      cursor
    }
    nodes {
      code
      name
      exclusive
      automationOnly
      archived
      description
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

**Variables**

```json
{
  "first": 10
}
```

**Response**

```json
{
  "data": {
    "tagGroups": {
      "edges": [
        {
          "cursor": "example"
        }
      ],
      "nodes": [
        {
          "code": "example",
          "name": "example",
          "exclusive": true,
          "automationOnly": true,
          "archived": true,
          "description": "example"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "example",
        "endCursor": "example"
      }
    }
  }
}
```

Values are illustrative: replace IDs and codes with your own before you send the call.
