---
title: Metafield - Shop Users API
description: Metafields enable you to attach additional information to a Shop domain resource, such as a User.
api_version: unstable latest
source_url:
  html: https://shopify.dev/docs/api/shop-users/latest/objects/Metafield
  md: https://shopify.dev/docs/api/shop-users/latest/objects/Metafield.md
---

# Metafield

object

Metafields enable you to attach additional information to a Shop domain resource, such as a User.

## Fields

* definition

  [Metafield​Definition!](https://shopify.dev/docs/api/shop-users/latest/objects/MetafieldDefinition)

  non-null

  The metafield definition that the metafield belongs to.

* owner​Id

  [String!](https://shopify.dev/docs/api/shop-users/latest/scalars/String)

  non-null

  The GID of resource that this metafield belongs to.

* owner​Type

  [Custom​Data​Owner​Type!](https://shopify.dev/docs/api/shop-users/latest/enums/CustomDataOwnerType)

  non-null

  The type of resource that this metafield belongs to.

* value

  [String!](https://shopify.dev/docs/api/shop-users/latest/scalars/String)

  non-null

  The data stored in the metafield. Always stored as a string, regardless of the metafield's type.

***

## Map

### Fields and connections with this object

* [MetafieldConnection.nodes](https://shopify.dev/docs/api/shop-users/latest/connections/MetafieldConnection#returns-nodes)
* [MetafieldEdge.node](https://shopify.dev/docs/api/shop-users/latest/objects/MetafieldEdge#field-MetafieldEdge.fields.node)

***

## Queries

* [metafield](https://shopify.dev/docs/api/shop-users/latest/queries/metafield)

  query

  Retrieve a Metafield by their Definition's Key or Namspace and Key. Leave blank to retreive all metafields on the user that your client has access to.

  * identifier

    [Custom​Data​Key​Pair​Input!](https://shopify.dev/docs/api/shop-users/latest/input-objects/CustomDataKeyPairInput)

    required

    ### Arguments

    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.

  ***

* [metafields](https://shopify.dev/docs/api/shop-users/latest/queries/metafields)

  query

  Retrieve Metafields by their Definition's Key or Namspace and Key. Leave blank to retreive all metafields on the user that your client has access to.

  * after

    [String](https://shopify.dev/docs/api/shop-users/latest/scalars/String)

    ### Arguments

    Returns the elements that come after the specified cursor.

  * before

    [String](https://shopify.dev/docs/api/shop-users/latest/scalars/String)

    Returns the elements that come before the specified cursor.

  * first

    [Int](https://shopify.dev/docs/api/shop-users/latest/scalars/Int)

    Returns up to the first `n` elements from the list.

  * identifiers

    [\[Custom​Data​Key​Pair​Input!\]](https://shopify.dev/docs/api/shop-users/latest/input-objects/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 on the user.

  * last

    [Int](https://shopify.dev/docs/api/shop-users/latest/scalars/Int)

    Returns up to the last `n` elements from the list.

  * reverse

    [Boolean](https://shopify.dev/docs/api/shop-users/latest/scalars/Boolean)

    Reverse the order of the underlying list.

  * sort​Key

    [Metafield​Permissible​Sort​Keys](https://shopify.dev/docs/api/shop-users/latest/enums/MetafieldPermissibleSortKeys)

    Default:KEY

    Sort the underlying listing by the given key.

  ***

***

## Metafield Queries

### Queried by

* [metafield](https://shopify.dev/docs/api/shop-users/latest/queries/metafield)
* [metafields](https://shopify.dev/docs/api/shop-users/latest/queries/metafields)

***

## Mutations

* [metafield​Delete](https://shopify.dev/docs/api/shop-users/latest/mutations/metafieldDelete)

  mutation

  Remove a Metafield corresponding to a definition from a user.

  * identifier

    [Custom​Data​Key​Pair​Input!](https://shopify.dev/docs/api/shop-users/latest/input-objects/CustomDataKeyPairInput)

    required

    ### Arguments

    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

  ***

* [metafields​Set](https://shopify.dev/docs/api/shop-users/latest/mutations/metafieldsSet)

  mutation

  Set or Update a Metafield on a resource.

  * metafields

    [\[Metafield​Set​Input!\]!](https://shopify.dev/docs/api/shop-users/latest/input-objects/MetafieldSetInput)

    required

    ### Arguments

  ***

***

## Metafield Mutations

### Mutated by

* [metafield​Delete](https://shopify.dev/docs/api/shop-users/latest/mutations/metafieldDelete)
* [metafields​Set](https://shopify.dev/docs/api/shop-users/latest/mutations/metafieldsSet)