How to get total number of products associated with collection using the Storefront API.

Shopify Partner
14 4 4

I understand that you can retrieve the number of products using the Admin API's collection.productsCount. However, I'd like to achieve the same using the Storefront API. Is there a way to do this? If anyone has any information, please kindly share your knowledge.

Reply 1 (1)

Shopify Partner
3 0 0

+1 for this, surely this is a basic requirement. At the moment I'd have to bypass all pagination and do a length check on products. The productsConnection should have a totalCount as described in the GraphQL docs ... but this is missing!