younifyd
Menu

metafieldDefinitionUpdate

Updates a MetafieldDefinition's configuration and settings. You can modify the definition's name, description, validation rules, access settings, capabilities, and constraints.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the metafieldDefinitionUpdate action (under Metafield).
  3. Fill in the fields below, then reference the result from later steps as {{metafielddefinitionupdate.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation MetafieldDefinitionUpdate($definition: MetafieldDefinitionUpdateInput!) {
  metafieldDefinitionUpdate(definition: $definition) {
    updatedDefinition {
      access {
        admin
        customerAccount
        storefront
      }
      capabilities {
        adminFilterable
        analyticsQueryable
        cartToOrderCopyable
        smartCollectionCondition
        uniqueValues
      }
      constraints {
        key
      }
      description
      id
      key
      name
      namespace
      ownerType
      pinnedPosition
      standardTemplate {
        description
        id
        key
        name
        namespace
        ownerTypes
        type
        validations
        visibleToStorefrontApi
      }
      type {
        category
        name
        supportedValidations
        supportsDefinitionMigrations
        valueType
      }
      useAsCollectionCondition
      validationStatus
      validations {
        name
        type
        value
      }
    }
    userErrors {
      code
      elementIndex
      elementKey
      field
      message
    }
    validationJob {
      done
      id
      query {
        appDiscountTypes
        availableBackupRegions
        availableCarrierServices
        availableLocales
        backupRegion
        businessEntities
        catalogOperations
        collectionConditionMetafieldDefinitions
        collectionRulesConditions
        consentPolicyRegions
        currentAppInstallation
        currentStaffMember
        deliveryPromiseSettings
        financeAppAccessPolicy
        financeKycInformation
        fulfillmentConstraintRules
        giftCardConfiguration
        inventoryProperties
        locationsAvailableForDeliveryProfiles
        metafieldDefinitionTypes
        onlineStore
        pendingOrdersCount
        primaryMarket
        privacySettings
        publicApiVersions
        serverPixel
        shop
        shopBillingPreferences
        shopifyPaymentsAccount
        storeCreditConfiguration
        taxonomy
      }
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

definitionobjectrequired

The input fields for the metafield definition update.

namespacestring
keystringrequired
namestring
descriptionstring
ownerTypestringrequired

One ofAPI_PERMISSIONCOMPANYCOMPANY_LOCATIONPAYMENT_CUSTOMIZATIONVALIDATIONCUSTOMERDELIVERY_CUSTOMIZATIONDRAFTORDERGIFT_CARD_TRANSACTIONTRANSFERMARKETCARTTRANSFORMCOLLECTIONMEDIA_IMAGEPRODUCTPRODUCTVARIANTSELLING_PLANARTICLEBLOGPAGEFULFILLMENT_CONSTRAINT_RULEORDER_ROUTING_LOCATION_RULEDISCOUNTORDERLOCATIONSHOP

validationsarray<object>2 fields
pinboolean
useAsCollectionConditionboolean
accessobject3 fields
constraintsUpdatesobject2 fields
capabilitiesobject5 fields
json
{
  "definition": {
    "key": "string",
    "ownerType": "API_PERMISSION",
    "namespace": "string",
    "name": "string",
    "description": "string",
    "validations": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "pin": false,
    "useAsCollectionCondition": false,
    "access": {
      "admin": "MERCHANT_READ",
      "storefront": "PUBLIC_READ",
      "customerAccount": "READ_WRITE"
    },
    "constraintsUpdates": {
      "key": "string",
      "values": [
        "string"
      ]
    },
    "capabilities": {
      "smartCollectionCondition": {
        "enabled": "string"
      },
      "adminFilterable": {
        "enabled": "string"
      },
      "uniqueValues": {
        "enabled": "string"
      },
      "analyticsQueryable": {
        "enabled": "string"
      },
      "cartToOrderCopyable": {
        "enabled": "string"
      }
    }
  }
}

Response

Read the result with {{metafielddefinitionupdate.response.data.data.metafieldDefinitionUpdate}}. If the API returns errors, the step fails and they are at {{metafielddefinitionupdate.response.data.errors}}.

updatedDefinitionobject
accessobject3 fields
capabilitiesobject5 fields
constraintsobject1 fields
descriptionstring
idstring
keystring
namestring
namespacestring
ownerTypestring

One ofAPI_PERMISSIONCOMPANYCOMPANY_LOCATIONPAYMENT_CUSTOMIZATIONVALIDATIONCUSTOMERDELIVERY_CUSTOMIZATIONDRAFTORDERGIFT_CARD_TRANSACTIONTRANSFERMARKETCARTTRANSFORMCOLLECTIONMEDIA_IMAGEPRODUCTPRODUCTVARIANTSELLING_PLANARTICLEBLOGPAGEFULFILLMENT_CONSTRAINT_RULEORDER_ROUTING_LOCATION_RULEDISCOUNTORDERLOCATIONSHOP

pinnedPositionnumber
standardTemplateobject9 fields
typeobject5 fields
useAsCollectionConditionboolean
validationStatusstring

One ofALL_VALIDIN_PROGRESSSOME_INVALID

validationsarray<object>
userErrorsarray<object>
codeobject
elementIndexobject
elementKeyobject
fieldobject
messageobject
validationJobobject
doneboolean
idstring
queryobject31 fields

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

metafieldDefinitionUpdate — Shopify — Documentation