# conversationReadState

```graphql
query ConversationReadState($conversationId: ID!) {
  conversationReadState(conversationId: $conversationId) {
    conversationId
    lastReadMessageId
    unreadCount
  }
}
```

Get the read cursor and the unread count of the caller for a conversation to show unread badges; returns the last read message and the number of unread messages.

## Arguments

| Name             | Type | Required | Description |
| ---------------- | ---- | -------- | ----------- |
| `conversationId` | ID!  | Yes      |             |

## Variables

```json
{
  "conversationId": "string"
}
```

## Responses

| Status | Description                                               |
| ------ | --------------------------------------------------------- |
| 200    | The ConversationReadState! in data.conversationReadState. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query ConversationReadState($conversationId: ID!) {\n  conversationReadState(conversationId: $conversationId) {\n    conversationId\n    lastReadMessageId\n    unreadCount\n  }\n}",
  "variables": {
    "conversationId": "string"
  }
}'
```

## Example response

```json
{
  "data": {
    "conversationReadState": {
      "conversationId": "string",
      "lastReadMessageId": "string",
      "unreadCount": 0
    }
  }
}
```
