Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am building a website with Shopify Hydrogen.
Using GraphQL I am accessing MetaObjects.
The structure of the MetaObject is one field and one sub-MetaObject field (a generic, reusable meta object).
I wish to write a query that gives me the fields from the MetaObject (working) and the Sub-MetaObject (not working - only giving an id).
My query looks like this...
query { metaobject( handle: { handle: "template-home", type: "header_template", } ) { handle, type page_url: field(key: "page-url") { value }, header_info: field(key: "header_info") { value }, } }
..and that gets half the job done but doesn't let me see the sub-metaobject and the result is...
{ "data": { "metaobject": { "handle": "template-home", "type": "header_template", "page_url": { "value": "/" }, "header_info": { "value": "gid://shopify/Metaobject/1234567890" } } } }
I don't want the key/id to the Metaobject returned, I want the fields/data from the meta object as a sub-result (or even flattened in the parent would be fine too).
How do I write another sub-query to expose all the fields within this sub-meta object so I can run one command.
If not possible, how do I best avoid multiple server calls to Shopify in Remix?
Thanks,
Dan.
query {
metaobjects(type: "slider" first: 5){
edges{
node{
id
fields{
key
type
value
}
}
}
}
}
query {
metaobjects(type: "tetx" first: 5){
edges{
node{
id
fields{
key
type
value
}
}
}
}
}
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025