How can I fetch products in GraphQL in the same format they come in a REST API?

Topic summary

A developer is migrating from Shopify’s REST API to GraphQL and encountering data structure differences for product images.

Core Issue:

  • REST API returns images with variant_ids array and position fields
  • GraphQL’s Image object lacks these fields, making it difficult to maintain the same data format

Specific Missing Fields:

  • variant_ids: Array linking images to specific product variants
  • position: Numerical ordering of images

Current Status:
The question remains unanswered. The developer needs guidance on how to query GraphQL to retrieve product image data in a format equivalent to the REST API response, particularly for variant associations and image ordering.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

In the past, I used REST API and received products in the format described in the documentation.
Now, I need to fetch data from GraphQL, but the data format differs.

In REST API:

{
// other fileds
"images": [
    {
      "id": 850703190,
      "product_id": 632910392,
      "position": 1,
      "created_at": "2018-01-08T12:34:47-05:00",
      "updated_at": "2018-01-08T12:34:47-05:00",
      "width": 110,
      "height": 140,
      "src": "http://example.com/burton.jpg",
      "variant_ids": [
        {}
      ]
    }
  ],
}

In GraphQL Image filed does not have a image.position and images.variant_ids.

How do I find this fields?