Skip to content

Files

Latest commit

 

History

History

odata-microsoft

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

GraphQL Mesh for Microsoft Graph

Note: This project is based on Microsoft's GraphQL for Microsoft Graph Demo

About

This is a demo that enables basic, read-only querying of the Microsoft Graph API using GraphQL query syntax. GraphQL enables clients to request exactly the resources and properties that they need instead of making REST requests for each resource and consolidating the responses. To create a GraphQL service, this demo translates the Microsoft Graph OData $metadata document to a GraphQL schema and generates the necessary resolvers. Please note we are providing this demo code for evaluation as-is.

Animation of sample request

Installation

  1. Clone the repo
  2. Install dependencies (npm install)
  3. Navigate to the App Registration Portal, set up a new web app
  4. Configure App Id and redirect URIs in the AppConfiguration of build/index.html
  5. Run npm start and go to localhost:4000

Sample requests

Fetch recent emails

{
  me {
    displayName
    officeLocation
    messages {
      subject
      isRead
      from {
        emailAddress {
          address
        }
      }
    }
  }
}

Fetch groups and members

{
  groups {
    displayName
    description
    members {
      id
    }
  }
}

Fetch files from OneDrive

{
  me {
    drives {
      quota {
        used
        remaining
      }
      root {
        children {
          name
          size
          lastModifiedDateTime
          webUrl
        }
      }
    }
  }
}