mas_handlers

Type Alias GraphQLSchema

Source
pub type GraphQLSchema = Schema<Query, Mutation, EmptySubscription>;

Aliased Type§

struct GraphQLSchema(/* private fields */);

Implementations

Source§

impl<Query, Mutation, Subscription> Schema<Query, Mutation, Subscription>
where Query: ObjectType + 'static, Mutation: ObjectType + 'static, Subscription: SubscriptionType + 'static,

Source

pub fn build( query: Query, mutation: Mutation, subscription: Subscription, ) -> SchemaBuilder<Query, Mutation, Subscription>

Create a schema builder

The root object for the query and Mutation needs to be specified. If there is no mutation, you can use EmptyMutation. If there is no subscription, you can use EmptySubscription.

Source

pub fn build_with_ignore_name_conflicts<I, T>( query: Query, mutation: Mutation, subscription: Subscription, ignore_name_conflicts: I, ) -> SchemaBuilder<Query, Mutation, Subscription>
where I: IntoIterator<Item = T>, T: Into<String>,

Create a schema builder and specifies a list to ignore type conflict detection.

NOTE: It is not recommended to use it unless you know what it does.

Source

pub fn new( query: Query, mutation: Mutation, subscription: Subscription, ) -> Schema<Query, Mutation, Subscription>

Create a schema

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 fn names(&self) -> Vec<String>

Get all names in this schema

Maybe you want to serialize a custom binary protocol. In order to minimize message size, a dictionary is usually used to compress type names, field names, directive names, and parameter names. This function gets all the names, so you can create this dictionary.

Source

pub async fn execute(&self, request: impl Into<Request>) -> Response

Execute a GraphQL query.

Source

pub async fn execute_batch(&self, batch_request: BatchRequest) -> BatchResponse

Execute a GraphQL batch query.

Source

pub fn execute_stream_with_session_data( &self, request: impl Into<Request>, 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<Request>, ) -> impl Stream<Item = Response> + Send + Unpin

Execute a GraphQL subscription.

Trait Implementations

Source§

impl<Query, Mutation, Subscription> Clone for Schema<Query, Mutation, Subscription>

Source§

fn clone(&self) -> Schema<Query, Mutation, Subscription>

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<Query, Mutation, Subscription> Default for Schema<Query, Mutation, Subscription>
where Query: Default + ObjectType + 'static, Mutation: Default + ObjectType + 'static, Subscription: Default + SubscriptionType + 'static,

Source§

fn default() -> Schema<Query, Mutation, Subscription>

Returns the “default value” for a type. Read more
Source§

impl<Query, Mutation, Subscription> Executor for Schema<Query, Mutation, Subscription>
where Query: ObjectType + 'static, Mutation: ObjectType + 'static, Subscription: SubscriptionType + 'static,

Source§

async fn execute(&self, request: Request) -> Response

Execute a GraphQL query.
Source§

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

Execute a GraphQL subscription with session data.
Source§

fn execute_batch( &self, batch_request: BatchRequest, ) -> impl Future<Output = BatchResponse> + Send

Execute a GraphQL batch query.