A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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
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
Based on what I've found privateMetafields can be added only on Shop, Product and Variant.