> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sorting Catalog Items

The `getCatalogData` query supports customizable sorting to help control the order in which catalog items are returned. This is particularly useful when users need to view trainings by title, date, or duration.

Sorting is configured using two arguments: `sortKey` and `reverse`.

<Note>
  Sorting can be combined with pagination and filtering arguments to further refine the results.
</Note>

### **Sorting Arguments**

| **Argument** | **Type**          | **Description**                                                                              |
| ------------ | ----------------- | -------------------------------------------------------------------------------------------- |
| `sortKey`    | `CatalogSortKeys` | Specifies the field to sort by. See available options below.                                 |
| `reverse`    | `Boolean`         | If `true`, reverses the sort order (e.g., from ascending to descending). Default is `false`. |

<Note>
  By default, sorting is performed in \*\*ascending \*\*order. Use `reverse: true` to sort in **descending** order.
</Note>

### \*\*Available \*\*`sortKey`**Values**

| Sort Key    | Description                             | Underlying Field             |
| ----------- | --------------------------------------- | ---------------------------- |
| `TITLE`     | Sorts trainings alphabetically by title | Training title               |
| `DURATION`  | Sorts by the training's duration label  | Duration taxonomy label      |
| `PUBLISHED` | Sorts by publication date               | Entity publication timestamp |
