Metafield
Metafields represent custom metadata attached to a resource. Metafields can be sorted into namespaces and are comprised of keys, values, and value types.
Anchor to FieldsFields
- createdAt (DateTime!)
- description (String)
- id (ID!)
- key (String!)
- namespace (String!)
- parentResource (MetafieldParentResource!)
- reference (MetafieldReference)
- references (MetafieldReferenceConnection)
- type (String!)
- updatedAt (DateTime!)
- value (String!)
- Anchor to createdAtcreated•Date
At Time! non-null Token access required The date and time when the storefront metafield was created.
- Anchor to descriptiondescription•StringToken access required
The description of a metafield.
- •ID!non-null Token access required
A globally-unique ID.
- •String!non-null Token access required
The unique identifier for the metafield within its namespace.
- Anchor to namespacenamespace•String!non-null Token access required
The container for a group of metafields that the metafield is associated with.
- Anchor to parentResourceparent•Metafield
Resource Parent Resource! non-null Token access required The type of resource that the metafield is attached to.
- Anchor to referencereference•Metafield
Reference Token access required Returns a reference object if the metafield's type is a resource reference.
- Anchor to referencesreferences•Metafield
Reference Connection Token access required A list of reference objects if the metafield's type is a resource reference list.
- Anchor to firstfirst•Int
Returns up to the first
nelements from the list.- Anchor to afterafter•String
Returns the elements that come after the specified cursor.
- Anchor to lastlast•Int
Returns up to the last
nelements from the list.- Anchor to beforebefore•String
Returns the elements that come before the specified cursor.
Arguments
- Anchor to typetype•String!non-null Token access required
The type name of the metafield. Refer to the list of supported types.
- Anchor to updatedAtupdated•Date
At Time! non-null Token access required The date and time when the metafield was last updated.
- Anchor to valuevalue•String!non-null Token access required
The data stored in the metafield. Always stored as a string, regardless of the metafield's type.
Anchor to MutationsMutations
- cartMetafieldsSet (CartMetafieldsSetPayload)
- •mutation
Sets cart metafield values. Cart metafield values will be set regardless if they were previously created or not.
Allows a maximum of 25 cart metafields to be set at a time.
Cart metafields will be copied to order metafields at order creation time if there is a matching order metafield definition with the
cart to order copyablecapability enabled.NoteThis mutation won't trigger Shopify Functions. The changes won't be available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
Note:This mutation won't trigger Shopify Functions. The changes won't be available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
Note: This mutation won't trigger <a href="https://shopify.dev/docs/api/functions">Shopify Functions</a>. The changes won't be available to Shopify Functions until the buyer goes to checkout or performs another cart interaction that triggers the functions.
- Anchor to metafieldsmetafields•[Cart
Metafields Set Input!]! required The list of Cart metafield values to set. Maximum of 25.
The input must not contain more than
250values.
Arguments