
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on the documentation you're referencing about preview content, when you're working with references in Sanity's visual editing setup, you'll need to dereference and expand references in your GROQ query rather than trying to resolve them client-side in the preview object.
When fetching data for preview, you need to dereference references using the -> operator in your GROQ query:
*[_type == "yourDocumentType"] {
_id,
property,
"nestedProperty": property->nestedProperty
}Or if you want the entire referenced document:
*[_type == "yourDocumentType"] {
_id,
property,
propertyExpanded: property->
}The preview content passed to your components needs to have references already resolved because:
If your document structure is:
{
_type: "page",
author: {
_type: "reference",
_ref: "author-123"
}
}Your GROQ query for preview should be:
*[_type == "page"] {
_id,
title,
"authorName": author->name,
"authorBio": author->bio,
// Or get the whole author object:
authorFull: author->
}When using the Presentation tool or fetching content for visual editing, make sure your data-fetching functions include these projections. The dereferencing happens at query time on Sanity's CDN, not in your preview components.
If you're using @sanity/client with useLiveQuery or similar hooks, the dereferenced data will flow through automatically to your components with proper Content Source Maps for the visual editing overlays.
The key takeaway: resolve references in your GROQ queries using ->, not in your component code. The preview object you receive should already have the nested data you need. This is the standard pattern for working with references in Sanity - there's no separate client-side resolver API needed.
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