A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
Hello,
I use GraphQL to perform various tasks, and usually, everything works as expected.
However, when I use the following API to reorder the positions of media images for a product: ProductReorderMedia, it doesn't seem to work as expected.
Let me demonstrate:
Initially, the order of the product images is as shown in the picture:
I try to change the order of these 4 images from: 1, 2, 3, 4 to: 4, 3, 2, 1, and wait for the task to complete.
After the execution, we expect the white cat to be in the first position, the black cat to be in the last position, and the two flower images to swap places.
However, this is not the case; only the images in positions 2 and 4 have swapped places.
I have tried many times, including setting the newPosition values to very high numbers, assigning newPosition to even numbers only, and changing the order of only 2 images at a time, but I have not been able to get the expected result.
I am not sure what went wrong and would appreciate any advice on how to solve this issue.
Thank you!
Solved! Go to the solution
This is an accepted solution.
Hi, there
I think the starting index should be 0, not 1 .
In my side ,this is correct.
This is an accepted solution.
Hi, there
I think the starting index should be 0, not 1 .
In my side ,this is correct.