#[non_exhaustive]pub struct LimitsConfig {
pub max_query_bytes: usize,
pub max_nesting: usize,
pub max_depth: usize,
pub max_aliases: usize,
pub max_root_fields: usize,
pub max_fields: usize,
pub max_directives: usize,
pub max_complexity: usize,
}Expand description
Static analysis limits enforced on every document before it executes.
0 means “unlimited” for every field. The defaults admit any realistic
application query while refusing the pathological shapes used to exhaust
a GraphQL server (deep nesting, alias amplification, fragment fan-out).
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.max_query_bytes: usizeLargest accepted document, in bytes.
max_nesting: usizeDeepest lexical nesting of {, ( and [, checked before parsing so
the parser itself is never handed a stack-exhausting input.
max_depth: usizeDeepest selection-set nesting of the executed operation, with
fragments expanded. { a { b } } has depth 2.
max_aliases: usizeMost aliased fields in the executed operation, with fragments expanded.
max_root_fields: usizeMost fields selected directly on the operation’s root type.
max_fields: usizeMost field selections in the executed operation after fragment expansion — the guard against fragment fan-out (“fragment bombs”).
max_directives: usizeMost directives in the document.
max_complexity: usizeSchema-level complexity limit, applied when the plugin builds the
schema itself (GraphqlPlugin::from_builder). Uses async-graphql’s
#[graphql(complexity = ..)] cost model. 0 disables it.
Trait Implementations§
Source§impl Clone for LimitsConfig
impl Clone for LimitsConfig
Source§impl Debug for LimitsConfig
impl Debug for LimitsConfig
Source§impl Default for LimitsConfig
impl Default for LimitsConfig
Source§impl<'de> Deserialize<'de> for LimitsConfigwhere
LimitsConfig: Default,
impl<'de> Deserialize<'de> for LimitsConfigwhere
LimitsConfig: 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 LimitsConfig
Source§impl PartialEq for LimitsConfig
impl PartialEq for LimitsConfig
Source§impl Serialize for LimitsConfig
impl Serialize for LimitsConfig
impl StructuralPartialEq for LimitsConfig
Auto Trait Implementations§
impl Forget for LimitsConfig
impl Freeze for LimitsConfig
impl RefUnwindSafe for LimitsConfig
impl Send for LimitsConfig
impl Sync for LimitsConfig
impl Unpin for LimitsConfig
impl UnsafeUnpin for LimitsConfig
impl UnwindSafe for LimitsConfig
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.