pub struct GraphQLType {
pub name: String,
pub kind: GraphQLTypeKind,
pub description: Option<String>,
pub fields: Vec<GraphQLField>,
pub enum_values: Vec<String>,
pub interfaces: Vec<String>,
}Expand description
GraphQL type definition
Fields§
§name: StringType name
kind: GraphQLTypeKindType kind (Object, Enum, Interface, etc.)
description: Option<String>Description
fields: Vec<GraphQLField>Fields for object types
enum_values: Vec<String>Enum values for enum types
interfaces: Vec<String>Implemented interfaces
Implementations§
Source§impl GraphQLType
impl GraphQLType
Sourcepub fn new(name: String, kind: GraphQLTypeKind) -> Self
pub fn new(name: String, kind: GraphQLTypeKind) -> Self
Create a new GraphQL type
Sourcepub fn with_description(self, description: String) -> Self
pub fn with_description(self, description: String) -> Self
Set description
Sourcepub fn add_field(&mut self, field: GraphQLField)
pub fn add_field(&mut self, field: GraphQLField)
Add a field
Sourcepub fn add_enum_value(&mut self, value: String)
pub fn add_enum_value(&mut self, value: String)
Add an enum value
Sourcepub fn add_interface(&mut self, interface: String)
pub fn add_interface(&mut self, interface: String)
Add an interface
Trait Implementations§
Source§impl Clone for GraphQLType
impl Clone for GraphQLType
Source§fn clone(&self) -> GraphQLType
fn clone(&self) -> GraphQLType
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 moreAuto Trait Implementations§
impl Freeze for GraphQLType
impl RefUnwindSafe for GraphQLType
impl Send for GraphQLType
impl Sync for GraphQLType
impl Unpin for GraphQLType
impl UnwindSafe for GraphQLType
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