Mind providing a full screen shot of the GraphiQL app query that’s failing?
Topic summary
Users are encountering issues updating public product metafields via GraphQL’s productUpdate mutation, receiving errors like “Key must be unique within this namespace on this resource” despite successful API responses.
Key Technical Requirements Identified:
- Must include
valueTypeparameter (e.g., “INTEGER”, “STRING”) in the mutation - Must use the metafield’s actual
id(e.g., “gid://shopify/Metafield/XXX”) rather than just namespace/key as the identifier - Requires appropriate API access permissions/scopes
Common Issues & Solutions:
- Permission errors: Resolved by reinstalling the Shopify GraphiQL App or verifying user account permissions
- Value conflicts: Title_tag metafield cannot have the same value as the product’s title
- Documentation gap: Official tutorials only cover updating private metafields, not public ones, causing confusion
Current Status:
Some users successfully updated metafields after correcting the mutation structure and permissions. However, the “Key must be unique” error persists for others in the latest API version, suggesting the issue remains partially unresolved. The lack of clear documentation for public metafield updates continues to be a pain point.