Microsoft Graph, the one endpoint to rule them all, the one API in front of all the other API's in the Microsoft Cloud. I didn't really know how it worked (does it aggregate data, pass through to other API's, or a combination of both), until it didn't work and I had to troubleshoot.

At SharePoint Conference 2018 in Las Vegas I had the honor to have a sit down with Yina Arenas, the Principal Program Manager & allround Microsoft Graph mastermind. I wanted to provide some feedback on how I perceived the (lack of) support for developers having issues working with the Graph. She listened and noted, AND she took a look at my StackOverflow issues. That's when she pulled a trick that I never saw before, nor found documented anywhere...

You can see whatever happens with each request by appending $whatif to the end of the URL as a query string parameter! It shows how the Graph would handle your request, without actually executing it!

You can use the Microsoft Graph Explorer to test this out. A simple request to get "My profile" (GET returns:

    "@odata.context": "$metadata#users/$entity",
    "businessPhones": [
        "+1 412 555 0109"
    "displayName": "Megan Bowen",
    "givenName": "Megan",
    "jobTitle": "Auditor",
    "mail": "",
    "mobilePhone": null,
    "officeLocation": "12/1110",
    "preferredLanguage": "en-US",
    "surname": "Bowen",
    "userPrincipalName": "",
    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038"

Now, appending $whatif to the request (GET$whatif) the result changes to:

    "Description":"Execute HTTP request",

This shows that a request for "My profile" gets passed on to the Azure AD Graph to return the results. You can add $whatif to any request, finally showing you where all the information in the Graph is coming from!