
Show HN: Use GraphQL to Query Exchange, AAD, OneDrive and More - dpim
http://graphql-demo.azurewebsites.net/?query=%7B%0A%20%20me%20%7B%0A%20%20%20%20displayName%0A%20%20%20%20officeLocation%0A%20%20%20%20skills%0A%20%20%20%20directReports%20%7B%0A%20%20%20%20%20%20id%0A%20%20%20%20%7D%0A%20%20%20%20messages(id%3A%20%22AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEMAAAiIsqMbYjsT5e-T7KzowPTAAAeUQdXAAA%3D%22)%20%7B%0A%20%20%20%20%20%20subject%0A%20%20%20%20%20%20isRead%0A%20%20%20%20%20%20bodyPreview%0A%20%20%20%20%20%20sentDateTime%0A%20%20%20%20%20%20sender%20%7B%0A%20%20%20%20%20%20%20%20emailAddress%20%7B%0A%20%20%20%20%20%20%20%20%20%20address%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A
======
dpim
I built this demo during Microsoft's internal hackathon, Oneweek, to show what
GraphQL querying of the Microsoft Graph API could look like. While not all
GraphQL functionality is currently implemented (namely support for pagination,
data mutations), I think it's quite cool to be able to request resources from
different services in a single request (eg. fetching my recent emails,
OneDrive files, users in my org). The gist of how this works: the tooling
translates an OData schema into a GraphQL schema and code generates resolvers
for each field.

Here is the repo if you'd like to self-host the service:
[https://github.com/microsoftgraph/msgraphql-
demo](https://github.com/microsoftgraph/msgraphql-demo)

We're interested in your feedback about integrating with Microsoft Graph using
GraphQL. To share your thoughts and scenarios, please leave a comment on
UserVoice: [https://officespdev.uservoice.com/forums/224641-feature-
requ...](https://officespdev.uservoice.com/forums/224641-feature-requests-and-
feedback/suggestions/16819672-graphql-api-for-the-microsoft-graph)

I'm happy to answer questions about Microsoft Graph or the implementation of
this project.

------
peternicky
Cool, however, to realize the full benefits of GraphQL, proper resolvers need
to be implemented that are connected directly to a data store. This is just a
wrapper around a conventional REST endpoint, which allows for easier querying
but not much else (when considering the trade offs).

~~~
dpim
I hear you. This was a fun project to adapt an existing standard (OData) to be
compatible with GraphQL and get a sense of what that looks like over a really
big API (hundreds of types, thousands of facets). Part of this is also to see
whether as a developer, it makes integrating with Microsoft Graph easier or
faster. I'd love to hear your thoughts.

------
PaulHoule
Got documentation for this?

~~~
dpim
In Graphiql, you can use the docs panel on the right to expand the available
resources and properties they contain.

Here is more in-depth API documentation of Microsoft Graph (the underlying
API): [https://developer.microsoft.com/en-
us/graph/docs/concepts/ov...](https://developer.microsoft.com/en-
us/graph/docs/concepts/overview)

If you're looking for documentation on the tooling itself, the repo has an
overview of how this works and I can provide further context.

------
Hongbo-Miao
Looks awesome!

