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
- Add a step and choose the Shopify connector.
- Pick the standardMetafieldDefinitionEnable action (under Standard).
- 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.
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.
{
"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}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?