Build configs
Introduction
Build configs are used to define the resources and other configurations required to build a supergraph, subgraph or a connector. They are written in YAML and are defined in individual files.
It's helpful to think of build configs as a blueprint for building your supergraph.
Supergraph config
The Supergraph object defines the configuration used to build the supergraph. While projects
are generated with default configs for building for local or Hasura DDN, you can add as many Supergraph
objects as you
need to define different configurations for building your supergraph.
Subgraph config
Each subgraph in your supergraph has its own config. The Subgraph object defines the
configuration used to build the subgraph. While subgraphs are generated with a default config, you can add as many
Subgraph
objects as you need to define different configurations for building your subgraph.
Connector config
Each data connector in your supergraph has its own config. The
Connector object defines the configuration used to build the connector. This allows you to
configure the capabilities of the connector and tailor it to your needs. While connectors are initialized with default
configs for building for local or Hasura DDN, you can add as many Connector
objects as you need to define different
configurations for building your connector.
Metadata structure
Supergraph
Defines the configuration used to build the Supergraph.
Key | Value | Required | Description |
---|---|---|---|
kind | Supergraph | true | |
version | v2 | true | |
definition | SupergraphDefinitionV2 | true |
SupergraphDefinitionV2
Supergraph Definition V2.
Key | Value | Required | Description |
---|---|---|---|
subgraphs | [string] | true | Paths to subgraph configuration. |
Subgraph
Defines the configuration used to build the Subgraph.
Key | Value | Required | Description |
---|---|---|---|
kind | Subgraph | true | |
version | v1 | true | |
definition | SubgraphDefinitionV1 | true |
SubgraphDefinitionV1
Subgraph Definition.
Key | Value | Required | Description |
---|---|---|---|
generator | SubgraphGeneratorConfig | true | Subgraph generator Configuration. |
envFile | string | false | Path to the Subgraph .env file. |
includePaths | [string] | true | Paths to be included to construct Subgraph metadata. |
name | string | true | Subgraph Name. |
SubgraphGeneratorConfig
Subgraph generator Configuration.
Key | Value | Required | Description |
---|---|---|---|
rootPath | string | true | Path to the directory which holds all the Subgraph metadata. |
graphqlRootFieldPrefix | string | false | Prefix to use while generating GraphQL root fields. |
graphqlTypeNamePrefix | string | false | Prefix to use while generating GraphQL type names. |
namingConvention | string | false |
Connector
Defines the configuration used to build the connector.
Key | Value | Required | Description |
---|---|---|---|
kind | Connector | true | |
version | v1 | true | |
definition | ConnectorDefinitionV1 | true |
ConnectorDefinitionV1
Connector deployment definition.
Key | Value | Required | Description |
---|---|---|---|
name | string | true | Connector name. |
subgraph | string | false | DDN project subgraph name. |
source | string | true | Connector Hub ID. |
context | string | true | Path to the context directory. |
envFile | string | false | Path to the shared .env file. |
regionConfiguration | [RegionConfiguration] | false | Connector deployment Region configuration |
RegionConfiguration
Connector deployment Region Configuration.
Key | Value | Required | Description |
---|---|---|---|
region | string | true | Region to deploy the connector to. |
mode | ReadOnly / ReadWrite | true | Connector deployment mode. |
envFile | string | false | Path to the regional .env file. |