question

JustusNBB-4386 avatar image
0 Votes"
JustusNBB-4386 asked saldana-msft edited

MS Graph OData schema metadata for manager is a directoryObject instead of a graph.user

Introspection of the OData schema (e.g to convert to GraphQL) reveals the Manager's metadata to be insufficiently typed and not declaring any user properties.

Manually tending to the metadata before usage allows to workaround this:

Replace <NavigationProperty Name="manager" Type="graph.directoryObject"/> with <NavigationProperty Name="manager" Type="graph.user"/> in the data from https://graph.microsoft.com/v1.0/$metadata - then the me/manager query also returns user attributes for the manager of the queried user.

Refs MS Uservoice: https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/37700059-add-manager-to-list-users-graph-api

Would you consider this a bug? Can I expect it to get fixed soon?

azure-active-directorymicrosoft-graph-usersmicrosoft-graph-identity
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Adding right tags/teams to assist

0 Votes 0 ·

1 Answer

DanKershaw-5643 avatar image
0 Votes"
DanKershaw-5643 answered JustusNBB-4386 edited

@JustusNBB-4386 Thanks for the question. The reason for this nav property being of type DirectoryObject (the base type for pretty much all objects in the directory services part of Microsoft Graph) is that a manager could also be an organizational contact. Please see https://docs.microsoft.com/en-us/graph/api/user-post-manager?view=graph-rest-1.0&tabs=http#request-body.

Currently we have to use a base type in this kind of schema declaration - I don't think there's a (simple) way to indicate that this navigation property can be 2 or more specific types.

Hope this helps,
Dan.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What's the benefit of the manager being a DirectoryObject by default (instead of an orgContact)? If that is the basetype, it should inherit its behavior (which behavior? I don't see any properties on DirectoryObject). In which use case does one need a manager user instead of a manager contact?

0 Votes 0 ·

Thanks for the link, I see this also gives me the ability to use orgContact instead of the user type which probably fits better for my use case.

0 Votes 0 ·