Fetch total search hits from GraphQL Admin API

RahulM810
New Member
1 0 0

Hi, 

Is there a way to fetch total count of search results matching a given query for products using the GraphQL admin API ?
We have a use case where we want to fetch the count of all products with inventory=0. The search query for this would be `query= inventory_total:0`.

One way is to fire multiple pagination queries until we get all products but that would be really slow and costly for stores with thousands of products. 

I haven't found a way to do this using the REST API either. 

Thanks in Advance for helping! 

 

0 Likes