[Metafields Bug] Apps can create metafields without STRUCTS

[Metafields Bug] Apps can create metafields without STRUCTS

keiraarts
Shopify Partner
53 7 10

I can update an order with a metafield value that does not have a definition. If I then try to create an app definition using my app reserved namespace and key Shopify will return user errors that it already exists.

mutation metafieldDefinitionCreate($definition: MetafieldDefinitionInput!) {
	metafieldDefinitionCreate(definition: $definition) {
		createdDefinition {
			id
		}
		userErrors {
			code
			field
			message
		}
	}
}
"userErrors": [
				{
					"code": "UNSTRUCTURED_ALREADY_EXISTS",
					"field": [
						"definition"
					],
					"message": "Namespace and key is already in use for a set of your metafields."
				}
			]

However, the metafield will remain invisible to the merchant and the app owner when running this query.

query metafieldDefinitionsget {
	metafieldDefinitions(first: 100, ownerType: ORDER) {
		edges {
			node {
				id
				pinnedPosition
				name
				namespace
				ownerType
				key
				 
				  
			}
		}
	}
}

App developers need a way to create metafield definitions for the metafield values their app set.

The bug was previously surfaced six month ago here.
https://community.shopify.com/c/metafields-and-custom-data/trying-to-create-a-metafield-definition-f...

Head of space operations on the Shopify moon-base.
Building orderediting.com, viaGlamour.com, magicsoaps.ca
Replies 0 (0)