Hey ..
I’m creating products with images using the Media object
https://shopify.dev/api/admin-graphql/2021-07/mutations/productcreate
The createMediaInput does have not have position attribute.
You can set the alt tag and src- but not position.
I saw another query - productReorderImages , which lets you reorder positions,
but wondering if there is an easier way to set image positions using graphql?
thanks
Arjun
Noticed that the position field is not present at all in graphql.
It is available in the REST Api.
Had a doubt regarding this.
If we are using the media to get the product images. e.g.
query {
products(first: 10) {
edges {
node {
id
media(first: 10) {
edges {
node {
... on MediaImage {
id
image {
altText
src
}
}
}
}
}
}
}
}
}
Will this return all the images of the product in the right order always? As in first always returns image in position 1, followed by 2, 3 and so on.
I need to get all the images in the right position, and the re-upload with the new src - but maintain the old positions.
Would anyone how to go about this?
Thanks
Arjun