
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYou're almost there! Instead of using @-> with an alias, you can dereference the array directly:
articles[]->This will give you the full referenced article documents directly in the array without any extra nesting.
Your current query:
articles[]{
'article': @->
}creates objects with an article property because you're explicitly projecting into that structure. The @ operator refers to the current element, and by wrapping it with 'article': @->, you're creating that nested object.
By using articles[]->, you're telling GROQ to:
articles array ([])->)If you want to select specific fields from the referenced articles, you can also project within the dereference:
articles[]->{
title,
slug,
publishedAt
}This gives you an array of article objects with only the fields you specify, still without the extra nesting level.
The reference access operator works seamlessly with array projections - when you use -> on an array of references, it automatically dereferences all items in that array. This is the standard pattern for working with arrays of references in GROQ queries.
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