Catch the highlights of GraphQLConf 2023! Click for recordings. Or check out our recap blog post.
Docs
Configuration
General

Configuration File

This section describes the top-level configuration object for Conductor gateway.

Conductor supports both YAML and JSON format for the configuration file.

Loading the config file

The configuration is loaded when server starts, based on the runtime environment you are using:

Binary

If you are running the Conductor binary directly, you can specify the configuration file path using the first argument:

 
conductor my-config-file.json
 

By default, Conductor will look for a file named config.json in the current directory.

Docker

If you are using Docker environment, you can mount the configuration file into the container, and then point the Conductor binary to it:

 
docker run -v my-config-file.json:/app/config.json the-guild-org/conductor:latest /app/config.json
 

CloudFlare Worker

WASM runtime doesn't allow filesystem access, so you need to load the configuration file into an environment variable named CONDUCTOR_CONFIG.

Autocomplete/validation in VSCode

For JSON files, you can specify the $schema property to enable autocomplete and validation in VSCode:

config.json
 
{ "$schema": "https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json" }
 

For YAML auto-complete and validation, you can install the YAML Language Support extension and enable it by adding the following to your YAML file:

config.yaml
 
$schema: "https://raw.githubusercontent.com/the-guild-org/conductor/master/libs/config/conductor.schema.json"
 

JSONSchema

As part of the release flow of Conductor, we are publishing the configuration schema as a JSONSchema file.

You can find here the latest version of the schema.

Configuration Interpolation with Environment Variables

This feature allows the dynamic insertion of environment variables into the config file for Conductor. It enhances flexibility by adapting the configuration based on the runtime environment.

Syntax for Environment Variable Interpolation: - Use ${VAR_NAME} to insert the value of an environment variable. If VAR_NAME is not set, an error will pop up. - Specify a default value with ${VAR_NAME:default_value} which is used when VAR_NAME is not set. - Escape a dollar sign by preceding it with a backslash (e.g., \$) to use it as a literal character instead of triggering interpolation.

Examples: - endpoint: ${API_ENDPOINT:https://api.example.com/} - Uses the API_ENDPOINT variable or defaults to the provided URL. - name: \$super - Results in the literal string name: \$super in the configuration.

Configuration

Reference

cache_stores
array
optional

List of global cache stores to register that can be later attached to the caching plugin globally or under individual endpoints

endpoints
array
required

List of GraphQL endpoints to be exposed by the gateway. Each endpoint is a GraphQL schema that is backed by one or more sources and can have a unique set of plugins applied to.

For additional information, please refer to the Endpoints section.

logger
optional

Conductor logger configuration.

level
enum
default: "info"

Log level

plugins
array
optional

List of global plugins to be applied to all endpoints. Global plugins are applied before endpoint-specific plugins.

server
optional

Configuration for the HTTP server.

host
string
default: "127.0.0.1"

The host to listen on, default to 127.0.0.1

port
integer
default: 9000

The port to listen on, default to 9000

sources
array
required

List of sources to be used by the gateway. Each source is a GraphQL endpoint or multiple endpoints grouped using a federated implementation.

For additional information, please refer to the Sources section.