I am working with app data metafields implementation, for now I was able to create app data metafields and use these metafields in Liquid… I just followed these documentation from Shopify…
However I am not sure how to retreive these app data metafields in my application using graphql… there is no examples on Shopify website… Can anyone please guide me to implement the graphql query?
Many thanks and have a nice Sunday!!
Hi @Elloumi ,
As you have not mentioned which metafield you want to retrieve. I am sharing you query to fetch all metafields(includes reference metafields) which will fetch all metafields assigned to product.
query ProductWithMetafields {
products(first: 10) {
edges {
node {
title
metafields(first: 20) {
nodes {
namespace
key
reference {
... on Product {
id
title
}
}
}
}
}
}
}
}
You can also retrieve metafield data for collections, customers and orders.
Please let me know if you are expecting something else.
Thanks…