pub struct SchemaBuilder { /* private fields */ }dynamic-schema only.Expand description
Dynamic schema builder
Implementations§
Source§impl SchemaBuilder
impl SchemaBuilder
Sourcepub fn enable_uploading(self) -> Self
pub fn enable_uploading(self) -> Self
Enable uploading files (register Upload type).
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 limit_directives(self, max_directives: usize) -> Self
pub fn limit_directives(self, max_directives: usize) -> Self
Set the maximum number of directives on a single field. (default: no limit)
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) -> Self
pub fn entity_resolver<F>(self, resolver_fn: F) -> Self
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.