Shopify Custom icon

Shopify Custom

Shopify Admin GraphQL node with metafields and definitions support

Metafield Definition → Update

AI-generated

Summary

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

Links

Discussion