[][src]Struct async_graphql::SchemaBuilder

pub struct SchemaBuilder<Query, Mutation, Subscription> { /* fields omitted */ }

Schema builder

Implementations

impl<Query, Mutation, Subscription> SchemaBuilder<Query, Mutation, Subscription>[src]

pub fn register_type<T: Type>(mut self: 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(mut self: Self) -> Self[src]

Disable introspection queries.

pub fn limit_complexity(mut self: Self, complexity: usize) -> Self[src]

Set the maximum complexity a query can have. By default, there is no limit.

pub fn limit_depth(mut self: Self, depth: usize) -> Self[src]

Set the maximum depth a query can have. By default, there is no limit.

pub fn extension(mut self: 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>(mut self: 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(mut self: Self, validation_mode: ValidationMode) -> Self[src]

Set the validation mode, default is ValidationMode::Strict.

pub fn enable_federation(mut self: Self) -> Self[src]

Enable federation, which is automatically enabled if the Query has least one entity definition.

pub fn override_description<T: Type>(mut self: Self, desc: &'static str) -> Self[src]

Override the description of the specified type.

pub fn finish(mut self: Self) -> Schema<Query, Mutation, Subscription>[src]

Build schema.

Auto Trait Implementations

impl<Query, Mutation, Subscription> !RefUnwindSafe for SchemaBuilder<Query, Mutation, Subscription>[src]

impl<Query, Mutation, Subscription> Send for SchemaBuilder<Query, Mutation, Subscription> where
    Mutation: Send,
    Query: Send,
    Subscription: Send
[src]

impl<Query, Mutation, Subscription> Sync for SchemaBuilder<Query, Mutation, Subscription> where
    Mutation: Sync,
    Query: Sync,
    Subscription: Sync
[src]

impl<Query, Mutation, Subscription> Unpin for SchemaBuilder<Query, Mutation, Subscription> where
    Mutation: Unpin,
    Query: Unpin,
    Subscription: Unpin
[src]

impl<Query, Mutation, Subscription> !UnwindSafe for SchemaBuilder<Query, Mutation, Subscription>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,