---
title: metafield - Shop Users API
description: |-
  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.
api_version: unstable latest
source_url:
  html: https://shopify.dev/docs/api/shop-users/latest/queries/metafield
  md: https://shopify.dev/docs/api/shop-users/latest/queries/metafield.md
---

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

## Arguments

* identifier

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

***

## Possible returns

* Metafield

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

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

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

***

## Examples

* ### metafield reference