Hello Shopify Developers!
Welcome to the New GraphQL Product APIs board!
This board covers the new GraphQL product APIs that support up to 2,000 variants per product, that were launched in the 2024-04 stable API release, enabling developers to build support for larger and more complex catalogs.
Helpful Resources
You can find more resources to help you learn about Shopify App Bridge below :
Frequently Asked Questions
-
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?
Yes, the REST product APIs have been marked deprecated and the GraphQL fields were removed in 2024-04. -
How can I test 2000 variants?
To test 2000 variants, create a new development test store with the ‘Extend Variants’ developer preview enabled.
-
Am I required to make changes to my app/migrate to the new GraphQL product APIs?
If your app works with products and uses REST APIs or existing GraphQL product APIs to work with products, you will need to make changes to your app/migrate to the new GraphQL APIs -
Will the REST API ever support more than 100 variants or more than 3 options?
No. The REST API will not support more than 100 variants or more than 3 options. We are only building this support in GraphQL, the future of APIs at Shopify. -
I am seeing support for 2000 variants, but only 3 options on the test store in the Dev Preview. Is that expected?
Yes. The developer preview test stores are currently limited to 2K variants and 3 options. We expect to raise the option limit sometime in 2025. Please note that there will be no Admin API changes for supporting increased options, so your app should be able to benefit from increased options without any additional changes. -
I have used the new APIs in developer preview to set up a product with up to 2000 variants, however when I go into Shopify admin on my test store, I am not seeing more than 250 variants.
Some areas of Shopify admin (for example, the Products page) are limited to only showing 250 variants in the UI. We are updating Shopify admin throughout Q3 2024 to ensure support for up to 2000 variants. -
I am a theme developer / agency partner / Storefront API user. Do I need to make any changes to support an increased number of variants?
Yes, the latest version of Dawn and our dev docs on supporting high-variant products in themes can be used as a reference. We will be updating you with more information later this year. -
If we were to move our app from REST to GraphQL, we expect there to be throttling because of the query costs and rate limits. Will there be an increase in graphQL rate limits or query costs?
We have now raised the rate limits for standard shops from 50points/second to 100 points / second. We have also updated the query calculations for querying connections. With these changes, your app should be able to maintain the same or higher throughput as before when using REST.
To learn more about how to optimize your app for throughput, read more here
-
I have used the
productCreate
APIs to set up a product with options and optionValues. However I am not seeing any variants being created.
We have deprecated the variants field onproductCreate
. When you create a product with options and optionValues, it does not automatically create variants. You will need to use theproductVariantsBulkCreate
mutation to create these variants. To learn more about this workflow, refer to the documentation here. -
I have used the
productCreate
APIs to set up a product with options and optionValues. However I am not seeing any of these option values on Shopify Admin.
When you create a product with options and optionValues using productCreate mutation, it does not automatically create variants and associate the option values to them. While these optionValues exist and have their unique IDs, they are not associated with any variant. Shopify Admin does not show you any of these optionValues unless they are associated with a variant. To associate them with variants, use the productVariantBulkCreate mutation. To learn more about this workflow, refer to the documentation here. -
I have used the
productCreate
APIs to set up a product with options and optionValues. However I am not seeing any of these option values when queryingproduct.options.values
.
product.option.values
only shows you the optionValues that are associated with a variant. If there are optionValues that are not associated with variants, they are not returned byproduct.option.values
. To see all the optionValues, use theproduct.option.optionValues
field in your query. -
Will the webhooks payload continue to have all the information (for up to 2000 variants). We rely on webhooks to understand if anything changed on the product and get a complete state of the product.
We are making the following changes to the product webhooks payload:
- variant_ids field will be retroactively added to all webhook versions, the field will list all variant ids in the following format variant_ids: [{id: INT},{updated_at: TIMESTAMP}]
- Product webhooks will return full variants payload for the first 100 records, and only the variant_ids field for variants 101+
If the product generating the webhooks has <=100 variants, you can still get the complete state of the product. However if the product has >100 variants, you will need a follow up query to get information on the variants 101+ to construct the full state of the product.
- I have an app that syncs product data from an external database into Shopify. Earlier I used to use the REST
/product
endpoint (or GraphQLproductUpdate
mutation) to send the entire state of the product to Shopify in one call. Is there going to be a new mutation that does something similar on GraphQL?
We have introduced theproductSet
mutation to the GraphQL Admin API, to create and update the state of a product per an external database. It is available in both asynchronous and synchronous modes. It will have aproductOption
and avariants
input. Thevariants
input will have anoptionValues
input for pulling product and variant data from the external database.
You should be able to use this mutation when you’re managing the state of the product model outside of Shopify, and want to update Shopify’s product model state to reflect your external state. Examples are Enterprise Resource Planning (ERP) systems and Worksheets. To learn more, please watch out for updates here
- If I want to update a product with >100 variants, what mutations should I use
This depends on your app’s workflow. We’ve developed different sets of mutations that are catered to different workflows common to Shopify apps and use cases. Because there are multiple ways to work with the new product model, identify the workflow that best matches your app or use case and use the corresponding types in the GraphQL Admin API.
A. When your app’s source of truth for merchandising data is something other than Shopify, you can use the productSet mutation that pushes information about a product from an external source into Shopify. Examples of such apps are ERP connectors, Data import apps
B. When your app’s source of truth for merchandising data is Shopify, and when you want to edit specific product data, you can use the productUpdate, productOptionUpdate, productVariantBulkUpdate mutations that enable specific and incremental changes to products, variants, and options.
- Creation of products with >100 variants is slow. Is this a known issue?
We’re aware that certain mutations when used with large and complex payloads can be very slow and in some cases also time outs. We are actively working on improving the performance of these mutations.
Some example mutations that are know to be slow today:
productVariantBulkCreate
orproductVariantBulkUpdate
with a large number of variants and many connected fields like metafields or inventoryproductOptionUpdate
productSet
mutation in synchronous mode with large number of variants and connected fields like metafields
-
Why is there a 100 variant limit for the
productSet
mutation in synchronous mode?
We expect merchants in the future would have very complex product profiles (Eg. thousands of variants, multiple metafields per variant). Such an unbounded nature of the mutation would cause a synchronous mutation to timeout. As a result, we decided to limitproductSet
in synchronous mode to 100 variants. If you expect any of your users to be working with >100 variants and/or many connected fields, we highly recommend using the mutation in asynchronous mode. -
Why does
productSet
mutation not support managing a) inventory, b) publishing, c) creation of media.
As the workflows enabled on managing inventory, publishing and media management have gotten more complex, we want developers to use the mutations geared towards these specific workflows. -
What happens when I send a valid payload without an ID on productSet mutation?
A new Product is created. -
What happens when I send a valid payload with a non existent ID on
productSet
mutation?
The API returns an error. -
For both creating or update a product using
productSet
, why am i getting an error when the input has options that are not used in variants?
Variant has to have an assigned value for all the options attached to a product. The Product can’t be created with a variant that does meet that criteria -
Can I create a new Media through the API?
You may create new media, and subsequently set up a new product with this created media:
- Execute the
createFile
mutation for your batch of media URLs. This will return globally unique identifiers (GIDs), which will be used to reference the created media. GIDs are returned in the same sequence as the files were uploaded. - After obtaining the GIDs from the
createFile
mutation, theproductSet
mutation may be used to associate these media files with their respective products using the GIDs.