How to display image by image ID?

How to display image by image ID?

Macks
Shopify Partner
4 0 0

Hi, I'm using the Storefront API to show products in my client's shop. For each product, I'm fetching the images like this:

 

products(first: 100) {
	edges {
		node {
			id,
			title,
			images(first: 5) {
				edges {
					node {
						id
						width
						height
						altText
					}
				}
			}
		}
	}
}

 

 

Now that I have the image's IDs, how do I actually show them with an `<img>` tag?

Is there a certain URL structure I can use, e.g. images.shopify.com/{id}.jpg or something like that?

Thanks for your help!

Replies 0 (0)