pub struct QueryValidator { /* private fields */ }Expand description
Query Validator
Validates incoming GraphQL queries against security policies. Acts as the third layer in the security middleware pipeline.
Implementations§
Source§impl QueryValidator
impl QueryValidator
Sourcepub fn from_config(config: QueryValidatorConfig) -> Self
pub fn from_config(config: QueryValidatorConfig) -> Self
Create a new query validator from configuration
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create validator with permissive settings
Sourcepub fn validate(&self, query: &str) -> Result<QueryMetrics>
pub fn validate(&self, query: &str) -> Result<QueryMetrics>
Validate a GraphQL query
Performs 4 validation checks:
- Check query size
- Parse and analyze structure
- Check query depth
- Check query complexity
Returns QueryMetrics if valid, Err if any check fails.
Sourcepub const fn config(&self) -> &QueryValidatorConfig
pub const fn config(&self) -> &QueryValidatorConfig
Get the underlying configuration
Trait Implementations§
Source§impl Clone for QueryValidator
impl Clone for QueryValidator
Source§fn clone(&self) -> QueryValidator
fn clone(&self) -> QueryValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryValidator
impl RefUnwindSafe for QueryValidator
impl Send for QueryValidator
impl Sync for QueryValidator
impl Unpin for QueryValidator
impl UnsafeUnpin for QueryValidator
impl UnwindSafe for QueryValidator
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
Mutably borrows from an owned value. Read more