API Versioning - How Do I Create Versions?

4 replies
Last updated: May 25, 2022
Hello folks, have a question about api versioning. We have four different versions: v1, vx, and two explicit date versions. I have no recollection of creating these manually, but maybe I did unintentionally. How do one create api versions? Thanks
May 25, 2022, 9:05 AM
Hi! Where do you see those versions? In the Visio plugin in the Studio? Like here:
May 25, 2022, 9:08 AM
May 25, 2022, 9:08 AM
If I'm not mistaken, these versions are created by the Sanity team. We cannot create new versions ourselves.My screenshot was taken from an old and not up-to-date project, so I guess it's the reason I mîssing "v2021-10-21".
May 25, 2022, 9:11 AM
They‘re hard-coded in the Vision plugin so you can test queries in different versions: https://github.com/sanity-io/sanity/blob/next/packages/%40sanity/vision/src/apiVersions.js . 🙂
May 25, 2022, 1:40 PM

Sanity.io – build remarkable experiences at scale

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