Struct async_graphql::SchemaBuilder [−][src]
pub struct SchemaBuilder<Query, Mutation, Subscription> { /* fields omitted */ }Expand description
Schema builder
Implementations
impl<Query, Mutation, Subscription> SchemaBuilder<Query, Mutation, Subscription>[src]
impl<Query, Mutation, Subscription> SchemaBuilder<Query, Mutation, Subscription>[src]pub fn register_type<T: Type>(self) -> Self[src]
pub fn register_type<T: Type>(self) -> Self[src]Manually register a type in the schema.
You can use this function to register schema types that are not directly referenced.
pub fn disable_introspection(self) -> Self[src]
pub fn disable_introspection(self) -> Self[src]Disable introspection queries.
pub fn limit_complexity(self, complexity: usize) -> Self[src]
pub fn limit_complexity(self, complexity: usize) -> Self[src]Set the maximum complexity a query can have. By default, there is no limit.
pub fn limit_depth(self, depth: usize) -> Self[src]
pub fn limit_depth(self, depth: usize) -> Self[src]Set the maximum depth a query can have. By default, there is no limit.
pub fn extension(self, extension: impl ExtensionFactory) -> Self[src]
pub fn extension(self, extension: impl ExtensionFactory) -> Self[src]Add an extension to the schema.
Examples
use async_graphql::*; struct Query; #[Object] impl Query { async fn value(&self) -> i32 { 100 } } let schema = Schema::build(Query, EmptyMutation,EmptySubscription) .extension(extensions::Logger) .finish();
pub fn data<D: Any + Send + Sync>(self, data: D) -> Self[src]
pub fn data<D: Any + Send + Sync>(self, data: D) -> Self[src]Add a global data that can be accessed in the Schema. You access it with Context::data.
pub fn validation_mode(self, validation_mode: ValidationMode) -> Self[src]
pub fn validation_mode(self, validation_mode: ValidationMode) -> Self[src]Set the validation mode, default is ValidationMode::Strict.
pub fn enable_federation(self) -> Self[src]
pub fn enable_federation(self) -> Self[src]Enable federation, which is automatically enabled if the Query has least one entity definition.
pub fn enable_subscription_in_federation(self) -> Self[src]
pub fn enable_subscription_in_federation(self) -> Self[src]Make the Federation SDL include subscriptions.
Note: Not included by default, in order to be compatible with Apollo Server.
pub fn override_description<T: Type>(self, desc: &'static str) -> Self[src]
pub fn override_description<T: Type>(self, desc: &'static str) -> Self[src]Override the name of the specified type.
Auto Trait Implementations
impl<Query, Mutation, Subscription> !RefUnwindSafe for SchemaBuilder<Query, Mutation, Subscription>
impl<Query, Mutation, Subscription> Send for SchemaBuilder<Query, Mutation, Subscription> where
Mutation: Send,
Query: Send,
Subscription: Send,
Mutation: Send,
Query: Send,
Subscription: Send,
impl<Query, Mutation, Subscription> Sync for SchemaBuilder<Query, Mutation, Subscription> where
Mutation: Sync,
Query: Sync,
Subscription: Sync,
Mutation: Sync,
Query: Sync,
Subscription: Sync,
impl<Query, Mutation, Subscription> Unpin for SchemaBuilder<Query, Mutation, Subscription> where
Mutation: Unpin,
Query: Unpin,
Subscription: Unpin,
Mutation: Unpin,
Query: Unpin,
Subscription: Unpin,
impl<Query, Mutation, Subscription> !UnwindSafe for SchemaBuilder<Query, Mutation, Subscription>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> FutureExt for T[src]
impl<T> FutureExt for T[src]fn with_context(self, otel_cx: Context) -> WithContext<Self>[src]
fn with_context(self, otel_cx: Context) -> WithContext<Self>[src]fn with_current_context(self) -> WithContext<Self>[src]
fn with_current_context(self) -> WithContext<Self>[src]impl<T> Instrument for T[src]
impl<T> Instrument for T[src]fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]impl<T> Instrument for T[src]
impl<T> Instrument for T[src]fn instrument(self, span: Span) -> Instrumented<Self>[src]
fn instrument(self, span: Span) -> Instrumented<Self>[src]Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>[src]
fn in_current_span(self) -> Instrumented<Self>[src]impl<T> Same<T> for T
impl<T> Same<T> for Ttype Output = T
type Output = TShould always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>, pub fn vzip(self) -> V
impl<T> WithSubscriber for T[src]
impl<T> WithSubscriber for T[src]fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>, [src]Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
fn with_current_subscriber(self) -> WithDispatch<Self>[src]
fn with_current_subscriber(self) -> WithDispatch<Self>[src]Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more