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