Versioning

Querying for version history

Versions are only available on PUBLISHED content stages.

Query

{
articles(stage: PUBLISHED) {
history {
id
revision
}
}
}

Output

{
"data": {
"articles": [
{
"history": [
{
"id": "abc123",
"revision": 1
},
{
"id": "xyz456",
"revision": 2
}
]
}
]
}
}

Querying for a single version

Querying modelVersion exposes an additional field called data that returns a simple query of the complete data model. This is only available when querying single entries.

Query

{
articleVersion(where: { id: "abc123", revision: 1, stage: PUBLISHED }) {
id
revision
data
}
}

Output

{
"data": {
"articleVersion": {
"id": "abc123",
"revision": 1,
...data
}
}
}

Were you expecting something more?

We are constantly contributing to our documentation, but if you spot something we're missing, let us know and we'll be sure to add it.

This site uses cookies to provide you with a better user experience. For more information, refer to our Privacy Policy