If you are just getting started with the Sanity query language GROQ, you should probably read the how-to first.
GROQ (GRaph Oriented Query language) is a declarative language designed to query collections of largely schema-less JSON documents. Its primary design goals are expressive filtering, joining of several documents into a single response, and shaping the response to fit the client application.
For an introduction to GROQ, please see the how-to. The rest of this chapter is a comprehensive technical reference of the GROQ language.