# itemMovements

Audience: Programmer

**Served by:** [inventory](https://docs.pyck.cloud/latest/api/services/inventory.md)

## Arguments

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `after` | [Cursor](https://docs.pyck.cloud/latest/api/scalars/cursor.md) |  | Returns the elements in the list that come after the specified cursor. |
| `first` | Int |  | Returns the first _n_ elements from the list. |
| `before` | [Cursor](https://docs.pyck.cloud/latest/api/scalars/cursor.md) |  | Returns the elements in the list that come before the specified cursor. |
| `last` | Int |  | Returns the last _n_ elements from the list. |
| `orderBy` | [ItemMovementOrder](https://docs.pyck.cloud/latest/api/inputs/itemmovementorder.md) |  | Ordering options for ItemMovements returned from the connection. |
| `where` | [ItemMovementWhereInput](https://docs.pyck.cloud/latest/api/inputs/itemmovementwhereinput.md) |  | Filtering options for ItemMovements returned from the connection. |

## Returns

[ItemMovementConnection](https://docs.pyck.cloud/latest/api/types/itemmovementconnection.md)!

## Example

Returns the 3 most recent unexecuted item movements.

```graphql
query GetItemMovements($after: Cursor, $first: Int, $before: Cursor, $last: Int, $orderBy: ItemMovementOrder, $where: ItemMovementWhereInput) {
  itemMovements(after: $after, first: $first, before: $before, last: $last, orderBy: $orderBy, where: $where) {
    totalCount
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      cursor
      node {
        blockedBy
        collectionID
        createdAt
        createdBy
        data
        dataTypeID
        dataTypeSlug
        deletedAt
        deletedBy
        executed
        executedAt
        fromID
        handler
        id
        itemID
        orderID
        position
        quantity
        tenantID
        toID
        updatedAt
        updatedBy
      }
    }
  }
}
```

**Variables**

```json
{
  "first": 3,
  "orderBy": {
    "direction": "DESC",
    "field": "CREATED_AT"
  },
  "where": {
    "createdAtGTE": "2023-10-17T00:00:00Z",
    "executed": false
  }
}
```
