pub struct TomlSchema {Show 22 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 naming_convention: NamingConvention,
pub crud: Option<CrudNamingConfig>,
}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.
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"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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TomlSchema
impl Debug for TomlSchema
Source§impl Default for TomlSchema
impl Default for TomlSchema
Source§fn default() -> TomlSchema
fn default() -> TomlSchema
Source§impl<'de> Deserialize<'de> for TomlSchemawhere
TomlSchema: Default,
impl<'de> Deserialize<'de> for TomlSchemawhere
TomlSchema: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TomlSchema
impl RefUnwindSafe for TomlSchema
impl Send for TomlSchema
impl Sync for TomlSchema
impl Unpin for TomlSchema
impl UnsafeUnpin for TomlSchema
impl UnwindSafe for TomlSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more