GraphQL

image

This handler allows you to load remote GraphQL schemas and use it with schema-stitching, based on graphql-tools.

To get started, install the handler library from NPM:

$ yarn add @graphql-mesh/graphql

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

sources:
- name: MyGraphQLApi
handler:
graphql:
endpoint: http://my-service-url:3000/graphql

You can check out our example that uses schema stitching with a PostgreSQL datasource. Click here to open the example on GitHub

Config API Reference

  • endpoint (type: String, required) - A url to your remote GraphQL endpoint
  • headers (type: JSON) - JSON object representing the Headers to add to the runtime of the API calls
  • useGETForQueries (type: Boolean) - Use HTTP GET for Query operations
  • method (type: String (GET | POST)) - HTTP method used for GraphQL operations
  • enableSubscriptions (type: Boolean) - Enable GraphQL Subscriptions using WebSocket
  • customFetch (type: String) - Path to a custom W3 Compatible Fetch Implementation
  • webSocketImpl (type: String) - Path to a custom W3 Compatible WebSocket Implementation
  • cacheIntrospection (type: Boolean) - Cache Introspection