---
updatedAt: 2026-08-18T18:39:20.000Z
agentTools:
  projectIndex: https://stockpit.readme.io/llms.txt
---

# Queries

Notifications are the messages informing users of important events happening in their account.

# Available queries

### `Notifications` - Returns the list of notifications of the current user

```graphql
query Notifications(
  $orderBy: [QueryNotificationsOrderByOrderByClause!],
  $first: Int = 10,
  $page: Int
) {
  Notifications(
    orderBy: $orderBy
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
    }
    data {
      id
      created_at
      read_at
      data
      type
    }
  }
}
```

```json Variables (JSON)
{
  "orderBy": [
    {
      "column": "CREATED_AT",
      "order": "DESC"
    }
  ],
  "first": 10,
  "page": 1
}
```

<br/>

***

# Available fields

## Notification type

| id <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :----------------------------------------------------------------------------------------- |
| Unique identifier of the notification                                                      |

| created\_at <span style={{ fontWeight: "normal" }}>- [DateTime](/reference/data-types#datetime) </span> |
| :------------------------------------------------------------------------------------------------------ |
| Creation date of the notification                                                                       |

| updated\_at <span style={{ fontWeight: "normal" }}>- [DateTime](/reference/data-types#datetime) </span> |
| :------------------------------------------------------------------------------------------------------ |
| Date of the latest notification modification                                                            |

| read\_at <span style={{ fontWeight: "normal" }}>- [DateTime](/reference/data-types#datetime) </span> |
| :--------------------------------------------------------------------------------------------------- |
| Date at which the notification was read by the user (null if not yet read)                           |

| company\_id <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :-------------------------------------------------------------------------------------------------- |
| Identifier of the company the notification belongs to                                               |

| data <span style={{ fontWeight: "normal" }}>- [JSON](/reference/data-types#json) </span> |
| :--------------------------------------------------------------------------------------- |
| Additional data of the notification (context dependent)                                  |

| type <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string) </span> |
| :------------------------------------------------------------------------------------------- |
| Type of the notification                                                                     |

<br/>

***

# Sorting

You can sort data based on following fields : created\_at

```graphql
query Notifications(
  $orderBy: [QueryNotificationsOrderByOrderByClause!],
  $first: Int = 10,
  $page: Int
) {
  Notifications(
    orderBy: $orderBy
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
    }
    data {
      id
      created_at
      read_at
      data
      type
    }
  }
}
```

```json Variables (JSON)
{
  "orderBy": [
    {
      "column": "CREATED_AT",
      "order": "DESC"
    }
  ],
  "first": 10,
  "page": 1
}
```

## Example of data returned

```json
{
  "data": {
    "Notifications": {
      "paginatorInfo": {
        "total": 1
      },
      "data": [
        {
          "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
          "created_at": "2024-05-13 10:42:21",
          "read_at": null,
          "data": {
            "title": "Low stock alert",
            "message": "Product X is out of stock"
          },
          "type": "stock_alert"
        }
      ]
    }
  }
}
```