# deviceLocations

Audience: Developer

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

## Arguments

| Name | Type | Description |
| --- | --- | --- |
| `after` | [Cursor](https://docs.pyck.cloud/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/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` | [DeviceLocationOrder](https://docs.pyck.cloud/api/inputs/devicelocationorder.md) | Ordering options for DeviceLocations returned from the connection. |
| `where` | [DeviceLocationWhereInput](https://docs.pyck.cloud/api/inputs/devicelocationwhereinput.md) | Filtering options for DeviceLocations returned from the connection. |

## Returns

[DeviceLocationConnection](https://docs.pyck.cloud/api/types/devicelocationconnection.md)!

## Example

Lists device-location assignments with pagination.

```graphql
query GetDeviceLocations($after: Cursor, $first: Int, $before: Cursor, $last: Int, $orderBy: DeviceLocationOrder, $where: DeviceLocationWhereInput) {
  deviceLocations(after: $after, first: $first, before: $before, last: $last, orderBy: $orderBy, where: $where) {
    totalCount
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    edges {
      cursor
      node {
        createdAt
        createdBy
        data
        dataTypeID
        dataTypeSlug
        deletedAt
        deletedBy
        deviceID
        id
        locationID
        tenantID
        updatedAt
        updatedBy
      }
    }
  }
}
```

**Variables**

```json
{
  "first": 10,
  "orderBy": {
    "direction": "ASC",
    "field": "CREATED_AT"
  }
}
```
