Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/server / config
config
Strongly-typed configuration loader for the Graphorin server.
Operators ship a graphorin.config.ts (or .js / .mjs / JSON) file that calls defineConfig to construct a typed config object; the server runtime accepts either the raw object, a path to such a file, or a function that returns one.
Validation is performed via Zod so user-facing errors include the exact path of every failing field, not just a generic "TypeError: undefined".
Interfaces
| Interface | Description |
|---|---|
| ServerConfigSpec | - |
Type Aliases
| Type Alias | Description |
|---|---|
| DeliveryCommentaryPolicyConfig | - |
| IdempotencyRequireKeyMode | - |
| SecretRefString | String literal that flags a value as a SecretRef URI. The server's pre-bind step resolves every *Ref field through the @graphorin/security resolver registry before binding the listener; an unresolvable ref fails fast with import('./errors/index.js').PrebindSecretUnresolvableError. |
| SecretsSource | Selector for which SecretsStore flavour the server activates. Mirrors --secrets-source from DEC-136. |
| ServerConfigInput | Input shape accepted by defineConfig. Every field is optional; missing values fall back to a documented default. |
Variables
| Variable | Description |
|---|---|
| ServerConfigSchema | Zod schema for the resolved ServerConfigSpec. Exposed for advanced users that want to validate other config sources (env-only launch, CLI overrides, etc.). |
Functions
| Function | Description |
|---|---|
| defineConfig | Helper for graphorin.config.ts files. Pure pass-through that provides editor autocomplete; the actual parsing happens at server startup so callers always see the same error path regardless of which loader (TS / JS / JSON) the operator picked. |
| parseServerConfig | Parse + validate user input. Returns a strongly-typed ServerConfigSpec; throws ConfigInvalidError on any invalid field with a flattened issue list. |