pub struct Schema(/* private fields */);Available on crate feature
dynamic-schema only.Expand description
Dynamic GraphQL schema.
Cloning a schema is cheap, so it can be easily shared.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn build(
query: &str,
mutation: Option<&str>,
subscription: Option<&str>,
) -> SchemaBuilder
pub fn build( query: &str, mutation: Option<&str>, subscription: Option<&str>, ) -> SchemaBuilder
Create a schema builder
Sourcepub fn sdl_with_options(&self, options: SDLExportOptions) -> String
pub fn sdl_with_options(&self, options: SDLExportOptions) -> String
Returns SDL(Schema Definition Language) of this schema with options.
Sourcepub async fn execute(&self, request: impl Into<DynamicRequest>) -> Response
pub async fn execute(&self, request: impl Into<DynamicRequest>) -> Response
Execute a GraphQL query.
Sourcepub fn execute_stream_with_session_data(
&self,
request: impl Into<DynamicRequest>,
session_data: Arc<Data>,
) -> BoxStream<'static, Response>
pub fn execute_stream_with_session_data( &self, request: impl Into<DynamicRequest>, session_data: Arc<Data>, ) -> BoxStream<'static, Response>
Execute a GraphQL subscription with session data.
Sourcepub fn execute_stream(
&self,
request: impl Into<DynamicRequest>,
) -> BoxStream<'static, Response>
pub fn execute_stream( &self, request: impl Into<DynamicRequest>, ) -> BoxStream<'static, Response>
Execute a GraphQL subscription.
Trait Implementations§
Source§impl Executor for Schema
impl Executor for Schema
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
request: Request,
) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: Request,
) -> Pin<Box<dyn Future<Output = Response> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Available on crate feature
boxed-trait only.Execute a GraphQL query.
Source§fn execute_stream(
&self,
request: Request,
session_data: Option<Arc<Data>>,
) -> BoxStream<'static, Response>
fn execute_stream( &self, request: Request, session_data: Option<Arc<Data>>, ) -> BoxStream<'static, Response>
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>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_batch<'life0, 'async_trait>(
&'life0 self,
batch_request: BatchRequest,
) -> Pin<Box<dyn Future<Output = BatchResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Available on crate feature
boxed-trait only.Execute a GraphQL batch query.
Auto Trait Implementations§
impl Freeze for Schema
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> 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