Could someone kindly explain how to create products with variants and attach images to those variants at the same time we create those products, using the GraphQL Admin API? We have followed the guidelines given here and the other Shopify GraphQL API documentation. We have managed to get multiple products with various variants but despite all our efforts we can't figure out how to do the following.
1) Attach images to variants at the time of product and variant creation. We have managed to get media uploaded to main gallery but not to individual variants. We tried pretty much everything we came across with including the details given here with no luck. We would like to submit the URL of the image/media location of the variant so it gets added/downloaded and attached to variant when we create the parent product.
2) How to create products with the same title. If we try the same product title with totally different variations, it would only create the first product in single operation. It allows us to create them separately (separate queries), but not in the same query. Someone has raised the same question for the REST API a couple of years ago here with no answer.
Any guidance is highly appreciated. Many thanks in advance.