pub struct GraphQL<E> { /* private fields */ }
Expand description

A GraphQL query endpoint.

Example

use async_graphql::{EmptyMutation, EmptySubscription, Object, Schema};
use async_graphql_poem::GraphQL;
use poem::{post, Route};

struct Query;

#[Object]
impl Query {
    async fn value(&self) -> i32 {
        100
    }
}

type MySchema = Schema<Query, EmptyMutation, EmptySubscription>;

let schema = Schema::new(Query, EmptyMutation, EmptySubscription);
let app = Route::new().at("/", post(GraphQL::new(schema)));

Implementations§

Create a GraphQL query endpoint.

Trait Implementations§

Represents the response of the endpoint.
Get the response to the request.
Get the response to the request and return a Response. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Wrap the endpoint in a Box.
Use middleware to transform this endpoint. Read more
if enable is true then use middleware to transform this endpoint. Read more
Attach a state data to the endpoint, similar to with(AddData(T)). Read more
if data is Some(T) then attach the value to the endpoint.
Maps the request of this endpoint. Read more
Maps the output of this endpoint. Read more
Maps the request and response of this endpoint. Read more
Convert the output of this endpoint into a response. Response. Read more
Convert the output of this endpoint into a response. Response. Read more
Maps the response of this endpoint. Read more
Calls f if the result is Ok, otherwise returns the Err value of self. Read more
Catch all errors and convert it into a response. Read more
Catch the specified type of error and convert it into a response. Read more
Does something with each error. Read more
Does something with each specified error type. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Represents the endpoint type.
Converts this object into endpoint.
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more