A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi there. I'm doing an API request to the product resource and including the metafields in the field param but they are not being returned. Metafields are included in the webhook data, so you would think they would be included in the API response.
ShopifyAPI::Product.find(:all, params: { limit: 250, fields: 'id, status, title, body_html, handle, vendor, options, images, tags, published_at, admin_graphql_api_id, variants, metafields' })
Does anyone know if they can be returned? Seems bad if they cant be.
Hey @jwilson114 - you should be able to return metafields attached to the Product Object in GraphQL using something like the query below:
{
products (first:10) {
edges {
node {
id
metafields (first:5) {
edges {
node {
id
namespace
}
}
}
}
}
}
}
Alan | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog