You can't get all products with a single GraphQL request either with the StoreFront GraphQL or the Admin GraphQL.

If your products are below 250 you can make a request with first: 250 but if you have more than 250 products than you need to make recursive request with the cursor pagination for GraphQL. So if you have 1000 products you will need to make 4 request (depending on which API you are using, the storefront or admin graphql api, since they are different)

At the moment there is no way to get all products using a single request via any of the provided APIs from Shopify.

The only way to achieve this is to make a custom template with the following code:

[
{% paginate collection.products by 9999 %}
  {% for product in collection.products %}
    {{product | json}}{% unless forloop.last %},{% endunless %}
  {% endfor %}
{% endpagination %}
]

Call it something like collection.ajax.liquid.

And make a fetch request to it using the view param:

fetch('/collections/all?view=ajax').then((response) => handle the response)

Have in mind that the more products you have the longer the request to that page will be. If you have 1000 products the request can take up to 10 seconds. So this is not a great solution as well for massive pool of products.


As for the total count there is a liquid object for that {{ collection.all_products_count }} or if you are doing admin stuff, use the rest api, since there is a method to get the products count, but there is none in the graphql.

Answer from drip on Stack Overflow
🌐
Shopify Community
community.shopify.com › retired boards › appdev › graphql basics and troubleshooting
How to get single product with GraphQL Admin API
December 2, 2020 - I’m quite new to Shopify and GraphQL but I have some coding experience at hand.. I’m trying to fetch single product with Admin API but it is whining about “Variable $id of type ID! was provided invalid value”. What I’m trying to do is as follows: query GetProductsById($id: ID!)
Discussions

