pub struct GraphQLValidator { /* private fields */ }Expand description
GraphQL query validator.
Implementations§
Source§impl GraphQLValidator
impl GraphQLValidator
Sourcepub fn new(
sensitive_fields: Vec<String>,
max_depth: usize,
max_complexity: usize,
) -> Self
pub fn new( sensitive_fields: Vec<String>, max_depth: usize, max_complexity: usize, ) -> Self
Create a new validator with custom settings.
Sourcepub fn validate(&self, query: &str) -> Result<GraphQLQueryInfo, ValidationError>
pub fn validate(&self, query: &str) -> Result<GraphQLQueryInfo, ValidationError>
Parse and validate a GraphQL query.
Sourcepub fn analyze_security(&self, info: &GraphQLQueryInfo) -> SecurityAnalysis
pub fn analyze_security(&self, info: &GraphQLQueryInfo) -> SecurityAnalysis
Perform security analysis on query info.
Sourcepub fn to_code_type(&self, info: &GraphQLQueryInfo) -> CodeType
pub fn to_code_type(&self, info: &GraphQLQueryInfo) -> CodeType
Convert query info to CodeType.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphQLValidator
impl RefUnwindSafe for GraphQLValidator
impl Send for GraphQLValidator
impl Sync for GraphQLValidator
impl Unpin for GraphQLValidator
impl UnsafeUnpin for GraphQLValidator
impl UnwindSafe for GraphQLValidator
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