#[non_exhaustive]pub struct GeneratedSchema {
pub object_types: HashMap<String, TableObjectType>,
pub query_fields: Vec<QueryField>,
pub mutation_fields: Vec<MutationField>,
pub relationship_fields: HashMap<String, Vec<RelationshipField>>,
pub enum_types: HashMap<String, Vec<(String, Option<String>)>>,
pub function_fields: Vec<FunctionField>,
pub federation_entities: HashMap<String, FederationEntity>,
pub enable_federation: bool,
}Expand description
Represents a generated GraphQL schema.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.object_types: HashMap<String, TableObjectType>Object types for each table
query_fields: Vec<QueryField>Query fields
mutation_fields: Vec<MutationField>Mutation fields (if enabled)
relationship_fields: HashMap<String, Vec<RelationshipField>>Relationship fields for each type
enum_types: HashMap<String, Vec<(String, Option<String>)>>GraphQL enums generated from enum tables: type name to
(member, description).
function_fields: Vec<FunctionField>Database functions exposed as root fields.
federation_entities: HashMap<String, FederationEntity>Apollo Federation entities keyed by GraphQL type name.
enable_federation: boolWhether Apollo Federation system fields should be exposed.
Implementations§
Source§impl GeneratedSchema
impl GeneratedSchema
Sourcepub fn get_object_type(&self, name: &str) -> Option<&TableObjectType>
pub fn get_object_type(&self, name: &str) -> Option<&TableObjectType>
Get an object type by name.
Sourcepub fn get_query_field(&self, table_name: &str) -> Option<&QueryField>
pub fn get_query_field(&self, table_name: &str) -> Option<&QueryField>
Get query fields for a table.
Sourcepub fn get_mutation_fields(&self, table_name: &str) -> Vec<&MutationField>
pub fn get_mutation_fields(&self, table_name: &str) -> Vec<&MutationField>
Get mutation fields for a table.
Sourcepub fn get_relationship_fields(
&self,
type_name: &str,
) -> Option<&Vec<RelationshipField>>
pub fn get_relationship_fields( &self, type_name: &str, ) -> Option<&Vec<RelationshipField>>
Get relationship fields for a type.
Sourcepub fn get_federation_entity(
&self,
type_name: &str,
) -> Option<&FederationEntity>
pub fn get_federation_entity( &self, type_name: &str, ) -> Option<&FederationEntity>
Get federation entity metadata for a type.
Sourcepub fn table_names(&self) -> Vec<&str>
pub fn table_names(&self) -> Vec<&str>
Get all table names.
Sourcepub fn type_names(&self) -> Vec<&str>
pub fn type_names(&self) -> Vec<&str>
Get all type names.
Trait Implementations§
Source§impl Clone for GeneratedSchema
impl Clone for GeneratedSchema
Auto Trait Implementations§
impl Freeze for GeneratedSchema
impl RefUnwindSafe for GeneratedSchema
impl Send for GeneratedSchema
impl Sync for GeneratedSchema
impl Unpin for GeneratedSchema
impl UnsafeUnpin for GeneratedSchema
impl UnwindSafe for GeneratedSchema
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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