Actions83
- Product Actions
- Product Variant Actions
- Collection Actions
- Article Actions
- Blog Actions
- Customer Actions
- Order Actions
- Draft Order Actions
- Inventory Actions
- File Actions
- Publication Actions
- Translation Actions
- Taxonomy Actions
- Metaobject Actions
- Metaobject Definition Actions
- Metafield Value Actions
- Metafield Definition Actions
- Service Actions
Metafield Definition → Update
AI-generatedSummary
Updates an existing Shopify metafield definition by modifying its name, description, or validations.
Inputs
- authentication — Method to authenticate with Shopify. Use Admin API Credentials for legacy access tokens or OAuth2 for managed token lifecycle.
- definitionId (required) — Global definition ID of the metafield to update (e.g., gid://shopify/...).
- name — New name for the metafield definition.
- description — New description for the metafield definition.
- validations — A list of validation rules to apply. Each rule requires a 'name' (e.g., 'min', 'max') and a 'value'.
- outputMode — Controls the shape of the returned data. 'Simplified' returns a single record with standard fields. 'Raw' returns the full GraphQL response. 'Selected Fields' allows you to specify a comma-separated list of fields to return.
- selectedFields — Comma-separated list of fields to return when output mode is set to 'Selected Fields'.
Output shape
a single record
When output mode is 'Simplified', returns the updated definition data. If 'Raw' or 'Selected Fields' is used, returns the full GraphQL payload or specified fields.
Examples
Example 1: Update a metafield definition's name and add a minimum length validation.
definitionId: gid://shopify/..., name: New Name, validations: [{name: min, value: 3}]
Example 2: Update a definition's description using OAuth2 authentication.
authentication: oAuth2, definitionId: gid://shopify/..., description: Updated description text
Example 3: Retrieve only the status and ID of the updated definition.
outputMode: selectedFields, selectedFields: status, id