Cannot create PrivateMetafield on a Image

Cannot create PrivateMetafield on a Image

AlexKuh
Visitor
3 0 1

Running following query:

mutation privateMetafieldUpsert($input: PrivateMetafieldInput!) {
privateMetafieldUpsert(input: $input) {
privateMetafield {
value
valueType
}
userErrors {
field
message
}
}
}

Input:

{"input": {
"key": "image_id",
"namespace": "PIM",
"valueInput": {
"value": "1",
"valueType": "STRING"
},
"owner": "gid://shopify/ProductImage/29926779322573"
}

Response

{
"data": {
"privateMetafieldUpsert": {
"privateMetafield": null,
"userErrors": [
{
"field": [
"input"
],
"message": "the owner record does not exist"
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 1000.0,
"currentlyAvailable": 990,
"restoreRate": 50.0
}
}
}
}

 Owner ID exists, because it's taken from Product.image[0].id

Reply 1 (1)

AlexKuh
Visitor
3 0 1

Based on what I've found privateMetafields can be added only on Shop, Product and Variant.