Skip to main content
Log inSign up

Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our privacy policy and our cookie policy.

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

•

The access settings associated with the metafield definition.

•

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.

•

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.

•

The resource type that the metafield definition is attached to.

•

The position of the metafield definition in the pinned list.

•

The standard metafield definition template associated with the metafield definition.

•

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.

•

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.

•

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

Anchor to visibleToStorefrontApivisibleToStorefrontApi
•
Boolean!non-nullDeprecated

Whether each of the metafields that belong to the metafield definition are visible from the Storefront API. Use access.storefront instead.


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.

•
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.

•
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.

•
mutation

Updates a metafield definition.

•
mutation

Activates the specified standard metafield definition from its template.

Refer to the list of standard metafield definition templates.


Was this section helpful?

•
interface

Was this section helpful?