storeContentPreview
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
| Argument | Type | Description |
|---|---|---|
path | String! | |
data | String! |
Returns
| Field | Type | Description |
|---|---|---|
data | StoreContentPreviewData | Response 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 } } }}{ "path": "/example", "data": "Example"}{ "data": { "storeContentPreview": { "data": { "id": "id-1" }, "previewErrors": [ { "__typename": "ValidationError", "message": "Example" } ] } }}The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

