Ecommerce Shopify WordPress Discussion

Shopify Graphql – Getting all products metafields

I am trying to implement a custom storefront using nextJS and shopify APIs. One of the features I need to implement is a custom catalog filtering system which I want to handle using metafields. So basically I do want to fetch ALL products metafields using the GraphQL Shopify Admin API in the most efficient way. I do understand that shopify is telling me that this query is too extensive for it to be handled but I thought it was a fairly simple query. I'm trying to find alternative solutions that wouldn't involve querying all products one by one. Any ideas? Heres what I did: To start tackling this task, i'm struggling to understand why can't I fetch all my products metafields using this ADMIN api query: query GetProductsMetafields { products(first: 50) { nodes { id metafields(first: 50) { nodes { id key value namespace } } } } } The response given is the following: { "errors": [ { "message": "Query cost is 2702, which exceeds the single query max cost limit (1000).\n\nSee for more information on how the\ncost of a query is calculated.\n\nTo query larger amounts of data with fewer limits, bulk operations should be used instead.\nSee for usage details.\n", "extensions": { "code": "MAX_COST_EXCEEDED", "cost": 2702, "maxCost": 1000, "documentation": "" } } ] } theres a bit more info in the documentation but it doesn't show how to fetch all products metafields.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.