How to query another metaobject inside a metaobject?

Willd99
Shopify Partner
6 0 0

I have 2 metaobjects, call meta1 and meta2 for example. The meta1 object will contain a list/array of meta2 object, and meta2 object will have some fields such as title, images, ...

 

I'm retrieving the meta1 object using this graphql query:

 

 

 

 

  query getHomeSlider($handle: String!) {
    metaobject(handle: { handle: $handle, type: "slider" }) {
      handle
      id
      type
      fields {
        key
        value
      }
    }
  }

 

 

 

 

and inside the response i got this array that contain the id of all the meta2 objects that are added to the meta1 object.

 

 

 

 

fields: [
  {
  key: 'slider_items',
  value: '["gid://shopify/Metaobject/30423908585", ...]'
} , ...
]

 

 

 

 

 

So my question is, is there any way to include the meta2 object field in the response? (instead of array of id, i want an array of object with all the fields of meta2 object)

Replies 0 (0)