What's Changing?
The `productSet` mutation now includes validation limits on inventory quantities to support the increased variant limit from 100 to 2048 variants per product.
New Input Validation Limits
With the extended maximum variants per product, the mutation enforces a maximum limit of 50,000 inventory quantities across all variants in a single mutation. This change aims to ensure reliable performance when managing products with extensive variants across multiple locations.
Error Response Example
{ "data": { "productSet": { "userErrors": [ { "code": "INVENTORY_QUANTITIES_LIMIT_EXCEEDED", "field": ["input", "variants"], "message": "Input contains 51200 inventory quantities, which exceeds the limit of 50000" } ], "product": null } } }Why Are We Making This Change?
- Support for 2048 Variants: Products can now have significantly more variants, increasing from 100 to 2048.
- Improved Reliability: Ensures consistent execution and performance for products with complex configurations.
Handling Large Inventory Updates
If your inventory quantities exceed the 50,000 limit, consider these best practices:
- Batch Operations: Split large operations into smaller mutations to stay within the limit.
- Use `inventorySetQuantities`: Update inventory amounts across multiple locations efficiently using this dedicated mutation.
- Leverage Bulk Mutations: For managing extensive datasets, use bulk mutation operations optimized for scalability.
Related Changes
These updates are part of the broader effort to support the increased variant limit of 2048 per product. The validation complements dynamic complexity calculations, optimizing costs and input handling for `productSet` mutations effectively. Additionally, `productVariantsBulkCreate` and `productVariantsBulkUpdate` mutations now enforce similar inventory quantity limits.