MetafieldDefinition
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
- Anchor to accessaccess•Metafield
Access! non-null The access settings associated with the metafield definition.
- Anchor to descriptiondescription•
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.
- Anchor to metafieldsmetafields•Metafield
Connection! non-null The metafields that belong to the metafield definition.
- Anchor to metafieldsCountmetafields•
Count Int!non-null The count of the metafields that belong to the metafield definition.
- Anchor to namename•String!non-null
The human-readable name of the metafield definition.
- Anchor to namespacenamespace•String!non-null
The container for a group of metafields that the metafield definition is associated with.
- Anchor to ownerTypeowner•
Type MetafieldOwner non-nullType! The resource type that the metafield definition is attached to.
- Anchor to pinnedPositionpinned•
Position The position of the metafield definition in the pinned list.
- Anchor to standardTemplatestandard•
Template The standard metafield definition template associated with the metafield definition.
- Anchor to typetype•Metafield
Definition non-nullType! 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 useAsCollectionConditionuse•
As Collection Condition Boolean!non-null Whether the metafield definition can be used as a collection condition.
- Anchor to validationsvalidations•
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.- Anchor to validationStatusvalidation•
Status The validation status for the metafields that belong to the metafield definition.
- Anchor to visibleToStorefrontApivisible•
To Storefront Api Whether each of the metafields that belong to the metafield definition are visible from the Storefront API. Use
access.storefront
instead.
Map
Fields and connections with this object
Anchor to QueriesQueries
- •query
Returns a metafield definition by identifier.
- •query
Returns a list of metafield definitions.
MetafieldDefinition Queries
Queried by
Anchor to MutationsMutations
- •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.