FROM CACHE - en_header

502 Bad Gateway error when trying to create a product with 30+ variants using GraphQL.

chescko29
Shopify Partner
7 1 0

Hi,

I'm getting 502 Bad Gateway error when trying to create a product with 30+ variants using GraphQL. This is not the case if I create a product with fewer variants.

Looking in other cases it looks like it is a common problem, but I didn't found any way to solve this.

Any idea/recommendation?

Thanks.

Replies 2 (2)
L_J_K
Shopify Staff
Shopify Staff
402 64 84

Hey @chescko29 

By any chance would you have the request_id from that failing request? I can take a look into it for you. Thanks!

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
chescko29
Shopify Partner
7 1 0

Hi.

After a while doing some test and researching, we finally had to adjust or code to:

1. First, create the product with his variants using productCreate mutation.
2. Then, upload all media files (images) to the product and assign images to each variant.

After that, we have not experienced 502 Bad Gateway errors anymore.

It looks like Shopify have troubles handling mutations with too many variants/images.