Save the post parent in a custom post type in Gutenberg

A plugin I’m developing registers two custom post types: Class and Student. Both are connected via the post_parent property in the Student post type (one student belongs to one class). I added a SelectControl control to the PluginDocumentSettingPanel in the Student post type edit screen to be able to set a Class for the Student.
Everything is working except the saving part. The changes are not saved. Any ideas?

Thanks in advance

UPDATE: The previous code is correct, but one needs to expose the parent field for non-hierarchical post types using the register_rest_field() function (Props to @Sally CJ):