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

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

## MetafieldConnection arguments

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

* after

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

  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.

***

## Possible returns

* edges

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

  non-null

  A list of edges.

* nodes

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

  non-null

  A list of nodes.

* page​Info

  [Page​Info!](https://shopify.dev/docs/api/shop-users/latest/objects/PageInfo)

  non-null

  Information to aid in pagination.

***

## Examples

* ### metafields reference