pub struct TomlSchema {Show 24 fields
pub schema: SchemaMetadata,
pub database: DatabaseRuntimeConfig,
pub server: ServerRuntimeConfig,
pub types: BTreeMap<String, TypeDefinition>,
pub queries: BTreeMap<String, QueryDefinition>,
pub mutations: BTreeMap<String, MutationDefinition>,
pub federation: FederationConfig,
pub security: SecuritySettings,
pub observers: ObserversConfig,
pub caching: CachingConfig,
pub analytics: AnalyticsConfig,
pub observability: ObservabilityConfig,
pub includes: SchemaIncludes,
pub domain_discovery: DomainDiscovery,
pub query_defaults: QueryDefaults,
pub auth: Option<OidcClientConfig>,
pub subscriptions: SubscriptionsConfig,
pub validation: ValidationConfig,
pub debug: DebugConfig,
pub mcp: McpConfig,
pub rest: RestTomlConfig,
pub naming_convention: NamingConvention,
pub crud: Option<CrudNamingConfig>,
pub hierarchies: Option<HashMap<String, HierarchyConfig>>,
}Expand description
Complete TOML schema configuration
Fields§
§schema: SchemaMetadataSchema metadata
database: DatabaseRuntimeConfigDatabase connection pool configuration (optional — all fields have defaults).
Supports ${VAR} environment variable interpolation in the url field.
server: ServerRuntimeConfigHTTP server runtime configuration (optional — all fields have defaults).
CLI flags (--port, --bind) take precedence over these settings.
types: BTreeMap<String, TypeDefinition>Type definitions
queries: BTreeMap<String, QueryDefinition>Query definitions
mutations: BTreeMap<String, MutationDefinition>Mutation definitions
federation: FederationConfigFederation configuration
security: SecuritySettingsSecurity configuration
observers: ObserversConfigObservers/event system configuration
caching: CachingConfigResult caching configuration
analytics: AnalyticsConfigAnalytics configuration
observability: ObservabilityConfigObservability configuration
includes: SchemaIncludesSchema includes configuration for multi-file composition
domain_discovery: DomainDiscoveryDomain discovery configuration for domain-based organization
query_defaults: QueryDefaultsGlobal defaults for list-query auto-params.
Provides project-wide defaults for where, order_by, limit, and offset
parameters on list queries. Per-query auto_params overrides are partial —
only the specified flags override the defaults. Relay queries and single-item
queries are never affected.
auth: Option<OidcClientConfig>OAuth2 client identity for server-side PKCE flows.
Required when [security.pkce] enabled = true.
Holds the OIDC provider discovery URL, client_id, and a reference to
the env var containing the client secret. Never stores the secret itself.
subscriptions: SubscriptionsConfigWebSocket subscription configuration (hooks, limits).
validation: ValidationConfigQuery validation limits (depth, complexity).
debug: DebugConfigDebug/development settings (database EXPLAIN, SQL exposure).
mcp: McpConfigMCP (Model Context Protocol) server configuration.
rest: RestTomlConfigREST transport configuration.
naming_convention: NamingConventionNaming convention for GraphQL operation names.
"preserve" (default) keeps names as authored (snake_case from Python SDKs).
"camelCase" converts operation names to standard GraphQL camelCase.
crud: Option<CrudNamingConfig>CRUD function naming config for automatic sql_source resolution.
When set, mutations that omit sql_source have their PostgreSQL function
name resolved at compile time using the configured template and the entity
name derived from return_type.
Example:
[crud]
function_schema = "app"
function_naming = "trinity"hierarchies: Option<HashMap<String, HierarchyConfig>>Hierarchy definitions for ID-based ltree operators (descendantOfId, ancestorOfId).
Maps a hierarchy name to its table and ltree path column. Used by the compiler to generate subquery-based ltree WHERE clauses that resolve an entity’s ltree path from its UUID.
Example:
[hierarchies.category]
table = "tb_category"
path_column = "category_path"Implementations§
Source§impl TomlSchema
impl TomlSchema
Sourcepub fn from_file(path: &str) -> Result<Self>
pub fn from_file(path: &str) -> Result<Self>
Load schema from TOML file
§Errors
Returns an error if the file cannot be read or cannot be parsed as a
valid TomlSchema.
Sourcepub fn parse_toml(content: &str) -> Result<Self>
pub fn parse_toml(content: &str) -> Result<Self>
Parse schema from TOML string.
Expands ${VAR} environment variable placeholders before parsing.
§Errors
Returns an error if the TOML string cannot be deserialized into a
TomlSchema.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate schema
§Errors
Returns an error if any query or mutation references an undefined type, if a field auth rule references an undefined policy, if a federation entity references an undefined type, or if server/database/circuit-breaker configuration values are invalid.
Sourcepub fn to_intermediate_schema(&self) -> Value
pub fn to_intermediate_schema(&self) -> Value
Convert to intermediate schema format (compatible with language-generated types.json)
Trait Implementations§
Source§impl Clone for TomlSchema
impl Clone for TomlSchema
Source§fn clone(&self) -> TomlSchema
fn clone(&self) -> TomlSchema
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more