Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Latest Admin GraphQl API not working properly

Latest Admin GraphQl API not working properly

syed85
Shopify Partner
3 0 5

Im trying to create new product with options using the productCreate Graphql Admin API . But unfortunatly it is not working properly.

 

Below is my mutation request:

 

mutation {
  productCreate(input: {
        title: "demo product 4",
        productType: "Snowboard",
        productOptions: [
            {
                name: "size",
                values: [{
                    name: "large"
                },
                {
                    name: "small"
                },
{
name: "medium"
}
] } ] }) { product { id hasOnlyDefaultVariant } userErrors { message field } } }

the response is 200. but when i see the created product in admin only the size-large option is created, other values like small and medium are not created. 

 

i also tried product options create API also, but unfortunatly im facing same issue there also. Please help..

 

 

Replies 4 (4)

Tozell
Shopify Partner
11 0 4

I am also banging my head over this issue and whats more concerning is the fact this authors post is from May 😕

somfkgflgk
Visitor
2 0 1

it still doesn't work in 24 september 2024, i tried with  productVariantsBulkCreate / productOptionsCreate /  productCreate and ofc none works

Tozell
Shopify Partner
11 0 4

The correct method is as above but the options will not automatically generate variations on the product. Its down to you to then create all the product variations at which point the previously saved options will magically appear.

Then you need to hope your variations count does not exceed 100.

somfkgflgk
Visitor
2 0 1

seems weird for me but it works thanks