I have in place a method to upload images using the REST API. It works ok, the filename is correct, but it is so inconsistent that it has become a problem for production and cannot be relied upon when creating new products because it errors out about 1 out of 5 times.
so, trying to use GraphQL Admin API but am running into this issue:
Mutation ProductCreateMedia has no filename as a parameter, so while it succesfully uploads and attaches the image to the product, there is an arbitrary filename created.
Mutation ProductUpdateMedia can only operate on images that are already attached to the product. I cannot verify this, but in practice the process does not error out, but it also does not attach a new image.
Mutation FileCreate is great at uploading the file, giving it the correct filename, but then ProductCreateMedia
creates a new file and appends the UUID ( since the filename already exists ), and ProductUpdateMedia does not
attach the file.
I suppose I can use FileCreate first, ProductCreateMedia next, ProductUpdateMedia to choose the correctly named file, the delete the other one, but that’s the long way around and if I have to then I have to.
If anyone can explain a better way to accomplish this…