We are developing a people search webpart for an organisation with 1000's of users. One request we had was to add a text input that would filter the users by a managers name.
I am new to Microsoft graph and struggling to come up with anything that will bring back these results.
The only way I can see how to do it is to do the following:
Get all the users when the webpart is initially rendered by doing multiple calls to the graph api users endpoint. Multiple calls are needed to get the users in batches (due to the top limit of 999 results in one call).
Iterate over these results and get the manager of each user.
Filter the results based on managers name.
I feel like this will be very slow and cumbersome. I have looked at using the expand functionality on the query but can't figure out what I need to do, or if it is even possible to do this.
Any insight would be much appreciated. Haven't been able to find anything throughout my web searches.