- Link
- Page
- ...
- Areablock
- Block
- Embed
- Image (for now only target asset + alt text, no hotspots or markers)
- Input
- Multiselect
- Scheduled Block
- Select
- Wysiwyg
There a two modes for document mutations. The Free-form API allows updating single editable content but requires lots of Pimcore insight knowledge. The Tree API provides a more intuitive nested approach for creating and updating documents.
Important Note: To be able to fully exploit this feature you have to understand Pimcore's editable naming strategy
Update or add single or multiple editables by defining their exact name and their content.
mutation {
updateDocumentPage(
id: 99
input: {
editableUpdateStrategy: replaceAll # defaults to update
editables: {
input: [
{ _editableName: "content:2.headline", text: "HEYYOU 3" }
{ _editableName: "headline", text: "NEW 2" }
]
wysiwyg: [
{ _editableName: "content:1.content", text: "my new <b>wysiwyg</b>" }
]
}
module: "mymodule"
}
) {
success
document {
controller
}
}
}
See following list for more examples with the free-form API approach:
- Create document with areablocks and nested block with images
- Update email document
- Create a new link document
If you are not familiar with Pimcore's editable naming strategy you can also use the nested approach.
mutation {
updateDocumentPage(
id: 99
input: {
editables: {
areablock: [
{
_editableName: "content"
items: [
{
type: "headlines"
editables: {
input: [
{
_editableName: "headline"
text: "HEY, I AM A SUBHEADLINE"
}
]
}
}
]
}
]
}
controller: "@AppBundle\\Controller\\ContentController"
action: "default"
}
) {
success
document {
controller
elements {
__typename
}
}
}
}
See following list for more examples with the tree API approach: