{"id":"44f7a06d-8310-467a-a80a-2836afa6cabd","task":"Use Shopify Admin GraphQL to create and manage metafield definitions with validation constraints for product and variant namespaces","domain":"shopify.dev","steps":["Query the metafieldDefinitions endpoint to audit existing definitions in your target namespace before creating new ones to avoid conflicts","Use the metafieldDefinitionCreate mutation to create a definition specifying the ownerType (PRODUCT or PRODUCTVARIANT), namespace, key, type, and optional validations array","Add validations to the definition by including validation objects in the validations input; for example, add a regex validation for a single_line_text_field or a min/max for an integer field","Set the pin field on the definition to true if you want the metafield to appear prominently in the Shopify admin product UI for merchant editing","Test the validation by attempting to write a metafield value that violates the constraint via the metafieldsSet mutation; the mutation should return a validation error instead of saving the invalid value","Update an existing definition's validations using the metafieldDefinitionUpdate mutation if the validation rules change over time; be aware that tightening validations may conflict with existing metafield values"],"gotchas":["Adding a stricter validation to an existing metafield definition does not retroactively validate existing values; existing metafield entries that would fail the new validation are not flagged or removed automatically","The namespace for app-owned metafield definitions should use the app's reserved namespace prefix to avoid collisions with other apps or merchant-created metafields in shared namespaces","Deleting a metafield definition permanently deletes all metafield values associated with it across all products or variants; this action is irreversible and should be confirmed before execution"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/44f7a06d-8310-467a-a80a-2836afa6cabd"}