[英]Using $expand in Graph API query with multiple attributes?
Is it possible to $expand multiple attributes. 是否可以扩展多个属性。 For example:
例如:
https://graph.microsoft.com/beta/me ?$expand=memberOf,manager https://graph.microsoft.com/beta/me?$ expand = memberOf,manager
This will result in an error. 这将导致错误。
The result of parsing $expand contained at least 2 items, but the maximum allowed is 1.
解析$ expand的结果至少包含2个项目,但允许的最大值为1。
Please refer to document($expand section) : 请参考文档($ expand部分):
https://developer.microsoft.com/en-us/graph/docs/overview/query_parameters https://developer.microsoft.com/en-us/graph/docs/overview/query_parameters
If you query on the user resource, you can use $expand to get the properties of only one child object or collection at a time.
如果查询用户资源,则可以使用$ expand一次仅获取一个子对象或集合的属性。
And here is a discussion about same topic : 这是关于同一主题的讨论:
However, specific entities may still have limits and for users it is still limited to a single expanded navigation.
但是,特定实体可能仍然有限制,并且对于用户而言,它仍然仅限于单个展开的导航。 That is not expected to change.
预计这种情况不会改变。
EDIT: I know this is quite an old question, but for anyone ending here in the future: 编辑:我知道这是一个很老的问题,但对于将来在这里结束的任何人:
It is possible (in some cases) with the following syntax: 使用以下语法是可能的(在某些情况下):
$expand=relation1($select=id,name),relation2($expand=relation2a($select=id))
It is difficult to determine where expands will work since the documentation is quite evasive, but I have made the above work successfully. 由于文档很容易规避,因此很难确定扩展将在哪里工作,但是我已经成功完成了上述工作。 Perhaps the missing piece for your case is to specify the inner query paremeters in your expands?
也许您遇到的情况缺少的部分是在扩展中指定内部查询参数?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.