Skip to main content
query

Requires API client to have access to the resource type associated with the metafield definition.

Retrieves a MetafieldDefinition by its identifier. You can identify a definition using either its owner type, namespace, and key, or its global ID.

Use this query to inspect a definition's configuration, including its data type, validations, access settings, and the count of metafields using it.

•MetafieldDefinitionIdentifierInput

The identifier of the MetafieldDefinition to return.

•ID
Deprecated

Was this section helpful?

•MetafieldDefinition

Defines the structure, validation rules, and permissions for Metafield objects attached to a specific owner type. Each definition establishes a schema that metafields must follow, including the data type and validation constraints.

The definition controls access permissions across different APIs, determines whether the metafield can be used for filtering or as a collection condition, and can be constrained to specific resource subtypes.

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

Arguments

•MetafieldValidationStatus
Default:ANY

Returns the metafields filtered by the validation status.

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•Int!
non-null

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

Arguments

•MetafieldValidationStatus

The current validation status.


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