#[non_exhaustive]pub struct GraphqlConfig {Show 15 fields
pub enabled: bool,
pub path: String,
pub introspection: Toggle,
pub sdl: Toggle,
pub mask_unexpected_errors: Toggle,
pub allow_get: bool,
pub max_body_bytes: usize,
pub timeout_ms: u64,
pub slow_operation_ms: u64,
pub csrf_prevention: bool,
pub batching: BatchingConfig,
pub limits: LimitsConfig,
pub subscriptions: SubscriptionsConfig,
pub persisted_queries: PersistedQueriesConfig,
pub uploads: UploadsConfig,
}Expand description
The [graphql] section.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolKill switch. false mounts nothing (the routes 404).
path: StringMount path of the endpoint.
introspection: ToggleAllow introspection (__schema, __type). auto = on in the dev
and test profiles, off elsewhere. __typename is always allowed.
sdl: ToggleServe GET {path}/sdl. auto follows the effective introspection
value: publishing the SDL is publishing the schema.
mask_unexpected_errors: ToggleReplace the message of any resolver error that does not carry an
extensions.code with Internal server error (the original is
logged). auto = off in dev/test, on elsewhere.
allow_get: boolServe queries over GET {path}?query=…. Mutations over GET are
always refused with 405.
max_body_bytes: usizeLargest accepted request body, in bytes (multipart uploads are
bounded separately by [graphql.uploads]).
timeout_ms: u64Per-operation execution timeout in milliseconds; 0 = none.
Subscriptions are not timed out.
slow_operation_ms: u64Operations slower than this (milliseconds) are logged at WARN;
0 = never.
csrf_prevention: boolRequire a preflight-forcing header (apollo-require-preflight,
graphql-require-preflight or x-apollo-operation-name) on
multipart requests, which browsers otherwise send cross-site without
a CORS preflight.
batching: BatchingConfigSee BatchingConfig.
limits: LimitsConfigSee LimitsConfig.
subscriptions: SubscriptionsConfigSee SubscriptionsConfig.
persisted_queries: PersistedQueriesConfig§uploads: UploadsConfigSee UploadsConfig.
Implementations§
Source§impl GraphqlConfig
impl GraphqlConfig
Sourcepub fn from_toml_str(text: &str, section: &str) -> Result<Self, ConfigError>
pub fn from_toml_str(text: &str, section: &str) -> Result<Self, ConfigError>
Parse the [section] table out of a whole autumn.toml document,
with no profile layering and no environment overrides.
§Errors
Returns ConfigError for invalid TOML, unknown keys, wrong types,
or values validate rejects.
Sourcepub fn resolve(section: &str) -> Result<Resolved, ConfigError>
pub fn resolve(section: &str) -> Result<Resolved, ConfigError>
Resolve [section] from the host app’s configuration files and
environment, exactly as Autumn core layers its own settings.
§Errors
Returns ConfigError when a contributing file cannot be read or
parsed, when the merged section has an unknown or ill-typed key, or
when a value is out of range.
Sourcepub fn resolve_with_env(
section: &str,
env: &dyn Env,
) -> Result<Resolved, ConfigError>
pub fn resolve_with_env( section: &str, env: &dyn Env, ) -> Result<Resolved, ConfigError>
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Reject values that would misbehave at runtime.
§Errors
Returns ConfigError naming the offending key.
Trait Implementations§
Source§impl Clone for GraphqlConfig
impl Clone for GraphqlConfig
Source§impl Debug for GraphqlConfig
impl Debug for GraphqlConfig
Source§impl Default for GraphqlConfig
impl Default for GraphqlConfig
Source§impl<'de> Deserialize<'de> for GraphqlConfigwhere
GraphqlConfig: Default,
impl<'de> Deserialize<'de> for GraphqlConfigwhere
GraphqlConfig: 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>,
impl Eq for GraphqlConfig
Source§impl PartialEq for GraphqlConfig
impl PartialEq for GraphqlConfig
Source§impl Serialize for GraphqlConfig
impl Serialize for GraphqlConfig
impl StructuralPartialEq for GraphqlConfig
Auto Trait Implementations§
impl Forget for GraphqlConfig
impl Freeze for GraphqlConfig
impl RefUnwindSafe for GraphqlConfig
impl Send for GraphqlConfig
impl Sync for GraphqlConfig
impl Unpin for GraphqlConfig
impl UnsafeUnpin for GraphqlConfig
impl UnwindSafe for GraphqlConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
impl<T> JsonSink for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.