# patchInventoryItemData

Audience: Developer

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

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

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

## Arguments

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

## Returns

[InventoryItemOutput](https://docs.pyck.cloud/api/types/inventoryitemoutput.md)

## Example

Applies RFC 6902 JSON Patch operations to the inventory item's data field. Only changed fields are modified; untouched fields are preserved. See https://datatracker.ietf.org/doc/html/rfc6902 for the specification.

```graphql
mutation PatchInventoryItemData($id: ID!, $patches: [JSONPatchInput!]!) {
  patchInventoryItemData(id: $id, patches: $patches) {
    eventCount
    inventoryItem {
      createdAt
      createdBy
      currentStockTotals {
        lastChangedAt
        quantity
      }
      data
      dataTypeID
      dataTypeSlug
      deletedAt
      deletedBy
      id
      sku
      tenantID
      updatedAt
      updatedBy
    }
    transactionID
  }
}
```

**Variables**

```json
{
  "id": "<inventory item id to patch>",
  "patches": [
    {
      "op": "REPLACE",
      "path": "/location",
      "value": "\"Shelf-C3\""
    },
    {
      "op": "REPLACE",
      "path": "/fragile",
      "value": "true"
    }
  ]
}
```
