# errorReports query


`errorReports` 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 the error reports on one record, most recently seen first. Use it to show your users
what MAX knows went wrong with a record.

- The filter names one record (`subject`).
- `lastSeenAt` moves when a report recurs, so a report that recurs while you page moves to
  the first page.
- Requires the record's read permission. Without it, the error is `FORBIDDEN_ROLE` naming it.
- The record must be in your API key's scope. Otherwise the error is `NOT_FOUND` with the
  field `filter.subject`.

A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page. Pass exactly
one of `first` or `last`, from 1 to 250. `first` (with `after`) pages forward; `last` (with
`before`) pages backward. `last` alone returns the last page.

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

## Arguments

- `filter`: [`ErrorReportFilter!`](/chameleoon-max/type/error-report-filter) · required
- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

## Returns

[`ErrorReportConnection!`](/chameleoon-max/type/error-report-connection): a page of [`ErrorReport`](/chameleoon-max/type/error-report).

## Example

**Query**

```graphql
query errorReports($filter: ErrorReportFilter!, $first: Int) {
  errorReports(filter: $filter, first: $first) {
    edges {
      cursor
    }
    nodes {
      id
      lineId
      source
      code
      status
      mutedUntil
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

**Variables**

```json
{
  "filter": {
    "subject": {
      "type": "STOCK_DOCUMENT",
      "id": "00000000-0000-4000-8000-000000000001"
    }
  },
  "first": 10
}
```

**Response**

```json
{
  "data": {
    "errorReports": {
      "edges": [
        {
          "cursor": "example"
        }
      ],
      "nodes": [
        {
          "id": "00000000-0000-4000-8000-000000000001",
          "lineId": "00000000-0000-4000-8000-000000000001",
          "source": "example",
          "code": "example",
          "status": "OPEN",
          "mutedUntil": "2026-01-01T00:00:00Z"
        }
      ],
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "example",
        "endCursor": "example"
      }
    }
  }
}
```

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