
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes! This is absolutely possible in GROQ. You can access array elements by their index position and filter on specific positions within an array.
Here's how you would write that query:
*[_type == "post" && count(authors) > 1 && authors[1]->name == "Chris"]Let me break down what's happening:
count(authors) > 1 - Filters for posts with more than one authorauthors[1] - Accesses the second element in the authors array (arrays are zero-indexed, so [1] is the second position)->name == "Chris" - Dereferences the author reference and checks if the name equals "Chris"If you want to return specific fields from the matching posts, you can add a projection:
*[_type == "post" && count(authors) > 1 && authors[1]->name == "Chris"]{
title,
authors[]->{name}
}A few important notes:
authors[0] is the first author, authors[1] is the second, etc.-> operator dereferences the reference to get the actual author document&& to get exactly what you needIf your authors array contains objects rather than references, you'd adjust slightly:
*[_type == "post" && count(authors) > 1 && authors[1].name == "Chris"]This pattern works for any array position - just change the index number to match the position you're interested in!
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