Home > @infiniteobjects/shopify-data-manager > AdminTypes > MetafieldDefinition
Metafield definitions enable you to define additional validation constraints for metafields, and enable the merchant to edit metafield values in context.
Signature:
export interface MetafieldDefinition extends Node
Extends: Node
Property | Modifiers | Type | Description |
---|---|---|---|
access | MetafieldAccess | The access settings associated with the metafield definition. | |
description? | Maybe<Scalars[‘String’][‘output’]> | (Optional) The description of the metafield definition. | |
id | Scalars[‘ID’][‘output’] | A globally-unique ID. | |
key | Scalars[‘String’][‘output’] | The unique identifier for the metafield definition within its namespace. | |
metafields | MetafieldConnection | The metafields that belong to the metafield definition. | |
metafieldsCount | Scalars[‘Int’][‘output’] | The count of the metafields that belong to the metafield definition. | |
name | Scalars[‘String’][‘output’] | The human-readable name of the metafield definition. | |
namespace | Scalars[‘String’][‘output’] | The container for a group of metafields that the metafield definition is associated with. | |
ownerType | MetafieldOwnerType | `${MetafieldOwnerType}` | The resource type that the metafield definition is attached to. | |
pinnedPosition? | Maybe<Scalars[‘Int’][‘output’]> | (Optional) The position of the metafield definition in the pinned list. | |
standardTemplate? | Maybe<StandardMetafieldDefinitionTemplate> | (Optional) The standard metafield definition template associated with the metafield definition. | |
type | MetafieldDefinitionType | The type of data that each of the metafields that belong to the metafield definition will store. Refer to the list of [supported types](https://shopify.dev/apps/metafields/types). | |
useAsCollectionCondition | Scalars[‘Boolean’][‘output’] | Whether the metafield definition can be used as a collection condition. | |
validations | Array<MetafieldDefinitionValidation> | A list of [validation options](https://shopify.dev/apps/metafields/definitions/validation) 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. |
|
validationStatus | MetafieldDefinitionValidationStatus | `${MetafieldDefinitionValidationStatus}` | The validation status for the metafields that belong to the metafield definition. | |
visibleToStorefrontApi | Scalars[‘Boolean’][‘output’] | Whether each of the metafields that belong to the metafield definition are visible from the Storefront API. |