
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeBased on your question, it sounds like you're trying to dereference a reference field within a custom object, but [@].title isn't working. The issue is that @ by itself doesn't dereference - you need to use the reference access operator -> instead.
The correct syntax would be:
[@->].titleOr more commonly written as:
@->.titleThe @ symbol in GROQ represents the current element (useful in array mappings or projections), but to actually resolve a reference to get the referenced document's data, you need the -> operator.
Here's how it works: when you have a reference field, it's stored as {"_ref": "document-id"}. The reference access operator (->) performs an internal subquery to fetch the actual document with that _id and replace the reference with the full document data.
Example scenarios:
If you have a single reference field:
*[_type == "myDocument"] {
myReference->.title
}If you're already in a projection context using @:
*[_type == "myDocument"] {
"refTitle": @.myReference->.title
}If you're working with an array of references:
*[_type == "myDocument"] {
myReferences[]->title
}If you're dealing with mixed content (some references, some inline objects), you can use coalesce:
{
"title": coalesce(@->.title, @.title)
}If @->.title is still returning null, double-check that:
_ref property)title fieldHope this helps!
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