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
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.