Home / Companies / Sanity / Blog / Post Details
Content Deep Dive

We’re open sourcing GROQ: A query language for JSON documents

Blog post from Sanity

Post Details
Company
Date Published
Author
Knut Melvær
Word Count
952
Company Posts That Month
2
Language
English
Hacker News Points
-
Post removed?
No
Summary

Sanity has open-sourced the specification for its query language, GROQ, which is designed for filtering, projecting, and sorting JSON document collections. Originally developed for Sanity’s real-time document store, GROQ allows for complex queries such as filtering posts with specific keywords and ordering results by publish date. As part of the open-source initiative, the working draft of the GROQ specification has been published, and it draws inspiration from GraphQL’s specification format. Magnus Holm, a backend engineer, has been working on Glush, a parsing tool, which facilitates the creation of GROQ parsers for various languages, including JavaScript, and has also developed a CLI tool for querying JSON data through command-line interactions. GROQ's versatility is illustrated through examples such as querying APIs for specific data, counting Pokémon types, and retrieving Nobel Prize laureates based on gender and category. The ongoing development aims to enhance GROQ's capabilities, including its potential use in web browsers, to expand its application beyond Sanity’s ecosystem.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Real-time 1 513 139 52 0%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.