In Shopify API version 2025-01, the metafield definition creation is failing when using either admin: MERCHANT_READ_WRITE or admin: PUBLIC_READ_WRITE for access control.
On MERCHANT_READ_WRITE response without throwing error:
{
"metafieldDefinitionCreate": {
"createdDefinition": null,
"userErrors": [
{
"field": ["definition"],
"message": "Setting this access control is not permitted. It must be one of [\"public_read_write\"].",
"code": "INVALID"
}
]
}
}
On PUBLIC_READ_WRITE response with throwing error:
{
"shop": "***.myshopify.com",
"error": {
"response": {
"errors": [
{
"message": "Variable $definition of type MetafieldDefinitionInput! was provided invalid value for access.admin (Expected \"PUBLIC_READ_WRITE\" to be one of: MERCHANT_READ, MERCHANT_READ_WRITE)",
"locations": [
{
"line": 2,
"column": 36
}
],
"extensions": {
"value": {
"name": "extension-name",
"namespace": "namespace",
"key": "key",
"type": "json",
"ownerType": "SHOP",
"access": {
"admin": "PUBLIC_READ_WRITE",
"storefront": "PUBLIC_READ"
}
},
"problems": [
{
"path": ["access", "admin"],
"explanation": "Expected \"PUBLIC_READ_WRITE\" to be one of: MERCHANT_READ, MERCHANT_READ_WRITE"
}
]
}
}
]
}
}
}