MSGraphClient not returning data
Category
- [X] Question
- [ ] Typo
- [X] Bug
- [ ] Additional article idea
Expected or Desired Behavior
I am trying to get a file metadata stored in document library in SP Online using MSGraphClient class. The version of SPFx is the latest - 1.6.0.
First I get all drives for the selected site collection using:
/sites/{tenant}:{site collection}:/drives
then filter the result to get the Id of Documents library, then send another request to get all files in the document library using:
/sites/{tenant}/drives/{Document library Id}/root/children
Observed Behavior
The first request successfully returns all document libraries that are in the site collection. The second request always return empty array even that there is a file stored in the document library. Tried the same request in the Graph Explorer with the same user, which is the Global Administrator, and the request returns the file. Have granted all possible options for Microsoft Graph for the tenant - 55 application permissions and 108 delegated permissions but no luck.
I think I found the issue. It seems there is some delay for the permissions to apply and MS Graph to start returning the data after Approving then in the Api Management page.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues