Documentation
Configuration
Endpoints

Endpoint

The Endpoint object exposes a GraphQL source with set of plugins applied to it.

Each Endpoint can have its own set of plugins, which are applied after the global plugins. Endpoints can expose the same source with different plugins applied to it, to create different sets of features for different clients or consumers.

Configuration

Examples

This example demonstrate how to declare a GraphQL source, and expose it as a GraphQL endpoint. The endpoint also exposes a GraphiQL interface.

YAML

endpoints:
  - from: "my-source"
    path: "/graphql"
    plugins:
      - type: "graphiql"
sources:
  - config:
      endpoint: "https://my-source.com/graphql"
      schema_awareness: null
    id: "my-source"
    type: "graphql"

JSON

{
  "endpoints": [
    {
      "from": "my-source",
      "path": "/graphql",
      "plugins": [
        {
          "type": "graphiql"
        }
      ]
    }
  ],
  "sources": [
    {
      "config": {
        "endpoint": "https://my-source.com/graphql",
        "schema_awareness": null
      },
      "id": "my-source",
      "type": "graphql"
    }
  ]
}

Reference

path
string
required

A valid HTTP path to listen on for this endpoint. This will be used for the main GraphQL endpoint as well as for the GraphiQL endpoint. In addition, plugins that extends the HTTP layer will use this path as a base path.

from
string
required

The identifier of the Source to be used.

This must match the id field of a Source definition.

plugins
array
optional

A list of unique plugins to be applied to this endpoint. These plugins will be applied after the global plugins.

Order of plugins is important: plugins are applied in the order they are defined.