# patchDeviceLocationData

Audience: Programmer

Apply RFC 6902 JSON Patch operations to the device location's data field.

Apply RFC 6902 JSON Patch operations to the device location's data field.

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

## Arguments

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | ID! |  |  |
| `patches` | \[[JSONPatchInput](https://docs.pyck.cloud/latest/api/inputs/jsonpatchinput.md)!\]! |  |  |

## Returns

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

## Example

Applies RFC 6902 JSON Patch operations to the device location assignment's data field. Only changed fields are modified; untouched fields are preserved.

```graphql
mutation PatchDeviceLocationData($id: ID!, $patches: [JSONPatchInput!]!) {
  patchDeviceLocationData(id: $id, patches: $patches) {
    DeviceLocation {
      createdAt
      createdBy
      data
      dataTypeID
      dataTypeSlug
      deletedAt
      deletedBy
      deviceID
      id
      locationID
      tenantID
      updatedAt
      updatedBy
    }
    eventCount
    transactionID
  }
}
```

**Variables**

```json
{
  "id": "<device location id to patch>",
  "patches": [
    {
      "op": "REPLACE",
      "path": "/priority",
      "value": "\"high\""
    },
    {
      "op": "ADD",
      "path": "/note",
      "value": "\"Moved to urgent area\""
    }
  ]
}
```
