I think i found it myself. For anyone else looking for this: there is a patch fΓΌr 2.2 that adds both addRole and removeRole Functions:
Related Issue:
https://www.drupal.org/project/group/issues/3132084 β
Patch that worked for me:
https://www.drupal.org/files/issues/2024-01-16/group_membership_new_meth... β
Hi abramm,
thanks for your quick answer and thanks for pointing me to derivatives. I guess it would be a solution to create a patch, cos in my case it would be just adding my field type to the already existing list in the SimpleFieldDeriver - like I saw in similar cases in this issue board. But a patch seems like an unstable solution to a permanent need, so I created a custom module with another plugin. So that works and again, thanks for pointing me to the right direction. I still think though that this could be made more clear in the documentation.