A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
I had this exact same problem and finally found a solution. It is a nuance with the difference between the listItem and driveItem APIs. Basically the delta query for the driveItem API gives you the information you need that the listItem delta query is lacking.
However, there is a caveat to the way that you call the driveItem delta query. The API documentation says that you can do a GET /sites/{siteId}/drive/root/delta to fetch the changes to the driveItems in a given site. But that doesn't seem to always return all of the data you need (or doesn't actually track all of the changes properly). When you call the same drive delta API with GET /drives/{drive-id}/root/delta, it returns all of the information you need for handling deleted data. It returns a deleted state and the relevant parent reference information to ensure you can properly identify that item in your system.
Here is a link to the documentation for reference: https://learn.microsoft.com/en-us/graph/api/driveitem-delta?view=graph-rest-1.0&tabs=http
Some other notes that were relevant for my use case:
- If you need the
listIteminformation (for processing non-deletes) you can always use?$expand=listItemto get that information. - If you don't know the
drive-idfor your site, just a simple fetch to theGET /sites/{siteId}endpoint with a?$expand=drivequery param will give you the drive information you need to call the drive delta query. You can also use that query param on the sites list query.