pub struct Schema(_);
Expand description

Dyanmic GraphQL schema.

Cloning a schema is cheap, so it can be easily shared.

Implementations§

source§

impl Schema

source

pub fn build(
query: &str,
mutation: Option<&str>,
subscription: Option<&str>
) -> SchemaBuilder

Create a schema builder

source

pub fn sdl(&self) -> String

Returns SDL(Schema Definition Language) of this schema.

source

pub fn sdl_with_options(&self, options: SDLExportOptions) -> String

Returns SDL(Schema Definition Language) of this schema with options.

source

pub async fn execute(
&self,
request: impl Into<DynamicRequest>
) -> impl Future<Output = Response>

Execute a GraphQL query.

source

pub fn execute_stream_with_session_data(
&self,
request: impl Into<DynamicRequest>,
session_data: Arc<Data>
) -> impl Stream<Item = Response> + Send + Unpin

Execute a GraphQL subscription with session data.

source

pub fn execute_stream(
&self,
request: impl Into<DynamicRequest>
) -> impl Stream<Item = Response> + Send + Unpin

Execute a GraphQL subscription.

Trait Implementations§

source§

impl Clone for Schema

source§

fn clone(&self) -> Schema

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Schema

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Executor for Schema

source§

fn execute<'life0, 'async_trait>(
&'life0 self,
request: Request
) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Schema: 'async_trait,

Execute a GraphQL query.
source§

fn execute_stream(
&self,
request: Request,
session_data: Option<Arc<Data>>
) -> Pin<Box<dyn Stream<Item = Response> + Send + 'static, Global>>

Execute a GraphQL subscription with session data.
source§

fn execute_batch<'life0, 'async_trait>(
&'life0 self,
batch_request: BatchRequest
) -> Pin<Box<dyn Future<Output = BatchResponse> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,

Execute a GraphQL batch query.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Schema

§

impl Send for Schema

§

impl Sync for Schema

§

impl Unpin for Schema

§

impl !UnwindSafe for Schema

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere
T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.