Struct apollo_encoder::SchemaDef [−][src]
pub struct SchemaDef { /* fields omitted */ }Expand description
A GraphQL service’s collective type system capabilities are referred to as that service’s “schema”.
SchemaDefinition: Description? schema Directives? { RootOperationTypeDefinition* }
Detailed documentation can be found in GraphQL spec.
Example
use apollo_encoder::{SchemaDef};
use indoc::indoc;
let mut schema_def = SchemaDef::new();
schema_def.query("TryingToFindCatQuery".to_string());
schema_def.mutation("MyMutation".to_string());
schema_def.subscription("MySubscription".to_string());
assert_eq!(
schema_def.to_string(),
indoc! { r#"
schema {
query: TryingToFindCatQuery
mutation: MyMutation
subscription: MySubscription
}
"#}
);Implementations
Set the SchemaDef’s description.
Set the schema def’s subscription type.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SchemaDef
impl UnwindSafe for SchemaDef
Blanket Implementations
Mutably borrows from an owned value. Read more