Skip to main content
object

A MetafieldDefinition is a Permissible type. It is managed by a Client and defines the shape of the data stored in in a Metafield. Control and access of a MetafieldDefinition is determined by AccessGrants that link the definition to Clients or Namespaces.

•CustomDataAccessType

List of the active policies associated with this Definition. Policies represent ownership of the Definition and can be granted to Clients and Nampespaces.

•String

Developer facing description.

•String!
non-null

Developer facing identifier for the resource.

•String

Developer facing display name.

•String

Developer facing path to identifier for the resource.

•MetafieldDefinitionType!
non-null

One of the types available in the Metafield developer documentation (https://shopify.dev/docs/apps/custom-data/metafields/types), except JSON.

•ID!
non-null

Internal identifier for the resource.

•[CustomDataMetafieldDefinitionValidationType!]

A list of validation options for the metafields that belong to the metafield definition.


Was this section helpful?

•query

Retrieve a single metafield definition by identifier

Arguments

•CustomDataKeyPairInput!
required

Key and namespace pair that together form the path to the definition. Key is required, Namespace defaults to the Client's implicit, reserved namespace if not provided. Leave blank to see everything available to the client.


•query

List of metafield_definitions

Arguments

•String

Returns the elements that come after the specified cursor.

•String

Returns the elements that come before the specified cursor.

•Int

Returns up to the first n elements from the list.

•[CustomDataKeyPairInput!]
Default:[]

Key and namespace pair that together form the path to the definition. Key is required, Namespace defaults to the Client's implicit, reserved namespace if not provided. Leave blank to see everything available to the client.

•Int

Returns up to the last n elements from the list.

•Boolean

Reverse the order of the underlying list.

•MetafieldPermissibleSortKeys
Default:KEY

Sort the underlying listing by the given key.



Was this section helpful?

•mutation

Create a new MetafieldDefinition.

Arguments

•MetafieldDefinitionCreateInput!
required

•mutation

Remove a MetafieldDefinition and cascade delete all associated Metafields.

Arguments

•CustomDataKeyPairInput!
required

This argument accepts an object that consists of a key and an optional namespace. The key is a mandatory attribute that represents a specific element within a namespace. The namespace attribute, if provided, should be a period-delimited string representing the hierarchical path to the desired definition. This is applicable in cases where the desired definition is nested within namespaces. In the absence of a provided namespace, the system will default to the client's implicit, reserved namespace.


•mutation

Update a MetafieldDefinition by changing its key, name, description, capabilities, or access.

Arguments

•MetafieldDefinitionUpdateInput!
required


Was this section helpful?


Was this section helpful?