Schema first

Everything in Sanity starts with a schema. A schema defines the document types your content team can create — blog posts, service pages, product listings — and the fields each type contains. Sanity schemas are TypeScript files, which means you get autocomplete, type checking, and version control out of the box.

GROQ queries

GROQ (Graph-Relational Object Queries) is Sanity's query language. It looks like a cross between GraphQL and SQL but is purpose-built for document databases. A query like *[_type == "blogPost" && language == "en"] | order(publishedAt desc) { title, slug, publishedAt } fetches all English blog posts sorted by date, projecting only the fields you need. No over-fetching.

Image pipelines

Sanity stores images in its own CDN and exposes a transformation API. You can request any crop, resize, or format conversion via URL parameters at serve time — no pre-processing step required. The @sanity/image-url package gives you a chainable builder: urlFor(image).width(800).auto('format').url().

The publish-to-deploy webhook

When a content editor hits Publish in Sanity Studio, Sanity fires a webhook to your deploy pipeline. In this stack, the webhook hits a Cloudflare Worker that batches multiple publishes into a single Cloudflare Pages build trigger, firing at most once per minute. The result is a fully automated content-to-production flow — editors publish, the site rebuilds and deploys in under two minutes.