Merge pull request #8616 from creative-commoners/pulls/4.3/rolling-out-rollback-docs

DOCS Updating HistoryViewer documentation to specify the rollback mutation instead of copyToStage
This commit is contained in:
Robbie Averill 2018-11-19 12:01:51 +01:00 committed by GitHub
commit 6d6ce61b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1013,7 +1013,6 @@ SilverStripe\GraphQL\Manager:
MyVersionedObject:
fields: [ID, LastEdited]
operations:
copyToStage: true
readOne: true
SilverStripe\Security\Member:
fields: [ID, FirstName, Surname]
@ -1147,13 +1146,11 @@ import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
const mutation = gql`
mutation revertMyVersionedObjectToVersion($id:ID!, $fromStage:VersionedStage!, $toStage:VersionedStage!, $fromVersion:Int!) {
copyMyVersionedObjectToStage(Input: {
mutation revertMyVersionedObjectToVersion($id:ID!, $toVersion:Int!) {
rollbackMyVersionedObject(
ID: $id
FromVersion: $fromVersion
FromStage: $fromStage
ToStage: $toStage
}) {
ToVersion: $toVersion
) {
ID
}
}
@ -1161,12 +1158,10 @@ mutation revertMyVersionedObjectToVersion($id:ID!, $fromStage:VersionedStage!, $
const config = {
props: ({ mutate, ownProps: { actions } }) => {
const revertToVersion = (id, fromVersion, fromStage, toStage) => mutate({
const revertToVersion = (id, toVersion) => mutate({
variables: {
id,
fromVersion,
fromStage,
toStage,
toVersion,
},
});