This question has been asked before with not much success.
The documentation is totally unclear too. It implies that to create a new list item one would do the following. But doesn't give a specific example on attachments.
The listitem documentation has a sneaky caveat right at the end which says that files/document libraries are treated as driveitems:
For document libraries, the driveItem relationship exposes the listItem as a driveItem
Right, so does that mean that all files are then related to driveitems? It seems closer as the driveitem docs talk about the following example (indicating site-related content which is SharePoint)
PUT /sites/{site-id}/drive/items/{parent-id}:/{filename}:/content
But the above route doesn't specify a list-id either an item-id. So how does that fit in?
Which route do we hit to upload attachments on a list item? I have tried numerous requests:
PUT - https://graph.microsoft.com/v1.0/sites/root/drive/items/1/createUploadSession (not list id though?)