I've been trying to switch between SharePoint REST API and Graph API and I can't find an equivalent of breakroleinheritance()
_api/web/GetFileByServerRelativeUrl('/sites/sitename/Shared%20Documents/foldername')/ListItemAllFields/breakroleinheritance(true)
doesn't seem to have a matching functionality in graph.
I tried listing all permissions via
/drives/${driveId}/items/${someFolderId}/permissions
and deleting them one by one, but it silently fails on one permission that's the main owners group and I can't delete it.
Tried looking for role management in Graph API but there's role management only for devices.
How do I break role inheritance through Graph API?