$odata.count = -1!?

Jacob Pedersen 1 Reputation point
2021-11-23T16:48:53.86+00:00

I'm experiencing same issue as https://github.com/microsoftgraph/microsoft-graph-docs/issues/3848 with some tenants - but not all.

Query:
/v1.0/me/mailFolders/<id>/messages?$filter=isRead%20ne%20true&$count=true&$top=10

Response:
151961-image.png

Clearly there are 10 or more mails, but $odata.count is -1. This means that proper pagination is not possible to implement and I'm fairly sure the API is broken. What triggers this is beyond me, since same code works for some tenants but not others. It could appear that the issue is related to the $top and having more than this matches, but not sure.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,014 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.