Versioning and Drafts
Versions
All objects in Skylark are subject to versioning and all metadata are grouped into two field types:
- Language: These fields are translatable into different languages, for example title or synopsis
- Global: These fields are non-translatable, for example date or episode number
These field types are versioned independently. Meaning, you never need to worry about updating or keeping track of your global fields as you add translations or make changes to language based fields.
To visualize that, the version history for a single object may look like this:
{
"global": [1],
"en-GB": [1, 2, 3],
"fr-FR": [1, 2, 3, 4, 5],
"de-DE": [1]
}
As you can see, a single global version exists, then different sets of versions for each translation.
You can roll back and forward through versions using the update mutation.
Drafts
By default, when you update an object in Skylark it's automatically published. However it's also possible to save a new version as draft and view the API in "draft mode".
See here for how to save an update as draft.
By sending the x-draft
header as true, all responses from the API will return the latest version for both global and language fields.
{
"x-draft": true
}
When a draft is ready to be published, use the update mutation to roll the published version forward.
Updated 6 months ago