All things Shopify and commerce
Hi there!,
I'm trying to create new products and variants using GraphQl. I've tried different approaches using the examples given by the Shopify docs but I received an error as output. These are the examples we've used and the error. Any ideas ?
What we are trying to do is create a product and all its variants. Is it possible ?
Thank you in advance
mutation productVariantsBulkCreate($productId: ID!, $variants: [ProductVariantsBulkInput!]!) { productVariantsBulkCreate(productId: $productId, variants: $variants) { userErrors { field message } product { id options { id name values position optionValues { id name hasVariants } } } productVariants { id title selectedOptions { name value } } } }
{ "productId": "gid://shopify/Product/8332936610007", "variants": [ { "optionValues": [ { "name": "Red", "optionName": "Color" }, { "name": "Brand new style", "optionName": "Brand and Style" }, { "name": "Silk", "optionName": "Material" } ], "price": 22 } ] }
{ "errors": [ { "message": "The option doesn't exist", "locations": [ { "line": 2, "column": 3 } ], "path": [ "productVariantsBulkCreate" ] } ], "data": { "productVariantsBulkCreate": null }, "extensions": { "cost": { "requestedQueryCost": 13, "actualQueryCost": 10, "throttleStatus": { "maximumAvailable": 2000, "currentlyAvailable": 1924, "restoreRate": 100 } } }
We're following the examples in this part of the docs:
Hi Omar Hernandez,
I have the same problem with version 2024-04.. any solution?
even adding: "strategy": "REMOVE_STANDALONE_VARIANT"
Thank's
We recently spoke with Zopi developers @Zopi about how dropshipping businesses can enha...
By JasonH Oct 23, 2024A big shout out to all of the merchants who participated in our AMA with 2H Media: Holi...
By Jacqui Oct 21, 2024We want to take a moment to celebrate the incredible ways you all engage with the Shopi...
By JasonH Oct 15, 2024