On this page

OData / Microsoft Graph

GraphQL Mesh v0 documentation (superseded by v1): Discover how to load remote OData metadata as GraphQL Schema with GraphQL Mesh's OData/Microsoft Graph handler. Get started with a few simple steps!

image

This handler allows you to load remote OData metadata/schema as GraphQL Schema.

To get started, install the handler library:

npm i @graphql-mesh/odata

Now, you can use it directly in your Mesh config file:

.meshrc.yaml
sources:
  - name: TripPin
    handler:
      odata:
        endpoint: https://services.odata.org/TripPinRESTierService/

Headers

Read about configuration and examples

CodeSandBox Example

You can check out our TripPin example that uses the OData handler.

Config API Reference

  • endpoint (type: String, required) - Base URL for OData API
  • source (type: String) - Custom $metadata File or URL
  • schemaHeaders (type: JSON) - Headers to be used with the $metadata requests
  • operationHeaders (type: JSON) - Headers to be used with the operation requests
  • batch (type: String (multipart | json)) - Enable batching
  • expandNavProps (type: Boolean) - Use $expand for navigation props instead of seperate HTTP requests (Default: false)