with a BulkOperation, the order of product images is not guaranteed if I understand this correctly:
“The GraphQL Admin API doesn’t serially process the contents of the JSONL file. Avoid relying on a particular sequence of lines and object order to achieve a desired result.”
REST API had / has the “position” property of a product image, but that’s missing from GraphQL.
In the Shopify GraphQL Admin API, the position property for product images is not directly available as it was in the REST API. However, you can use the sortKey argument with POSITION to retrieve product images in a specific order, eg: here’s an example query to fetch product images sorted by position:
query GetProductImages($productId: ID!) {
product(id: $productId) {
media(query: "media_type:IMAGE", sortKey: POSITION) {
nodes {
id
alt
... on MediaImage {
image {
url
}
}
}
}
}
}