Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

[Metafields Bug] Apps can create metafields without STRUCTS

[Metafields Bug] Apps can create metafields without STRUCTS

keiraarts
Shopify Partner
55 8 11

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)