I’m trying to use the recently introduced graphql API_PERMISSION ownership type in order to create my app metafields which i can use in theme-extension snippets.
Unfortunately it returns me this error:
{
"data": {
"metafieldDefinitionCreate": {
"createdDefinition": null,
"userErrors": [
{
"field": [
"definition",
"ownerType"
],
"message": "Owner type is not included in the list",
"code": "INCLUSION"
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 10,
"actualQueryCost": 10,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 990,
"restoreRate": 50
}
}
}
}
It seems you are using metafieldDefinitionCreate mutation. Instead, you will need to use metafieldSet mutation from Admin API 2022-04 or above in order to create app-owned metafields.