-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting drive items requires 2 separate requests in Microsoft Graph SDK v6 #2275
Comments
Thanks for reaching out @ernar23. Yes, batch requests should be possible however I found a bug when trying to implement a sample for this. Should have this resolved in the next couple of days. |
Thanks for your response, @Ndiritu. I will reiterate my first question: Is there a way to send such requests as one single request instead of a batch request using SDK request and model classes? I found a way how I can do it using
This approach is too manual and requires boilerplate code, which essentially nullifies the benefits of using the SDK. |
@ernar23 yes it's possible without executing a batch request. DriveItem driveItem = graphServiceClient.drives().byDriveId("").items().byDriveItemId("").withUrl(
"https://graph.microsoft.com/v1.0/users/{user-id}/drives/{drive-id}/items/{item-id}"
).get(); |
Thanks @Ndiritu , it seems to work. What was the reason for removing those paths from v6? They exist in v5 and were very helpful in creating requests by userId. |
@ernar23 we did this to reduce the size of the generated SDK by generating only the canonical paths to resources e.g. to access drives etc using |
As guided above, including all the possible paths for drive would drastically increase the size of the SDK due the increase in redundant paths. The way forward would be to use the WithUrl method to override the path to avoid the making multiple calls as guided by @Ndiritu We'll close this one for now. Please feel free to create a new issue incase of anything. |
In Microsoft Graph SDK v6, the way to get drive items has changed a bit (based on https://github.com/microsoftgraph/msgraph-sdk-java/blob/main/docs/upgrade-to-v6.md#drive-item-paths), and now getting items by userId requires 2 separate requests:
Get drive by userId:
Get items:
In Microsoft Graph SDK Java v5, it is possible to get a drive item in one request:
2 questions:
This is concerning because we will reach throttling 2x faster if we use Microsoft Graph SDK v6.
The text was updated successfully, but these errors were encountered: