Graph explorer returns unsupported query when I execute
https://graph.microsoft.com/v1.0/users?$select=id,usageLocation&$filter=usageLocation+eq+null
However, the filter for null on usageLocation should be supported according to documentation: https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http
Am I missing something, or is the documentation wrong here?
I tried to reproduce the same in my environment and got below results:
When I ran same query as you in Graph Explorer, I too got same error like this:
GET https://graph.microsoft.com/v1.0/users?$select=id,usageLocation&$filter=usageLocation+eq+null
Response:
As mentioned in this MS documentation,
The
$filter
operator requires advanced query parameters, which are:ConsistencyLevel=eventual
header and$count=true
query string
To resolve the error, you need to add advanced query parameters like below:
GET https://graph.microsoft.com/v1.0/users?$select=id,usageLocation&$filter=usageLocation+eq+null&$count=true
ConsistencyLevel: eventual
Response: