younifyd
Menu

standardMetafieldDefinitionEnable

Activates the specified standard metafield definition from its template. Refer to the list of standard metafield definition templates.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the standardMetafieldDefinitionEnable action (under Standard).
  3. Fill in the fields below, then reference the result from later steps as {{standardmetafielddefinitionenable.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 StandardMetafieldDefinitionEnable($ownerType: MetafieldOwnerType!, $id: ID, $namespace: String, $key: String, $pin: Boolean, $visibleToStorefrontApi: Boolean, $useAsCollectionCondition: Boolean, $capabilities: MetafieldCapabilityCreateInput, $access: StandardMetafieldDefinitionAccessInput) {
  standardMetafieldDefinitionEnable(
    ownerType: $ownerType
    id: $id
    namespace: $namespace
    key: $key
    pin: $pin
    visibleToStorefrontApi: $visibleToStorefrontApi
    useAsCollectionCondition: $useAsCollectionCondition
    capabilities: $capabilities
    access: $access
  ) {
    createdDefinition {
      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
      field
      message
    }
  }
}

Variables

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

ownerTypestringrequired

The resource type that the metafield definition is scoped to.

One ofAPI_PERMISSIONCOMPANYCOMPANY_LOCATIONPAYMENT_CUSTOMIZATIONVALIDATIONCUSTOMERDELIVERY_CUSTOMIZATIONDRAFTORDERGIFT_CARD_TRANSACTIONTRANSFERMARKETCARTTRANSFORMCOLLECTIONMEDIA_IMAGEPRODUCTPRODUCTVARIANTSELLING_PLANARTICLEBLOGPAGEFULFILLMENT_CONSTRAINT_RULEORDER_ROUTING_LOCATION_RULEDISCOUNTORDERLOCATIONSHOP

idstring

The ID of the standard metafield definition template to enable.

namespacestring

The namespace of the standard metafield to enable. Used in combination with `key`.

keystring

The key of the standard metafield to enable. Used in combination with `namespace`.

pinboolean

Whether to pin the metafield definition.

visibleToStorefrontApiboolean

Whether metafields for the definition are visible using the Storefront API.

useAsCollectionConditionboolean

Whether the metafield definition can be used as a collection condition. Defaults to false.

capabilitiesobject

The capabilities of the metafield definition.

smartCollectionConditionobject1 fields
adminFilterableobject1 fields
uniqueValuesobject1 fields
analyticsQueryableobject1 fields
cartToOrderCopyableobject1 fields
accessobject

The access settings that apply to each of the metafields that belong to the metafield definition.

adminstring

One ofMERCHANT_READMERCHANT_READ_WRITE

storefrontstring

One ofPUBLIC_READNONE

customerAccountstring

One ofREAD_WRITEREADNONE

json
{
  "ownerType": "API_PERMISSION",
  "id": "string",
  "namespace": "string",
  "key": "string",
  "pin": false,
  "visibleToStorefrontApi": false,
  "useAsCollectionCondition": false,
  "capabilities": {
    "smartCollectionCondition": {
      "enabled": false
    },
    "adminFilterable": {
      "enabled": false
    },
    "uniqueValues": {
      "enabled": false
    },
    "analyticsQueryable": {
      "enabled": false
    },
    "cartToOrderCopyable": {
      "enabled": false
    }
  },
  "access": {
    "admin": "MERCHANT_READ",
    "storefront": "PUBLIC_READ",
    "customerAccount": "READ_WRITE"
  }
}

Response

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

createdDefinitionobject
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
fieldobject
messageobject

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

standardMetafieldDefinitionEnable — Shopify — Documentation