Microsoft Graph Group query does not expand relationships when $select is present

↘锁芯ラ 提交于 2019-12-24 08:17:51

问题


I am trying to query group owners along with a few properties of the groups. When I add $select the owners property gets dropped. I need $select to reduce the amount of data returned. Any way to achieve both?

/beta/groups?$expand=owners&$filter=startswith(mailNickname, 'rtan')&$top=999&$select=mailEnabled,owners

Response (has mailEnabled but is missing owners):

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#groups(mailEnabled,owners)",
  "value": [
    {
      "mailEnabled": true
    },
    {
      "mailEnabled": true
    },
    {
      "mailEnabled": true
    }
  ]
}

回答1:


One workaround at the moment to combine both $select and $expand for /groups endpoint would be to specify asterisk (*) character in $select expression.

For example, the following query:

https://graph.microsoft.com/beta/groups?expand=owners&select=owners,*

will return all the group details along with owners




回答2:


Matthieu - thanks for pointing this out. If you try the query without $select you'll see that the expansion does work. This issue is one of our documented known issues (see https://developer.microsoft.com/en-us/graph/docs/concepts/known_issues#query-parameter-limitations). I'm not saying that doesn't make things better - clearly in this case $select and $expand in the same request should just work.

BTW - As Marc correctly points out, it's either or, but this isn't just a groups issue. It's across the board for all directory based entity types (users, groups, devices, applications, service principals, etc).

I don't have an ETA for a fix I'm afraid, but it is something that is being worked on.

Hope this helps,



来源:https://stackoverflow.com/questions/51604124/microsoft-graph-group-query-does-not-expand-relationships-when-select-is-presen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!