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.