Go beyond writing data queries – filter, add functions, reshape and transform the responses. Get familiar with GROQ, the query language for Sanity data, webhooks and roles.
1. Your new favourite query language
Why you'll learn (and love) GROQ in this course, and why not GraphQL?
2. The Vision Tool
Vision is a plugin bundled with Sanity Studio that allows you to write GROQ queries against the current Project ID and Dataset.
3. Filters and projections
Most queries begin with one character, and it means “get everything.”
4. Functions, in my queries?
With GROQ you can do more than return values; you can compute and transform them from within the query.
5. Joins and subqueries
When a document contains a reference it only stores the ID of that document, GROQ can resolve it
6. Chained projections
Write sequential projections to transform responses into different shapes
7. Query parameters
Use parameters as variables in your queries, whether they have values or not.
8. Handling missing values
Named attributes in a projection will return null by default, but they don't have to.