Rule catalogue

Every version boundary, written down as data.

Each rule is a Sanity document with typed conditions, the version where behavior changes, what happens now and after a bump, and a verbatim quote from the doc that proves it. The engine fires a rule only when every condition holds.

14 verified rules · loaded from the Sanity dataset · query it yourself ↗

apiVersion

warning

apiVersion is computed from the current date

apiVersion-dynamic
apiVersion is computed date
Now
Your API version moves forward every day, so a new API release can change your app without a deploy. For example, the default perspective changed on 2025-02-19.
After bump
There is no single pinned version to bump. Behavior follows whatever version is current today.
  • API Versioning — “Computing it at runtime (for example from new Date()) means your API version changes every day”
warning

No apiVersion: client falls back to v1

apiVersion-missing
callSite in createClient,withConfigANDapiVersion is missing
Now
With no apiVersion, the JS client logs a deprecation warning and uses v1, the original API version.
After bump
Setting a current date changes several defaults at once, including the perspective (from 2025-02-19 the default is published, not raw).
  • API Versioning — “Omit it and the client issues a deprecation warning, then defaults to v1 of the API.”
  • Perspectives for Content Lake — “With the release of API version 2025-02-19, the default perspective changed from raw to published.”
warning

apiVersion comes from an env var with no fallback

apiVersion-unresolved-env
apiVersion is computed env,undefined
Now
Pinned can’t see which version this resolves to. If the variable is unset at runtime, the client receives apiVersion: undefined, which throws instead of falling back.
After bump
Depends on the value in each environment. Make sure every environment sets it.
  • API Versioning — “Passing the property with an undefined value throws an error instead.”
warning

Experimental API version vX

apiVersion-vX
apiVersion = vX
Now
vX is the experimental version and can change at any time without notice.
After bump
Pinning a date makes behavior stable again.
  • API Versioning — “This version may change at any time in any way and is used at your own risk.”

perspective

warning· boundary 2025-02-19

Queries for drafts.* stop returning drafts after a version bump

bump-hides-drafts
token is presentANDapiVersion < 2025-02-19ANDperspective is unsetANDquery matches /…/
Now
Your queries reference drafts. IDs and depend on the pre-2025-02-19 default perspective (raw), which returns draft documents to authenticated requests.
After bump
From 2025-02-19 the default perspective is published, which excludes drafts. The same queries will silently return no draft documents.
critical· boundary 2025-02-19

Unpublished drafts are served to your site

drafts-leak-raw-default
callSite in createClient,withConfigANDtoken is presentANDapiVersion < 2025-02-19ANDperspective is unset
Now
Your client sends a token and pins an API version before 2025-02-19 without setting a perspective, so the default is raw. Authenticated raw queries return draft documents (drafts.*) next to published ones, so unpublished edits can reach production.
After bump
From 2025-02-19 the default perspective is published. Bumping the version silently stops returning drafts, which fixes the leak but changes what any preview code built on it sees.
warning

previewDrafts was renamed to drafts

previewDrafts-deprecated
perspective = previewDrafts
Now
previewDrafts still works and behaves like drafts.
After bump
The docs say both names work, but recommend drafts on the latest APIs.
  • Perspectives for Content Lake — “The drafts perspective used to be called previewDrafts. They both work, but if you're using the latest APIs, you should transition to drafts.”

cdn

warning

drafts perspective with the CDN not disabled

drafts-requires-no-cdn
perspective in drafts,previewDraftsANDuseCdn in true,unset
Now
Draft queries are not cached in the CDN. Because useCdn is not false, the client bypasses the CDN anyway and logs a warning on every request.
After bump
No change from bumping. This applies at every API version.

listen

info

listen() without includeAllVersions

listen-include-all-versions
callSite = listenANDlistenOption is absent includeAllVersions
Now
This listener doesn’t pass includeAllVersions, so it won’t get change events for Content Release version documents.
After bump
The parameter is available from API version 2025-02-19 and needs an authenticated request.

groq

warning· boundary 2025-02-19

Empty-string projection key changes meaning

projection-empty-string
query matches /…/ANDapiVersion < 2025-02-19
Now
Before 2025-02-19, a projection key of "" incorrectly spreads its object into the parent, and your query depends on that.
After bump
From 2025-02-19 the bug is fixed and the result keeps a literal "" key, so the response shape changes.

releases

info· boundary 2025-02-19

Bumping adds Content Release versions to raw results

raw-bump-adds-versions
perspective = rawANDapiVersion < 2025-02-19
Now
Before 2025-02-19, raw returns published and drafts.* documents only. versions.* documents are not returned.
After bump
From 2025-02-19, raw also returns versions.* documents, so result sets can grow and include unreleased content.
warning· boundary 2025-02-19

raw also returns Content Release versions

raw-now-includes-versions
perspective = rawANDapiVersion ≥ 2025-02-19
Now
At API version 2025-02-19 or later, raw returns versions.* documents (Content Release versions) in addition to drafts.* and published documents. Code that only expects two kinds of IDs may show duplicates.
After bump
This already applies at your pinned version.
warning· boundary 2025-02-19

Release queries return nothing at this API version

versions-invisible-pre-2025
query matches /…/ANDapiVersion < 2025-02-19
Now
Your queries look for Content Release versions, but API versions before 2025-02-19 never return versions.** documents.
After bump
From 2025-02-19 the version documents become visible to these queries.

studio

warning· boundary 2025-02-19

Studio useClient can’t see Content Releases

useClient-releases
callSite = useClientANDapiVersion < 2025-02-19
Now
This Studio client pins an API version before 2025-02-19, so it never sees versions.** documents. Plugins and custom inputs built on it will ignore Content Releases.
After bump
At 2025-02-19 with perspective: raw, the client sees drafts, published documents, and release versions.