Back to Content Management API
siteSettingsHistory
Returns an array of all revisions for the site settings by ID paginated by a cursor.
Arguments
- Name
id
- Type
- ID!
- Description
The ID of the site settings object.
- Name
after
- Type
- String
- Description
Returns the elements that come after the specified cursor.
- Name
before
- Type
- String
- Description
Returns the elements that come before the specified cursor.
- Name
first
- Type
- Int
- Description
Returns up to the first
n
elements from the list.
- Name
last
- Type
- Int
- Description
Returns up to the last
n
elements from the list.
Returns
- Name
SiteSettingsRevisionConnection.edges
- Type
- [SiteSettingsRevisionEdge!]!
- Description
A list of edges.
- Name
SiteSettingsRevisionConnection.nodes
- Type
- [SiteSettingsRevision!]!
- Description
A list of the nodes contained in SiteSettingsRevisionEdge.
- Name
SiteSettingsRevisionConnection.pageInfo
- Type
- PageInfo!
- Description
Information to aid in pagination.
- Name
SiteSettingsRevisionConnection.totalCount
- Type
- Int
- Description
The total count of items.
Request
import { PackClient } from '@pack/client'
const packClient = new PackClient({
token: 'YOUR-PACK-TOKEN'
});
const query = `
query siteSettingsHistory($id: ID!, $after: String, $before: String, $first: Int, $last: Int) {
siteSettingsHistory(id: $id, after: $after, before: $before, first: $first, last: $last) {
edges {
cursor
node {
id
seo
}
}
totalCount
}
}
`
const variables = {
id: 'site-settings-id',
first: 10
}
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);
Response
{
"data": {
"siteSettingsHistory": {
"edges": [
{
"cursor": "cursor",
"node": {
"id": "site-settings-id",
"seo": {
"title": "SEO Title",
"description": "SEO Description",
"keywords": "SEO Keywords"
}
}
}
],
"totalCount": 1
}
}
}