👋 Next.js Conf 2024: Come build, party, run, and connect with us! See all events

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– build remarkable experiences at scale

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

Was this answer helpful?