Skip to content
Pyck docs

patchDeviceData

Since pyck v0.27.0

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

Served by: management

Name Type Default Description
id ID!
patches [JSONPatchInput!]!

DeviceOutput!

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

mutation PatchDeviceData($id: ID!, $patches: [JSONPatchInput!]!) {
patchDeviceData(id: $id, patches: $patches) {
device {
createdAt
createdBy
data
dataTypeID
dataTypeSlug
deletedAt
deletedBy
id
name
tenantID
updatedAt
updatedBy
}
eventCount
transactionID
}
}

Variables

{
"id": "<device id to patch>",
"patches": [
{
"op": "REPLACE",
"path": "/firmware",
"value": "\"2.0\""
},
{
"op": "REPLACE",
"path": "/battery",
"value": "95"
}
]
}