Documentation says that this query limited to 10000 products:
Not sure what’s suggested to do for larger stores. Loading all products just to get the count seems inefficient. And the REST API didn’t had this limitation, I just tried getting products count on store with 1.5M products and it worked fine.
I can’t help with this one, but we certainly had a lively and long thread all about this some time ago. The fun never stops does it! My favorite aspect is the resolution you just pointed out that was thrust upon us as the result a few months ago.
with precision, we can use GQL to get a count if the count is less than 10,000
any product with more than 10,000 we simply get an acknowledgement that this product has at least 10,000 and an unknown number more. Money in the bank baby!
And we cannot know this unknown number, because ???
It reminds me of the same problem Shopify has had for nearly 20 years now. No matter your store, whether you have 51 or 501 or 5000001 products in it, Shopify never shows you that number.
I think the only option, using GraphQL, is to query products and use pageInfos hasNextPage and endCursor to paginate the responses and accumulate the total amount.
Limit counting up to 10k items. Shopify, are you joking? It shameful to even have this kind of a limit. Now we need to run a binary partitioning of data on timestamp to get a real count? Making 10, 20, 30, 100 queries?
For now it’s best to use REST as it seems to work. GraphQL is not finished, please don’t remove REST!
We’re looking at options to increase the limit beyond 10K. One of the challenges is data cuts across multiple DBs + filter support.
Question: Do your use cases require exact counts with filters? Eliminating filters should make it easier to support much larger counts with EXACT precision (we would still support filters, just with less accuracy)
We are facing a similar issue where it’s crucial for us to obtain the exact total product count without any filters. Our app’s subscription plans are directly based on this value, so moving from REST API to the new approach is challenging if we can’t accurately determine this count. Currently, we’re using the REST API for this purpose, and this change impacts our core functionality.
How is obtaining exact overall counts supposed to work in the new API? Specifically, for products, and ideally also for metafields of a given entity?