Hi ,
I am trying to create some metafields for my shopify public app on behalf of store to to store some data in it , i would prefer to set access controls so that store admin cannot view metafiles or have read only access so that it cannot be modified accidentally or deleted
for that i tried to create metafield definition first but getting error
Error “message”: “Owner type is not included in the list” (when access node is not passed )
OR
“message”: “Setting this access control is not permitted. It must be one of ["public_read_write"].” (when access node is passed)
documentation link followed MetafieldOwnerType - GraphQL Admin
======== code part ========
mutation {
metafieldDefinitionCreate(definition: {
name: “Ingredients”,
namespace: “bakery”,
key: “ingredients”,
description: “A list of ingredients used to make the product.”,
type: “json”,
ownerType: API_PERMISSION,
access: {
admin: MERCHANT_READ,
customerAccount: NONE,
storefront: PUBLIC_READ
}
}) {
createdDefinition {
id
}
userErrors {
field
message
}
}
}