Skip to main content
object

Metafield definitions enable you to define additional validation constraints for metafields, and enable the merchant to edit metafield values in context.

Anchor to Fields and connectionsFields and connections

•MetafieldAccess!non-null

The access settings associated with the metafield definition.

•MetafieldCapabilities!non-null

The capabilities of the metafield definition.

•MetafieldDefinitionConstraints

The constraints that determine what subtypes of resources a metafield definition applies to.

•String

The description of the metafield definition.

•ID!non-null

A globally-unique ID.

•String!non-null

The unique identifier for the metafield definition within its namespace.

•MetafieldConnection!non-null

The metafields that belong to the metafield definition.

•Int!non-null

The count of the metafields that belong to the metafield definition.

•String!non-null

The human-readable name of the metafield definition.

•String!non-null

The container for a group of metafields that the metafield definition is associated with.

•MetafieldOwnerType!non-null

The resource type that the metafield definition is attached to.

•Int

The position of the metafield definition in the pinned list.

•StandardMetafieldDefinitionTemplate

The standard metafield definition template associated with the metafield definition.

•MetafieldDefinitionType!non-null

The type of data that each of the metafields that belong to the metafield definition will store. Refer to the list of supported types.

Anchor to useAsCollectionConditionuseAsCollectionCondition
•Boolean!non-null

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

•[MetafieldDefinitionValidation!]!non-null

A list of validation options for the metafields that belong to the metafield definition. For example, for a metafield definition with the type date, you can set a minimum date validation so that each of the metafields that belong to it can only store dates after the specified minimum.

•MetafieldDefinitionValidationStatus!non-null

The validation status for the metafields that belong to the metafield definition.


Was this section helpful?

•query

Returns a metafield definition by identifier.

•query

Returns a list of metafield definitions.


Was this section helpful?

•mutation

Creates a metafield definition. Any metafields existing under the same owner type, namespace, and key will be checked against this definition and will have their type updated accordingly. For metafields that are not valid, they will remain unchanged but any attempts to update them must align with this definition.

Arguments

•MetafieldDefinitionInput!required

Specifies the input fields for a metafield definition.


Fields

•MetafieldDefinition

The metafield definition that was created.

•[MetafieldDefinitionCreateUserError!]!non-null

The list of errors that occurred from executing the mutation.

•mutation

You can organize your metafields in your Shopify admin by pinning/unpinning metafield definitions. The order of your pinned metafield definitions determines the order in which your metafields are displayed on the corresponding pages in your Shopify admin. By default, only pinned metafields are automatically displayed.

Arguments

•ID!required

The ID of the metafield definition to pin.


Fields

•MetafieldDefinition

The metafield definition that was pinned.

•[MetafieldDefinitionPinUserError!]!non-null

The list of errors that occurred from executing the mutation.

•mutation

You can organize your metafields in your Shopify admin by pinning/unpinning metafield definitions. The order of your pinned metafield definitions determines the order in which your metafields are displayed on the corresponding pages in your Shopify admin. By default, only pinned metafields are automatically displayed.

Arguments

•ID!required

The ID of the metafield definition to unpin.


Fields

•MetafieldDefinition

The metafield definition that was unpinned.

•[MetafieldDefinitionUnpinUserError!]!non-null

The list of errors that occurred from executing the mutation.

•mutation

Updates a metafield definition.

Arguments

•MetafieldDefinitionUpdateInput!required

The input fields for the metafield definition update.


Fields

•MetafieldDefinition

The metafield definition that was updated.

•[MetafieldDefinitionUpdateUserError!]!non-null

The list of errors that occurred from executing the mutation.

•Job

The asynchronous job updating the metafield definition's validation_status.

•mutation

Activates the specified standard metafield definition from its template.

Refer to the list of standard metafield definition templates.

Arguments

•StandardMetafieldDefinitionAccessInput

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

•MetafieldCapabilityCreateInput

The capabilities of the metafield definition.

•ID

The ID of the standard metafield definition template to enable.

•String

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

•String

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

•MetafieldOwnerType!required

The resource type that the metafield definition is scoped to.

•Boolean!requiredDefault:false

Whether to pin the metafield definition.

Anchor to useAsCollectionConditionuseAsCollectionCondition
•BooleanDeprecatedDefault:false
Anchor to visibleToStorefrontApivisibleToStorefrontApi
•BooleanDeprecatedDefault:null

Fields

•MetafieldDefinition

The metafield definition that was created.

•[StandardMetafieldDefinitionEnableUserError!]!non-null

The list of errors that occurred from executing the mutation.


Was this section helpful?

•interface

Was this section helpful?
OSZAR »