This is a common problem, considering this has 4 steps process, may be a single page wiki will be useful.
Rest API allows you to create products with images ( raw or URL)in a single step.
A developer is attempting to upload JPEG images when creating or updating products via GraphQL mutations (productCreate and productUpdate). The challenge is that the media input only accepts image URLs, not raw base64-encoded images or direct file uploads.
Solution provided:
stagedUploadsCreate mutation to first upload the image filemedia argument (specifically CreateMediaInput.originalSource) in the productCreate mutationmedia field requires type CreateMediaInput with properties like mediaContentType: IMAGE and originalSourceProcess overview:
stagedUploadsCreateproductCreate/productUpdateA participant notes this 4-step process is complex and suggests creating documentation to simplify it, contrasting it with the REST API which allows direct image uploads in a single step.
This is a common problem, considering this has 4 steps process, may be a single page wiki will be useful.
Rest API allows you to create products with images ( raw or URL)in a single step.