App reviews, troubleshooting, and recommendations
Hi, I have categories & subcategories in my shop like this structure :
categories : [ basics : [tops, bottom] accessories : [rings, eyewear] ]
I've created Metaobject as mixed references which has value like this :
categories : ["gid://shopify/Metaobject/1191280939", "gid://shopify/Metaobject/1259372843"]
I need to fetch the values from each category item from Admin GraphQL
this query returns undefined. can help me with the correct query?
query: `{
node(id: "${id}") { /* gid://shopify/Metaobject/1191280939 */
... on Metaobjects {
id
key
value
}
}
}`
Hi @vanio,
You can get metaobject values not by metaobject GID, instead you can try with categories as you have categories and sub-categories.
I have query with collections and collection by id. Do run this query you will get all metaobjects and data.
query Collection_Metaobject {
collections(first: 10) {
nodes {
metafields(first: 5) {
nodes {
id
value
}
}
}
}
collection(id: "gid://shopify/Collection/437261140263") {
id
handle
metafields(first: 10) {
nodes {
references(first: 5) {
nodes {
... on Metaobject {
id
}
}
}
}
}
}
}
I hope this might be helpful, please let me know if any changes needed, definitely will find out the solution.
Thanks...
hello @oscprofessional , thanks for this solution. but finally, I found a simpler way.
I've changed the query like this and got the result as I expected
{
metaobject(id:"${gid}") {
id
fields{
key
value
}
}
}
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025