# patchInventoryRepositoryData

Audience: Developer

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

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

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

## Arguments

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

## Returns

[InventoryRepositoryOutput](https://docs.pyck.cloud/dev/api/types/inventoryrepositoryoutput.md)

## Example

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

```graphql
mutation PatchInventoryRepositoryData($id: ID!, $patches: [JSONPatchInput!]!) {
  patchInventoryRepositoryData(id: $id, patches: $patches) {
    eventCount
    inventoryRepository {
      createdAt
      createdBy
      data
      dataTypeID
      dataTypeSlug
      deletedAt
      deletedBy
      id
      layout
      locationID
      name
      parentID
      tenantID
      type
      updatedAt
      updatedBy
      virtualRepo
    }
    transactionID
  }
}
```

**Variables**

```json
{
  "id": "<repository id to patch>",
  "patches": [
    {
      "op": "REPLACE",
      "path": "/capacity",
      "value": "500"
    }
  ]
}
```
