Skip to content

storeContentPreview

Mutationin Content

Store content preview data for a path, so a CMS editor can preview unpublished changes. Takes the serialised draft as a JSON string and returns the id to preview it under. A CMS that serves drafts natively answers this with a NOT_SUPPORTED error; query with version: DRAFT there instead.

Arguments

ArgumentTypeDescription
pathString!
dataString!

Returns

StoreContentPreviewResponse!

FieldTypeDescription
dataStoreContentPreviewDataResponse containing the stored content preview data.
previewErrors[StoreContentPreviewError!]List of errors encountered while storing the content preview.

Example

mutation StoreContentPreview($path: String!, $data: String!) {
storeContentPreview(path: $path, data: $data) {
data {
id
}
previewErrors {
__typename
... on ValidationError {
message
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.