
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeLooking at your query, you want to transform the images array to return just the URLs. In GROQ, you can use array projections to map over array elements and extract specific fields. Here's how to do it:
*[_type == "art"]{
_createdAt,
_id,
"category": category.title,
"slug": slug.current,
"featureImage": featureImage.asset->url,
"images": images[].asset->url
}The key is images[].asset->url - this syntax does three things:
images[] - Iterates over each element in the images array.asset-> - Follows the reference to the asset document.url - Extracts just the url fieldThis will give you an images field containing a flat array of URL strings like ["https://...", "https://..."] instead of an array of image objects.
If your images are stored differently (for example, if the URL is directly on the image object rather than on a referenced asset), you might need:
"images": images[].urlOr if they're image objects without references:
"images": images[].asset.urlThe [] operator is really powerful in GROQ - it lets you project through arrays and extract exactly what you need. You can read more about projections in GROQ and check out the query cheat sheet for more array manipulation examples.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store