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
}
}
}
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023