Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: What is the Graphql query to get the equivalent of product_listings/count?

Solved

What is the Graphql query to get the equivalent of product_listings/count?

bovojon
Shopify Partner
24 0 1

Hi all, 

 

I noticed in the docs that to get the product listings count, we need to use the rest client to make a call to `product_listings/count` endpoint.

 

However, I am using graphQL and was wondering what is the equivalent graphql query for this operation?

 

Thank you!

 

Jon

Accepted Solution (1)
SBD_
Shopify Staff
1831 273 423

This is an accepted solution.

For now, yes. I've raised this issue internally.

Scott | Developer Advocate @ Shopify 

View solution in original post

Replies 6 (6)

SBD_
Shopify Staff
1831 273 423

Hey @bovojon 

 

Unfortunately there's no total count field in the GraphQL API.

Scott | Developer Advocate @ Shopify 

bovojon
Shopify Partner
24 0 1

Hi @SBD_, thank you. So I have no other choice but to create a Rest client and get this detail through it?

SBD_
Shopify Staff
1831 273 423

This is an accepted solution.

For now, yes. I've raised this issue internally.

Scott | Developer Advocate @ Shopify 

bovojon
Shopify Partner
24 0 1

Thank you so much, @SBD_ 🙏🏻

JoshHighland
Shopify Partner
214 12 78

With the latest deprecation of the REST products api, what is the suggested migration solution for getting the product count? 

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

- Install SEO Manager -
ShopifyDevSup
Shopify Staff
1453 239 534

Hi @JoshHighland,
 

I've provided a solution to retrieve the product count via GraphQL in the other thread you posted in, but I will link it here as well in case anyone else is following along in this thread and would like a solution to retrieve the product count via the GraphQL Admin API as well.
 

I hope this helps, and I hope you have a great day 🙂

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog