
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes, that's GROQ (Graph-Relational Object Queries), Sanity's query language! The ... is called the ellipsis operator (or spread operator), and it's used in projections to include all fields from a document.
The ... expands to include all fields from the current document or object you're querying. Think of it like JavaScript's spread operator, but for GROQ queries.
In your examples:
*[_id == "${document}"] {
...,
}This returns all fields from the matching document. The ... says "give me everything that's in this document."
export const pageQuery = `
...,
content {
...,
main {
...,
modules[] {
...,
${moduleQuery}
}
}
}
`;Here you're using ... at multiple levels to include all fields at each level, plus you're explicitly expanding nested objects like content, main, and modules[].
The ellipsis operator is super useful when you want:
The ... is always evaluated first, regardless of where you put it. This means if you write:
{
title: "Override",
...
}The ... is evaluated first, then your title override applies. But to avoid confusion and unintended overrides, it's best practice to put ... at the beginning:
{
...,
title: "Override"
}This makes it clear you're starting with all fields, then modifying specific ones. Check out the official GROQ pipeline components documentation for more details on how projections work!
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