pub struct GraphQLSchema {
pub types: Vec<GraphQLType>,
pub queries: Vec<QueryDefinition>,
pub mutations: Vec<MutationDefinition>,
pub relationships: Vec<Relationship>,
pub input_types: Vec<GraphQLInputType>,
pub enum_types: Vec<GraphQLEnumType>,
}Expand description
GraphQL schema generated from database introspection
Fields§
§types: Vec<GraphQLType>Object types
queries: Vec<QueryDefinition>Query type fields
mutations: Vec<MutationDefinition>Mutation type fields
relationships: Vec<Relationship>Relationships between types
input_types: Vec<GraphQLInputType>Input types
enum_types: Vec<GraphQLEnumType>Enum types
Implementations§
Source§impl GraphQLSchema
impl GraphQLSchema
Sourcepub fn add_type(&mut self, type_def: GraphQLType)
pub fn add_type(&mut self, type_def: GraphQLType)
Add a type to the schema
Sourcepub fn add_query(&mut self, query: QueryDefinition)
pub fn add_query(&mut self, query: QueryDefinition)
Add a query to the schema
Sourcepub fn add_mutation(&mut self, mutation: MutationDefinition)
pub fn add_mutation(&mut self, mutation: MutationDefinition)
Add a mutation to the schema
Sourcepub fn add_relationship(&mut self, relationship: Relationship)
pub fn add_relationship(&mut self, relationship: Relationship)
Add a relationship
Sourcepub fn get_type(&self, name: &str) -> Option<&GraphQLType>
pub fn get_type(&self, name: &str) -> Option<&GraphQLType>
Get a type by name
Sourcepub fn get_relationships_for(&self, type_name: &str) -> Vec<&Relationship>
pub fn get_relationships_for(&self, type_name: &str) -> Vec<&Relationship>
Get relationships for a type
Trait Implementations§
Source§impl Clone for GraphQLSchema
impl Clone for GraphQLSchema
Source§fn clone(&self) -> GraphQLSchema
fn clone(&self) -> GraphQLSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GraphQLSchema
impl Debug for GraphQLSchema
Auto Trait Implementations§
impl Freeze for GraphQLSchema
impl RefUnwindSafe for GraphQLSchema
impl Send for GraphQLSchema
impl Sync for GraphQLSchema
impl Unpin for GraphQLSchema
impl UnsafeUnpin for GraphQLSchema
impl UnwindSafe for GraphQLSchema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more