Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

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.