younifyd
Menu

metaobjects

Returns a paginated list of Metaobject entries for a specific type. Metaobjects are custom data structures that extend Shopify's data model with merchant-defined or app-defined content like size charts, product…

Use it in a workflow

  1. Add a step and choose the Shopify Storefront connector.
  2. Pick the metaobjects action (under Metaobjects).
  3. Fill in the fields below, then reference the result from later steps as {{metaobjects.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query Metaobjects($type: String!, $sortKey: String, $first: Int, $after: String, $last: Int, $before: String, $reverse: Boolean) {
  metaobjects(
    type: $type
    sortKey: $sortKey
    first: $first
    after: $after
    last: $last
    before: $before
    reverse: $reverse
  ) {
    edges {
      cursor
      node {
        fields
        handle
        id
        onlineStoreUrl
        seo
        type
        updatedAt
      }
    }
    nodes {
      fields {
        key
        reference
        type
        value
      }
      handle
      id
      onlineStoreUrl
      seo {
        description
        title
      }
      type
      updatedAt
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

typestringrequired

The type of metaobject to retrieve.

sortKeystring

The key of a field to sort with. Supports "id" and "updated_at".

firstnumber

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

afterstring

Returns the elements that come after the specified cursor.

lastnumber

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

beforestring

Returns the elements that come before the specified cursor.

reverseboolean

Reverse the order of the underlying list.

json
{
  "type": "string",
  "sortKey": "string",
  "first": 0,
  "after": "string",
  "last": 0,
  "before": "string",
  "reverse": false
}

Response

Read the result with {{metaobjects.response.data.data.metaobjects}}. If the API returns errors, the step fails and they are at {{metaobjects.response.data.errors}}.

edgesarray<object>
cursorobject
nodeobject
nodesarray<object>
fieldsobject
handleobject
idobject
onlineStoreUrlobject
seoobject
typeobject
updatedAtobject
pageInfoobject
endCursorstring
hasNextPageboolean
hasPreviousPageboolean
startCursorstring

Need more? See the Shopify Storefront guide for connection setup and behaviour shared by every action.

Was this page helpful?