
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeLooking at your query, you're dealing with a nested reference situation where icon.asset is a reference that needs to be dereferenced. The issue is that you need to dereference the asset reference within the context of the icon object.
Based on the data structure you showed, where icon.asset contains {_ref: "image-...", _type: "reference"}, you need to properly dereference that asset reference. The GROQ reference access operator -> can be chained to handle nested references.
Try this approach to get the full asset document:
"footerNavSocial": footerNavSocial->social[]{
"alt": icon.alt,
"image": icon.asset->,
link,
name,
}If that's still returning empty, the path might need adjustment. Since you're working with Sanity image assets, you typically want to access the url field from the dereferenced asset:
"footerNavSocial": footerNavSocial->social[]{
"alt": icon.alt,
"imageUrl": icon.asset->url,
link,
name,
}Or to get multiple fields from the asset:
"footerNavSocial": footerNavSocial->social[]{
"alt": icon.alt,
"image": icon.asset->{url, metadata},
link,
name,
}If you're still getting empty objects, it could mean:
icon.asset._ref structure in your schemaicon is structured - it might itself be a reference that needs dereferencing firstIf icon is also a reference, you'd need to dereference it before accessing asset:
"footerNavSocial": footerNavSocial->social[]{
"alt": icon->alt,
"image": icon->asset->url,
link,
name,
}The key insight from the reference operator documentation is that each -> internally executes a subquery to fetch the referenced document, and you can chain these to traverse multiple levels of references.
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