GraphQL, Shopify Get All products or totalcount of products - Stack Overflow
So if you have 1000 products you will need to make 4 request (depending on which API you are using, the storefront or admin graphql api, since they are different) At the moment there is no way to get all products using a single request via any of the provided APIs from Shopify. More on stackoverflow.com
🌐 stackoverflow.com
Graphql API - Get all ACTIVE and PUBLISHED Products by Collection Id
Hi, I need to get all active and published products by collection id. I know I can get all Active and published products by doing this: { products (first:50, query:"status:active AND published_status:published") { … More on community.shopify.com
🌐 community.shopify.com
2
April 7, 2023
How do you get a Product's Category using the GraphQL or Rest API?
I can get the Product Type using the GraphQL API from Product.productType, but I can’t find any documentation on how to get the Product Category. Could someone guide me in the right direction? Thanks! More on community.shopify.com
🌐 community.shopify.com
1
0
September 2, 2022
How to manage product variants with GraphQL API when productCreate mutation create default variant
I am developing a system using the latest shopify version 2024-04 to automate product and variant creation using Shopify’s GraphQL API. My workflow involves using the productCreate mutation followed by productVariantsBulkCreate. However, I’m encountering challenges with handling the default ... More on community.shopify.com
🌐 community.shopify.com
3
April 29, 2024
🌐
Shopify Community
community.shopify.com › retired boards › appdev › new graphql product apis
New Product APIs FAQs - New Graphql Product Apis
September 27, 2023 - When did the new GraphQL product APIs go into stable release? The new GraphQL product APIs went into stable release in April 2024 as part of the 2024-04 release. Are the existing GraphQL and REST API product APIs deprecated?
🌐
Shopify Community
community.shopify.com › c › new-graphql-product-apis › bd-p › new-graphql-product-apis
New GraphQL Product APIs
June 19, 2024 - Shopify Community · Appdev New Graphql Product Apis · next page → · Powered by Discourse, best viewed with JavaScript enabled
Top answer
1 of 3
6

You can't get all products with a single GraphQL request either with the StoreFront GraphQL or the Admin GraphQL.

If your products are below 250 you can make a request with first: 250 but if you have more than 250 products than you need to make recursive request with the cursor pagination for GraphQL. So if you have 1000 products you will need to make 4 request (depending on which API you are using, the storefront or admin graphql api, since they are different)

At the moment there is no way to get all products using a single request via any of the provided APIs from Shopify.

The only way to achieve this is to make a custom template with the following code:

[
{% paginate collection.products by 9999 %}
  {% for product in collection.products %}
    {{product | json}}{% unless forloop.last %},{% endunless %}
  {% endfor %}
{% endpagination %}
]

Call it something like collection.ajax.liquid.

And make a fetch request to it using the view param:

fetch('/collections/all?view=ajax').then((response) => handle the response)

Have in mind that the more products you have the longer the request to that page will be. If you have 1000 products the request can take up to 10 seconds. So this is not a great solution as well for massive pool of products.


As for the total count there is a liquid object for that {{ collection.all_products_count }} or if you are doing admin stuff, use the rest api, since there is a method to get the products count, but there is none in the graphql.

2 of 3
2

You can get all products using BULK API with conjunction to GRAPHQL

🌐
Shopify Community
community.shopify.com › retired boards › appdev › graphql basics and troubleshooting
Graphql API - Get all ACTIVE and PUBLISHED Products by ...
April 7, 2023 - Hi, I need to get all active and published products by collection id. I know I can get all Active and published products by doing this: { products (first:50, query:"status:active AND published_status:published") { nodes { id, title, } } } And I know I can get all products by collection id by doing this: query ProductsByCollection ($id: ID!)
🌐
DEV Community
dev.to › rajeshkumaryadavdotcom › shopify-graphql-fetch-product-3j1m
Fetching Products from Shopify using Node.js and GraphQL - DEV Community
December 11, 2023 - Shopify provides a powerful GraphQL API that allows developers to interact with their store data. In this tutorial, we'll walk through the steps to fetch products from a Shopify store using Node.js and GraphQL.
Find elsewhere
🌐
Shopify
shopify.dev › docs › api › admin-graphql › latest › objects › Product
Product - GraphQL Admin
The `Product` object lets you manage products in a merchant’s store. Products are the goods and services that merchants offer to customers. They can include various details such as title, description, price, images, and options such as size or color. You can use [product variants](https://shopify.dev/docs/api/admin-graphql/latest/objects/productvariant) to create or update different versions of the same product.
🌐
Shopify
shopify.dev › docs › apps › build › graphql › migrate › new-product-model
Using the latest GraphQL product APIs
All apps and integrations should be built with the GraphQL Admin API. For details and migration steps, visit our migration guide. Shopify has updated the GraphQL product APIs to support raising the variant and option limits for all merchants ...
🌐
Shopify Community
community.shopify.com › technical q&a
How to manage product variants with GraphQL API when ...
April 29, 2024 - I am developing a system using the latest shopify version 2024-04 to automate product and variant creation using Shopify’s GraphQL API. My workflow involves using the productCreate mutation followed by productVariantsBul…
🌐
Shopify Community
community.shopify.com › retired boards › appdev › merchandising
Publish products via GraphQL Admin API
February 17, 2019 - Hi there, I am having trouble to publish/unpublish product via GraphQL. Per this doc: https://help.shopify.com/en/api/graphql-admin-api/reference/mutation/productupdate published (Boolean) This argument is deprecate…
🌐
Shopify
shopify.dev › docs › api › admin-graphql
GraphQL Admin API reference
The Admin API lets you build apps and integrations that extend and enhance the Shopify admin. This page will help you get up and running with Shopify’s GraphQL API.
🌐
Shopify
shopify.com › ca › partners › blog › all-in-on-graphql
All-in on GraphQL: the future of app development at Shopify (2024) - Shopify Canada
October 1, 2024 - As of today, GraphQL is a true superset of the REST API: use cases that once could only be accomplished in REST can now be achieved with GraphQL. Moreover, GraphQL offers exclusive features, such as support for 2,000 product variants and advanced capabilities such as Metaobjects.
🌐
Shopify
shopify.dev › docs › api › admin-graphql › 2024-10 › queries › products
products - GraphQL Admin
query GetProducts { products(first: 10) { nodes { id title } } } curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query GetProducts { products(first: 10) { nodes { id title } } }" }'
🌐
Shopify
shopify.dev › docs › storefronts › headless › building-with-the-storefront-api › products-collections › getting-started
Getting started with querying products and collections
The Storefront API lets you build custom storefronts with any language and technology. It provides public access using GraphQL to products, collections, customers, carts, checkouts, and other store resources that you can use to build custom ...
🌐
Shopify
shopify.dev › docs › api › admin-graphql › 2025-01 › mutations › productCreate
productCreate - GraphQL Admin
mutation { productCreate(product: {title: "Cool socks", productOptions: [{name: "Color", values: [{name: "Red"}, {name: "Blue"}]}, {name: "Size", values: [{name: "Small"}, {name: "Large"}]}]}) { product { id title options { id name position optionValues { id name hasVariants } } } userErrors { field message } } } curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "mutation { productCreate(product: {title: \"Cool socks\", productOptions: [{name: \"Color\", values: [{name: \"Red\"}, {name: \"Blue\"}]}, {name: \"Size\", values: [{name: \"Small\"}, {name: \"Large\"}]}]}) { product { id title options { id name position optionValues { id name hasVariants } } } userErrors { field message } } }" }'