[−][src]Struct async_graphql::Schema
GraphQL schema
Methods
impl<Query: GQLObject, Mutation: GQLObject> Schema<Query, Mutation>
[src][−]
pub fn new(query: Query, mutation: Mutation) -> Self
[src][−]
Create a schema.
The root object for the query and Mutation needs to be specified.
If there is no mutation, you can use GQLEmptyMutation
.
pub fn data<D: Any + Send + Sync>(self, data: D) -> Self
[src][−]
Add a global data that can be accessed in the Context
.
pub fn query<'a>(
&'a self,
query_source: &'a str
) -> QueryBuilder<'a, Query, Mutation>
[src][−]
&'a self,
query_source: &'a str
) -> QueryBuilder<'a, Query, Mutation>
Start a query and return QueryBuilder
.
Auto Trait Implementations
impl<Query, Mutation> !RefUnwindSafe for Schema<Query, Mutation>
impl<Query, Mutation> Send for Schema<Query, Mutation> where
Mutation: Send,
Query: Send,
Mutation: Send,
Query: Send,
impl<Query, Mutation> Sync for Schema<Query, Mutation> where
Mutation: Sync,
Query: Sync,
Mutation: Sync,
Query: Sync,
impl<Query, Mutation> Unpin for Schema<Query, Mutation> where
Mutation: Unpin,
Query: Unpin,
Mutation: Unpin,
Query: Unpin,
impl<Query, Mutation> !UnwindSafe for Schema<Query, Mutation>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,