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
sources:
- type: "graphql"
id: "my-source"
config:
endpoint: "https://my-source.com/graphql"
endpoints:
- path: "/graphql"
from: "my-source"
plugins:
- type: "graphiql"JSON
{
"sources": [
{
"type": "graphql",
"id": "my-source",
"config": {
"endpoint": "https://my-source.com/graphql"
}
}
],
"endpoints": [
{
"path": "/graphql",
"from": "my-source",
"plugins": [
{
"type": "graphiql"
}
]
}
]
}Reference
fromThe identifier of the Source to be used.
This must match the id field of a Source definition.
pathA 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.
pluginsA 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.