Graph - Modify the Expand Method to allow TOP and Paging
I would like to suggest allowing a TOP on the Expand method and implementing paging. Currently only the first 20 records are being returned and there is no way to get more records. 20 seems arbitrary, and well useless at this point. The reason is that a good number of calls might get away with one call to the Graph server vs several, unless of course separate calls are being made under the covers anyway. I would liken this to doing an Include in the Entity Framework Core world whereby I could pull thousands of records for a child table for instance if I so chose (my call based on perf and the workload). Maybe the graph world is different but I think it is the developer who should be able to determine how many trips to the server vs the number of records returned performance ratio. In any case a arbitrary number of 20 max records is way too small of a limit not to mention dangerous to the developer who is expecting a return set of what they see in say AD. Its only after reading a tucked away paragraph in the bottom part of the Exapnd page in teh API docs does it mention a limit of the FIRST 20.
Agree that this half-way house support is a bit ridiculous. We would have been better off failing the request as not supported, than have this return 20 max items behavior.
Anyway, we’ll be looking at how we can enable paging support on expanded collections, but in the meantime this type of operation may first return a 400 in the future (conscious that this is a breaking change).
Hope this helps,