Skip to main content

GQLBackend

Struct GQLBackend 

Source
pub struct GQLBackend;
Expand description

The GraphQL SDL emitter backend.

Implementations§

Source§

impl GQLBackend

Source

pub fn emit_type(&self, ty: &GQLType) -> String

Emit a GraphQL type reference string.

Source

pub fn emit_field(&self, field: &GQLField) -> String

Emit a single field definition line.

Source

pub fn emit_object(&self, obj: &GQLObject) -> String

Emit a full type Foo { ... } SDL block.

Source

pub fn emit_enum(&self, e: &GQLEnumDef) -> String

Emit an enum Foo { ... } SDL block.

Source

pub fn emit_schema(&self, schema: &GQLSchema) -> String

Emit the top-level schema { ... } block and all type definitions.

Source

pub fn generate_resolver_stubs(&self, schema: &GQLSchema) -> String

Generate simple resolver stub functions (as pseudo-Rust) for each field.

Source

pub fn schema_from_triples( &self, query_type: &str, triples: &[(&str, &str, &str)], ) -> GQLSchema

Build a minimal schema from a list of (type_name, field_name, scalar) triples.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.