Struct async_graphql::dynamic::SchemaBuilder
source · pub struct SchemaBuilder { /* private fields */ }
dynamic-schema
only.Expand description
Dynamic schema builder
Implementations
sourceimpl SchemaBuilder
impl SchemaBuilder
sourcepub fn data<D: Any + Send + Sync>(self, data: D) -> Self
pub fn data<D: Any + Send + Sync>(self, data: D) -> Self
Add a global data that can be accessed in the Schema
. You access it
with Context::data
.
sourcepub fn extension(self, extension: impl ExtensionFactory) -> Self
pub fn extension(self, extension: impl ExtensionFactory) -> Self
Add an extension to the schema.
sourcepub fn limit_complexity(self, complexity: usize) -> Self
pub fn limit_complexity(self, complexity: usize) -> Self
Set the maximum complexity a query can have. By default, there is no limit.
sourcepub fn limit_depth(self, depth: usize) -> Self
pub fn limit_depth(self, depth: usize) -> Self
Set the maximum depth a query can have. By default, there is no limit.
sourcepub fn limit_recursive_depth(self, depth: usize) -> Self
pub fn limit_recursive_depth(self, depth: usize) -> Self
Set the maximum recursive depth a query can have. (default: 32)
If the value is too large, stack overflow may occur, usually 32
is
enough.
sourcepub fn validation_mode(self, validation_mode: ValidationMode) -> Self
pub fn validation_mode(self, validation_mode: ValidationMode) -> Self
Set the validation mode, default is ValidationMode::Strict
.
sourcepub fn disable_suggestions(self) -> Self
pub fn disable_suggestions(self) -> Self
Disable field suggestions.
sourcepub fn disable_introspection(self) -> Self
pub fn disable_introspection(self) -> Self
Disable introspection queries.
sourcepub fn introspection_only(self) -> Self
pub fn introspection_only(self) -> Self
Only process introspection queries, everything else is processed as an error.
sourcepub fn enable_federation(self) -> Self
pub fn enable_federation(self) -> Self
Enable federation, which is automatically enabled if the Query has least one entity definition.
sourcepub fn entity_resolver<F>(self, resolver_fn: F) -> Selfwhere
F: for<'a> Fn(ResolverContext<'a>) -> FieldFuture<'a> + Send + Sync + 'static,
pub fn entity_resolver<F>(self, resolver_fn: F) -> Selfwhere
F: for<'a> Fn(ResolverContext<'a>) -> FieldFuture<'a> + Send + Sync + 'static,
Set the entity resolver for federation
sourcepub fn finish(self) -> Result<Schema, SchemaError>
pub fn finish(self) -> Result<Schema, SchemaError>
Consumes this builder and returns a schema.