Request failed with HTTP Code 502. GraphQL mutation productUpdate

Hello, I am editing a product and its variants, adding more than 80 images and assigning them to their respective variant, but I get the error: Request failed with HTTP Code 502. I attach the request ID, I am using imageSrc in each variant to assign the image, with less than 30 everything works fine .

Thank you.

[x-request-id] => 91d7efe6-596b-419c-9b1b-dbc179fd800b

Hi, this is an update: Now I’m using this method: mutation productCreateMedia but… this request doesn’t return a Media ID to attach to ProductVariant with productVariantAppendMedia, I need to know the ID at the request time bcz by each variant there is a specific main image.

The reques only returns this fields:

media {
			  # Media fields
			  status
			  alt
			}

So the question is, how to know the ID of the image uploaded at request time?

Thanks

Hey @ASLuis

A 502 error code in that situation most likely means that the number of images being uploaded in a single request caused a timeout somewhere before the operation could finish and return the response.

Uploading smaller batches like you have already mentioned is the best workaround, but you could also try adding a large number of images asynchronously with one of the mutations available to our bulk operations.

Hope that helps.