Watch a live product demo 👀 See how Sanity powers richer commerce experiences

API Version Concept Explainer - How API Versions Work

4 replies
Last updated: Apr 25, 2021
Hello can anyone explain me that what is the concept of the API version?
Apr 25, 2021, 9:49 AM
Versioning an API allows Sanity to make improvements and changes that would otherwise break current implementations of the API.
I would think of it like electric cars. The electric car introduced a new technology but it depends on a new fuel source that couldn’t be obtained from a “traditional” gas station. You can’t just change all gas stations to charging stations, since then all the people with cars that use gasoline would have no way of fueling up. Instead, we “version” fueling stations—v1 are gas stations and v2 are electric charging stations—that permit both types of cars to function and fuel up.

Could gas stations have been adapted to charge electric cars (which is kind of like always introducing “upgrades” that never break old versions)? Probably, but that’s terribly inefficient and would require incremental upgrades as society increases its use of electric cars. At some point in the future, when there are no more gasoline cars, you’d still have some archaic throwbacks to those days that don’t make any sense and probably make things harder for people (e.g., a bunch of tanks in the ground). This approach (one version) might have its place, but overall the most efficient approach is having different, dedicated locations/versions.
Apr 25, 2021, 2:59 PM
Thanks a lot,
user A
so, whenever we put a date as our API version so, the changes after that days will not be implemented to my app so that it will help in keeping my app working right?
Apr 25, 2021, 4:37 PM
Yes, that’s correct. You’d be using the most recent API version that was released on or before that date. The only updates to an API version you might expect after-the-fact would be ones that Sanity deems wouldn’t break anything .
Apr 25, 2021, 5:04 PM
Thanks,
user A
Apr 25, 2021, 5:55 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.

Categorized in

Related answers

Get more help in the community Slack

TopicCategoriesFeaturedRepliesLast Updated
After adding the subtitle and running this code npm run graphql-deploy It does nothingSep 15, 2020
how to limit a reference to just one entry in Studio reference input side versus the default as-many-entries-as-you-fill-in-an-array...Sep 18, 2020
Is it possible to fetch more than one "_type" using GROQ?Nov 2, 2020
I want to add a view with the Structure builder (S.view.component) where I list similar documents based on the title. What...Sep 23, 2020
Is there a structure builder example where the format of each preview for the document list is modified?Feb 3, 2021
I have an array of references to a country schema type but it always just returns NULL values for meJan 30, 2021
Hi, I need help with a query for getting the url of an image asset. Here is what I've been trying, but I only get the _ref...Dec 1, 2020
Sanity UI looks brilliant :smiley: Is something like the current date picker possible at the moment? I’m not sure if anicon...Dec 21, 2020
Hey everyone. I have been coding and may have potentially accidentally deleted something. Does anyone know how to resolve...Dec 26, 2020
Hello everyone and happy new year :raised_hands::skin-tone-2:, I have a problem with outputting Portable Text :disappointed:...Jan 1, 2021

Related contributions

Clean Next.js + Sanity app
- Template

Official(made by Sanity team)

A clean example of Next.js with embedded Sanity ready for recomposition.

Cody Olsen
Go to Clean Next.js + Sanity app

Blog with Built-in Content Editing
- Template

Official(made by Sanity team)

A Sanity-powered blog with built-in content editing and instant previews.

Go to Blog with Built-in Content Editing