add GraphQL API to get products count

ecoworkhome
Shopify Partner
3 0 3

There is a RESTful API to get products count by query: 

https://shopify.dev/docs/api/admin-rest/2024-01/resources/product#get-products-count

 

We are using the API the preview the product count selected by customer, it is very useful.

Please consider to add the API in GraphQL API.

 

Thanks

Product Engineer
Replies 5 (5)

SBD_
Shopify Staff
1829 270 412

Thanks @ecoworkhome. Agreed, that would be handy. Passing along your feedback!

Scott | Developer Advocate @ Shopify 

HunkyBill
Shopify Expert
4851 60 555

I have been writing Apps since the first API was released, and I still use this feature as part of my logic. I need to know how many products are in a store before I do certain sync operations. Making a quick call to count() was great. Now that the brainiacs have decided that is too expensive, what are we left with? Does Shopify seriously expect me to do a bulk export of an entire store to get started, and then babysit each and every delete and create myself to keep that number current?

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
JoshHighland
Shopify Expert
212 12 75

Killing the REST api for products and not having a simple count is crazy. I depend on it and I'm guessing a ton of other apps do also!

SEO Manager - The FREE all-in-One SEO solution for Shopify
A powerful suite of SEO tools that gets you found in Google results

- Install SEO Manager -
HunkyBill
Shopify Expert
4851 60 555

I figured it out. There is a new GQL endpoint in 2024-04 that works as a substitute. It is accurate up to 10000 and after that you have to deal with the concept that there are more than 10000. 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Tester5
Shopify Partner
7 0 1

Hello Hunky Bill,

But how to manage for a store which contains more than 10,000 products then how can we get total products count via graphql API as now REST API > count.json is deprecated.

Can you please guide us ASAP?