Metafield Definition
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.
Anchor to FieldsFields
- access (CustomDataAccessType)
- description (String)
- key (String!)
- name (String)
- namespace (String)
- type (MetafieldDefinitionType!)
- uuid (ID!)
- validations ([CustomDataMetafieldDefinitionValidationType!])
- Anchor to accessaccess•Custom
Data Access Type List of the active policies associated with this Definition. Policies represent ownership of the Definition and can be granted to Clients and Nampespaces.
- Anchor to descriptiondescription•String
Developer facing description.
- •String!non-null
Developer facing identifier for the resource.
- Anchor to namename•String
Developer facing display name.
- Anchor to namespacenamespace•String
Developer facing path to identifier for the resource.
- Anchor to typetype•Metafield
Definition Type! non-null One of the types available in the Metafield developer documentation (https://shopify.dev/docs/apps/custom-data/metafields/types), except JSON.
- Anchor to uuiduuid•ID!non-null
Internal identifier for the resource.
- Anchor to validationsvalidations•[Custom
Data Metafield Definition Validation Type!] A list of validation options for the metafields that belong to the metafield definition.
Anchor to QueriesQueries
- metafieldDefinition (MetafieldDefinition)
- metafieldDefinitions (MetafieldDefinitionConnection!)
- •query
Retrieve a single metafield definition by identifier
- Anchor to identifieridentifier•Custom
Data Key Pair Input! 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.
Arguments
- •query
List of metafield_definitions
- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to identifiersidentifiers•[Custom
Data Key Pair Input!] 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.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to reversereverse•Boolean
Reverse the order of the underlying list.
- Anchor to sortKeysort•Metafield
Key Permissible Sort Keys Default:KEY Sort the underlying listing by the given key.
Arguments
Anchor to MutationsMutations
- metafieldDefinitionCreate (MetafieldDefinitionCreatePayload)
- metafieldDefinitionDelete (MetafieldDefinitionDeletePayload)
- metafieldDefinitionUpdate (MetafieldDefinitionUpdatePayload)
- •mutation
Create a new MetafieldDefinition.
- Anchor to definitiondefinition•Metafield
Definition Create Input! required
Arguments
- •mutation
Remove a MetafieldDefinition and cascade delete all associated Metafields.
- Anchor to identifieridentifier•Custom
Data Key Pair Input! required This argument accepts an object that consists of a
keyand an optionalnamespace. Thekeyis a mandatory attribute that represents a specific element within a namespace. Thenamespaceattribute, 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 providednamespace, the system will default to the client's implicit, reserved namespace.
Arguments
- •mutation
Update a MetafieldDefinition by changing its key, name, description, capabilities, or access.
- Anchor to definitiondefinition•Metafield
Definition Update Input! required
Arguments