config

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config provides router configuration types, parsing, and schema output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SchemaJSON

func SchemaJSON() string

SchemaJSON returns a JSON Schema document describing the router configuration.

Types

type APQ

type APQ struct {
	Enabled bool `yaml:"enabled"`
}

APQ configures Automatic Persisted Queries.

type Batching

type Batching struct {
	Enabled bool   `yaml:"enabled"`
	Mode    string `yaml:"mode"`
}

Batching configures query batching.

type CORS

type CORS struct {
	AllowCredentials bool     `yaml:"allow_credentials"`
	AllowMethods     []string `yaml:"allow_methods"`
	ExposeHeaders    []string `yaml:"expose_headers"`
	AllowHeaders     []string `yaml:"allow_headers"`
	AllowOrigins     []string `yaml:"allow_origins"`
}

CORS configures cross-origin resource sharing.

type Config

type Config struct {
	Supergraph  Supergraph  `yaml:"supergraph"`
	HealthCheck HealthCheck `yaml:"health_check"`
	Homepage    Homepage    `yaml:"homepage"`
	Sandbox     Sandbox     `yaml:"sandbox"`
	CORS        CORS        `yaml:"cors"`
	APQ         APQ         `yaml:"apq"`
	Batching    Batching    `yaml:"batching"`
}

Config is the top-level router configuration.

func Default

func Default() Config

Default returns a Config with all values set to the Apollo Router defaults.

func Parse

func Parse(data []byte) (Config, error)

Parse parses YAML config bytes into a Config, starting from Default values. Returns an error if the YAML is malformed or fails semantic validation.

type HealthCheck

type HealthCheck struct {
	Listen  string `yaml:"listen"`
	Enabled bool   `yaml:"enabled"`
	Path    string `yaml:"path"`
}

HealthCheck configures the health check endpoint.

type Homepage

type Homepage struct {
	Enabled bool `yaml:"enabled"`
}

Homepage configures the landing page served at the GraphQL path.

type Sandbox

type Sandbox struct {
	Enabled bool `yaml:"enabled"`
}

Sandbox configures the Apollo Sandbox explorer UI.

type Supergraph

type Supergraph struct {
	Listen                    string `yaml:"listen"`
	Path                      string `yaml:"path"`
	Introspection             bool   `yaml:"introspection"`
	DeferSupport              bool   `yaml:"defer_support"`
	ConnectionShutdownTimeout string `yaml:"connection_shutdown_timeout"`
}

Supergraph configures the main GraphQL endpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL