Portable Text stores rich content as JSON blocks. Rendering it correctly means writing serializers for marks and custom blocks, handling image asset references, and accepting payload trade-offs.
Learn how to extend the WordPress REST API using register_rest_field and register_rest_route to create high-performance, normalized data feeds for headless React or Vue apps.
Learn how to decouple your frontend from the Ghost CMS using the Content API to build high-performance, custom sites with frameworks like Next.js or Nuxt.
GROQ projections let you shape Sanity query results server-side — flattening references, generating excerpts, and matching your component props exactly. Here's a worked example plus the trade-offs.
Bare Sanity queries over-fetch and force extra round-trips for references. Learn how GROQ projections and the -> dereference operator let you shape exactly the JSON your components need, server-side.
Sanity keeps drafts in the same dataset as published content. The minimal design: one query set, two clients, and the published vs. previewDrafts perspectives as the trust boundary.
GROQ paginates with an inclusive slice operator applied after filtering and ordering. Here's the query shape, a working route handler, and the offset pitfalls to check before shipping.