diff --git a/src/GraphQL/Mutation/MutationType.php b/src/GraphQL/Mutation/MutationType.php index bd919d0ab..4bf98e49f 100644 --- a/src/GraphQL/Mutation/MutationType.php +++ b/src/GraphQL/Mutation/MutationType.php @@ -583,6 +583,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) 'parentId' => ['type' => Type::int()], 'defaultLanguage' => ['type' => Type::string()], 'published' => ['type' => Type::boolean(), 'description' => 'Default is true!'], + 'versionNote' => ['type' => Type::string()], 'omitMandatoryCheck' => ['type' => Type::boolean()], 'userId' => ['type' => Type::int()], 'type' => ['type' => Type::string()], @@ -722,6 +723,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) 'fullpath' => ['type' => Type::string()], 'parentId' => ['type' => Type::int()], 'defaultLanguage' => ['type' => Type::string()], + 'versionNote' => ['type' => Type::string()], 'omitMandatoryCheck' => ['type' => Type::boolean()], 'omitVersionCreate' => ['type' => Type::boolean()], 'userId' => ['type' => Type::int()], @@ -938,6 +940,7 @@ public function buildCreateAssetMutation(&$config, $context) 'fields' => [ 'success' => ['type' => Type::boolean()], 'message' => ['type' => Type::string()], + 'versionNote' => ['type' => Type::string()], 'assetData' => [ 'args' => ['defaultLanguage' => ['type' => Type::string()]], 'type' => $assetType, @@ -1075,6 +1078,7 @@ public function buildUpdateAssetMutation(&$config, $context) 'fields' => [ 'success' => ['type' => Type::boolean()], 'message' => ['type' => Type::string()], + 'versionNote' => ['type' => Type::string()], 'assetData' => [ 'args' => ['defaultLanguage' => ['type' => Type::string()]], 'type' => $assetType, @@ -1577,7 +1581,7 @@ protected function saveElement($element, $options): void Version::disable(); } - $element->save(); + $element->save(['versionNote' => isset($options['versionNote']) ? $options['versionNote'] : null]); if (isset($options['omitVersionCreate']) && $options['omitVersionCreate'] && !$omitVersionCreateBefore) { Version::enable();