🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Understanding version dropdown in Sanity Studio's Vision tab

3 replies
Last updated: Oct 5, 2021
I’m curious what the version dropdown in sanity studio “vision” tab shows. I can’t see how it relates to any of the API versions i think(?) we are using (2021-06-07)
Oct 5, 2021, 7:53 PM
Sorry for the confusion, User. Until earlier this year, GROQ operated on
v1
. That version still exists and can be used both in Vision and in your code.
When it came time to implement versioning, we went with a
date scheme rather than incremental version numbers. The first big release was
2021-03-25
, which is why it’s included in the dropdown.
As changes are made and released, they have that day’s date as their version. This allows me to use today’s date (
2021-10-05
) as a version and know that it will continue to work going forward. If Sanity decides tomorrow to make a breaking change like switching GROQ comments from
//
to
#
, I’m fine because I’m using API
v2021-10-05
. Anyone using
v2021-10-06
or later would be using
#
for comments. This hopefully also clarifies why we discourage the use of a dynamic date to set the API version. Any particular version can be used in Vision by selecting
Other
in the dropdown and entering the version. (Note: Non-breaking changes may be retroactively added to a version, which is why
sanity::dataset()
works in
v2021-03-25
even though it wasn’t present back in March.)
Finally, there’s
vX
. This is an experimental version that is not stable and is not recommended for production. This lets you use functions and features that aren’t part of any release and may (or may not) be released later.
Oct 5, 2021, 9:04 PM
tl;dr - If you’re using
v2021-06-07
on your front end, then in Vision you’ll want to use either
v2021-03-25
or
Other
->
v2021-06-07
.
Oct 5, 2021, 9:10 PM
Ok, i see, thanks 🙂
Oct 5, 2021, 9:38 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?