# updateInventoryRepository

Audience: Developer

Updates a repository.

Updates a repository. Changing its parent with `parentID` or `clearParent` is refused while the repository or one of
its descendants holds, expects or reserves stock, and while the repository has a repository movement that is neither
executed nor deleted: move such a repository with a repository movement. A `parentID` that is the repository itself
or one of its descendants is refused too. Sending the current parent again is no change and is accepted.

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

## Arguments

| Name | Type |
| --- | --- |
| `id` | ID! |
| `input` | [UpdateRepositoryInput](https://docs.pyck.cloud/dev/api/inputs/updaterepositoryinput.md)! |

## Returns

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

## Example

Updates an existing inventory repository's name.

```graphql
mutation UpdateInventoryRepository($id: ID!, $input: UpdateRepositoryInput!) {
  updateInventoryRepository(id: $id, input: $input) {
    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>",
  "input": {
    "name": "Warehouse Shelf A1 Updated"
  }
}
```
