---
# System prepended metadata

title: Warehouse order mutations

---

# Warehouse order mutations


### Uppdatera status på warehouse order 
```
mutation UpdateWarehouseOrderStatus($warehouseOrderId: uuid!, $status: warehouse_order_status_enum!, $arrivalDate: timestamptz) {
  update_warehouse_order(where: {id: {_eq: $warehouseOrderId}}, _set: {status: $status, actual_arrival_date: $arrivalDate}) {
    affected_rows
    returning {
      status
    }
  }
}
```
### Uppdatera status på warehouse order 

```
mutation CreateWarehouseOrder($userId: uuid!, $name: String, $shipment_provider: String, $shipment_tracking_code: String, $plannedArrivalDate: date, $actualArrivalDate: timestamptz, $type: warehouse_order_type_enum!) {
  insert_warehouse_order(objects: {actual_arrival_date: $actualArrivalDate, shipment_provider: $shipment_provider, shipment_tracking_code: $shipment_tracking_code, user_id: $userId, planned_arrival_date: $plannedArrivalDate, status: CREATED, name: $name, type: $type}) {
    affected_rows
    returning {
      id
    }
  }
}
```
```
mutation AddProductsToWarehouseOrder($products: [warehouse_order_product_insert_input!]!) {
  insert_warehouse_order_product(objects: $products) {
    affected_rows
  }
}
```

```
mutation UpdateInternalWarehouseOrderComment($warehouseOrderId: uuid!, $comment: String!) {
  update_warehouse_order(where: {id: {_eq: $warehouseOrderId}}, _set: {internal_comment: $comment}) {
    affected_rows
  }
}
```
```
mutation UpdateWarehouseOrderArrivalDate($warehouseOrderId: uuid!, $date: date!) {
  update_warehouse_order(where: {id: {_eq: $warehouseOrderId}}, _set: {planned_arrival_date: $date}) {
    affected_rows
  }
}
```
```
mutation UpdateWarehouseOrderHandlingTime($warehouseOrderId: uuid!, $handlingTime: Int!) {
  update_warehouse_order(where: {id: {_eq: $warehouseOrderId}}, _set: {handle_time: $handlingTime}) {
    affected_rows
  }
}
```
```
mutation SetHandlerOnWarehouseOrder($warehouseOrderId: uuid!, $userId: uuid!) {
  update_warehouse_order(where: {id: {_eq: $warehouseOrderId}}, _set: {handled_by: $userId}) {
    affected_rows
  }
}
```
```
mutation CompleteWarehouseOrder($warehouseOrderId: uuid!) {
  update_warehouse_order(where: {id: {_eq: $warehouseOrderId}}, _set: {status: COMPLETED}) {
    affected_rows
  }
}
```