Use GROQ to Query an Array of Image URLs

7 replies
Last updated: Jan 12, 2022
SOLVEDHow with GROQ I can query an array of images url’s?
Please see image, from this data structure I would like to get from each item in array an ALT and URL to the image
πŸ€”
Jan 12, 2022, 6:46 PM
HA! solved πŸ˜„
logotypes[].asset->url
Jan 12, 2022, 6:48 PM
Haha, beat me to it!
Jan 12, 2022, 6:48 PM
user M
πŸ˜„
Jan 12, 2022, 6:49 PM
haha, you both beat me to it. Was just typing a reply!
You can also use Sanity's Image url builder package if your project is in js/ts.
Jan 12, 2022, 6:49 PM
With that package you can transform the image, similar to cloudinary.
Jan 12, 2022, 6:49 PM
user M
,
user H
many thanks for your help πŸ™‚ Have a nice day πŸ™‚
Jan 12, 2022, 6:51 PM
You as well!
Jan 12, 2022, 6:52 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in