Struct seaography::builder::Builder
source · pub struct Builder {
pub entities: Vec<Object>,
pub edges: Vec<Object>,
pub connections: Vec<Object>,
pub filters: Vec<InputObject>,
pub orders: Vec<InputObject>,
pub enumerations: Vec<Enum>,
pub queries: Vec<Field>,
pub relations: BTreeMap<String, Vec<Field>>,
pub context: &'static BuilderContext,
}
Expand description
The Builder is used to create the Schema for GraphQL
You can populate it with the entities, enumerations of your choice
Fields§
§entities: Vec<Object>
§edges: Vec<Object>
§connections: Vec<Object>
§filters: Vec<InputObject>
§orders: Vec<InputObject>
§enumerations: Vec<Enum>
§queries: Vec<Field>
§relations: BTreeMap<String, Vec<Field>>
§context: &'static BuilderContext
Implementations§
source§impl Builder
impl Builder
sourcepub fn new(context: &'static BuilderContext) -> Self
pub fn new(context: &'static BuilderContext) -> Self
Used to create a new Builder from the given configuration context
sourcepub fn register_entity<T>(&mut self, relations: Vec<Field>)where
T: EntityTrait,
<T as EntityTrait>::Model: Sync,
pub fn register_entity<T>(&mut self, relations: Vec<Field>)where T: EntityTrait, <T as EntityTrait>::Model: Sync,
used to register a new entity to the Builder context
sourcepub fn register_enumeration<A>(&mut self)where
A: ActiveEnum,
pub fn register_enumeration<A>(&mut self)where A: ActiveEnum,
used to register a new enumeration to the builder context
sourcepub fn schema_builder(self) -> SchemaBuilder
pub fn schema_builder(self) -> SchemaBuilder
used to consume the builder context and generate a ready to be completed GraphQL schema
Auto Trait Implementations§
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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