惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Vercel News
Vercel News
F
Fortinet All Blogs
月光博客
月光博客
G
Google Developers Blog
博客园 - Franky
GbyAI
GbyAI
The Cloudflare Blog
I
InfoQ
雷峰网
雷峰网
WordPress大学
WordPress大学
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
T
The Blog of Author Tim Ferriss
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
小众软件
小众软件
腾讯CDC
B
Blog
量子位
V
V2EX
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News

Sanity.io

A Board Game agent built using Sanity Context and Vercel's AI SDK | Sanity Build a prototype with Claude Code that your whole team can edit | Sanity What’s New - May 2026 | Sanity I built a London pub guide with v0 and the Sanity MCP in six hours. Here's what I learned. | Sanity Build a conference concierge with Agent Context and Anthropic | Sanity Build a content-aware Telegram agent with Vercel AI SDK and Chat SDK | Sanity How I used Agent API to generate photos for my family’s recipes | Sanity What’s New April - 2026 | Sanity Better context, better matches: An AI love story (for dogs) | Sanity How to write for an agent | Sanity Content Agent, meet Slack: AI content operations in your workflow | Sanity Structure powers intelligence | Sanity Your agent needs better content. Here's how to give it. | Sanity How to serve content to agents (a field guide) | Sanity Sanity TypeGen GA: Automatic TypeScript types for content and GROQ | Sanity Sanity is now available on the Vercel Marketplace | Sanity The logo soup problem (and how to solve it) | Sanity Content Releases: From scattered updates to coordinated publishing | Sanity What's New - February 2026 | Sanity How we solved the agent memory problem | Sanity v0 Builder Challenge: The winners | Sanity Introducing: Sanity Agent Skills | Sanity Content Agent: Days of work in one conversation | Sanity Our Sanity Values | Sanity Open Source Pledge 2025: Stepping up when it matters | Sanity v0 builder challenge: $3000 in prizes | Sanity Why AI Breaks Without Structured Content Operations | Sanity What’s New January - 2026 | Sanity BFCM 2025: What teams built when infrastructure stopped being the problem | Sanity How AI shaped holiday shopping and what it means for content in 2026 | Sanity
Introducing our new GraphQL API | Sanity
Even Westvang · 2020-02-27 · via Sanity.io

You know us, we’re careful about our APIs – our GraphQL APIs have seen production use for over a year, but it's not till now we're declaring them officially out of beta. You can try it out by updating to the newest version of the Sanity CLI and learn more about usage and migration paths in the documentation. With the update you will also get more features, including improved filters and sorting, as well as the ability to deploy tagged versions of your GraphQL endpoints.

GraphQL is available for all plans, and you can upgrade by running the following in your command line:

Of course there are also new features!

Sorting, and filtering, for most things!

The beta version had limited field options when it came to filters, and sorting. So we made sure to improve those. If you want to get to a post by its slug or sort a product by its price, that’s totally doable. You can also filter and sort by nested values and with different boolean operators. As you would expect to be able to.

What! _ ?!

If you inspect the schema for the new version, you’ll notice an underscore of the type DocumentFilter. We studied most of the other automatically generated GraphQL APIs out there and saw a lot of different approaches. Our concern is getting in the way between you and what you want to do. We used the underscore because it is an invalid field name for Sanity’s content backend, and will never come in conflict with any of your content type names. We did look for prior art but soon realized that most vendors of automatically generated GraphQL APIs do this somewhat differently, and they will not always guarantee you against collisions between field names and filters.

Behind the underscore, you can filter documents based on what references them. For example, “give me all documents that reference the product with this ID”. You can also filter out all drafts if you happen to make an authenticated request with access to those.

Stay stable with tagged versions

The Sanity CLI will now warn you if you try to deploy breaking changes in your schemas. If you are not ready to adjust your queries in production, you can now deploy a new tagged version. This means you can run different endpoints with different subsets of your schemas at once. Or if you want to version your schemas, that’s a possibility too. We reasoned that the point with GraphQL is to have stable and predictable APIs, and not something that automatically changes whenever you’re experimenting with your content model or the like. We have also updated our source plugins for Gatsby and Gridsome to support tagged APIs.

GraphQL, powered by GROQ

Sanity’s primary query APIs is powered by GROQ. And people do sometimes ask us if we will support both GROQ and GraphQL going forward. The answer is an unequivical “yes”, we will support both because we don’t see these as opposed to each other. In fact, GROQ is what powers the GraphQL APIs (and it’s doing a great job of it as well). While GraphQL is more of a pattern for how to design an API, GROQ is an actual query language. You can in a way compare GraphQL to RESTful, and GROQ to SQL. We will continue developing both offers, and we look forward to learning what you will use them for.