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 or app-specific data types.

Use it in a workflow

  1. Add a step and choose the Shopify 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, $query: String) {
  metaobjects(
    type: $type
    sortKey: $sortKey
    first: $first
    after: $after
    last: $last
    before: $before
    reverse: $reverse
    query: $query
  ) {
    edges {
      cursor
      node {
        capabilities
        createdAt
        createdBy
        createdByApp
        createdByStaff
        definition
        displayName
        fields
        handle
        id
        staffMember
        thumbnailField
        type
        updatedAt
        values
      }
    }
    nodes {
      capabilities {
        onlineStore
        publishable
      }
      createdAt
      createdBy {
        apiKey
        appStoreAppUrl
        appStoreDeveloperUrl
        availableAccessScopes
        banner
        description
        developerName
        developerType
        developerUrl
        embedded
        failedRequirements
        features
        feedback
        handle
        icon
        id
        installUrl
        installation
        isPostPurchaseAppInUse
        launchUrl
        navigationItems
        optionalAccessScopes
        previouslyInstalled
        pricingDetails
        pricingDetailsSummary
        privacyPolicyUrl
        publicCategory
        published
        requestedAccessScopes
        screenshots
        shopifyDeveloped
        title
        uninstallMessage
        uninstallUrl
        webhookApiVersion
      }
      createdByApp {
        apiKey
        appStoreAppUrl
        appStoreDeveloperUrl
        availableAccessScopes
        banner
        description
        developerName
        developerType
        developerUrl
        embedded
        failedRequirements
        features
        feedback
        handle
        icon
        id
        installUrl
        installation
        isPostPurchaseAppInUse
        launchUrl
        navigationItems
        optionalAccessScopes
        previouslyInstalled
        pricingDetails
        pricingDetailsSummary
        privacyPolicyUrl
        publicCategory
        published
        requestedAccessScopes
        screenshots
        shopifyDeveloped
        title
        uninstallMessage
        uninstallUrl
        webhookApiVersion
      }
      createdByStaff {
        accountType
        active
        email
        exists
        firstName
        id
        initials
        isShopOwner
        lastName
        locale
        name
        phone
        privateData
      }
      definition {
        access
        capabilities
        createdAt
        createdByApp
        createdByStaff
        description
        displayNameKey
        fieldDefinitions
        hasThumbnailField
        id
        metaobjectsCount
        name
        standardTemplate
        type
        updatedAt
      }
      displayName
      fields {
        definition
        jsonValue
        key
        reference
        thumbnail
        type
        value
      }
      handle
      id
      staffMember {
        accountType
        active
        email
        exists
        firstName
        id
        initials
        isShopOwner
        lastName
        locale
        name
        phone
        privateData
      }
      thumbnailField {
        definition
        jsonValue
        key
        reference
        thumbnail
        type
        value
      }
      type
      updatedAt
      values
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}

Variables

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

typestringrequired

The type of the metaobjects to query.

sortKeystring

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

firstnumber

The first `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

afterstring

The elements that come after the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

lastnumber

The last `n` elements from the [paginated list](https://shopify.dev/api/usage/pagination-graphql).

beforestring

The elements that come before the specified [cursor](https://shopify.dev/api/usage/pagination-graphql).

reverseboolean

Reverse the order of the underlying list.

querystring

A filter made up of terms, connectives, modifiers, and comparators. | name | type | description | acceptable_values | default_value | example_use | | ---- | ---- | ---- | ---- | ---- | ---- | | display_name | string | | fields.{key} | mixed | Filters metaobject entries by field value. Format: `fields.{key}:{value}`. Only fields marked as filterable in the metaobject definition can be used. Learn more about [querying metaobjects by field value](https://shopify.dev/apps/build/custom-data/metafields/query-by-metafield-value). | | | - `fields.color:blue`<br/> - `fields.on_sale:true` | | handle | string | | id | id | Filter by `id` range. | | | - `id:1234`<br/> - `id:>=1234`<br/> - `id:<=1234` | | updated_at | time | You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax).

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

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>
capabilitiesobject
createdAtobject
createdByobject
createdByAppobject
createdByStaffobject
definitionobject
displayNameobject
fieldsobject
handleobject
idobject
staffMemberobject
thumbnailFieldobject
typeobject
updatedAtobject
valuesobject
pageInfoobject
endCursorstring
hasNextPageboolean
hasPreviousPageboolean
startCursorstring

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

Was this page helpful?