pub struct GraphQLHandler<'a, CtxFactory, Query, Mutation, CtxT, S = DefaultScalarValue>where
    S: ScalarValue,
    for<'b> &'b S: ScalarRefValue<'b>,
    CtxFactory: Fn(&mut Request<'_, '_>) -> IronResult<CtxT> + Send + Sync + 'static,
    CtxT: 'static,
    Query: GraphQLType<S, Context = CtxT> + Send + Sync + 'static,
    Mutation: GraphQLType<S, Context = CtxT> + Send + Sync + 'static,
{ /* private fields */ }
Expand description

Handler that executes GraphQL queries in the given schema

The handler responds to GET requests and POST requests only. In GET requests, the query should be supplied in the query URL parameter, e.g. http://localhost:3000/graphql?query={hero{name}}.

POST requests support both queries and variables. POST a JSON document to this endpoint containing the field "query" and optionally "variables". The variables should be a JSON object containing the variable to value mapping.

Implementations§

Build a new GraphQL handler

The context factory will receive the Iron request object and is expected to construct a context object for the given schema. This can be used to construct e.g. database connections or similar data that the schema needs to execute the query.

Trait Implementations§

Produce a Response from a Request, with the possibility of error.

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

Returns the argument unchanged.

Calls U::from(self).

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

Convert self into a value of type T.
Convert self into a value of type T.
Convert self into a value of type T.
Convert self into a value of type T.
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.
Get the TypeId of this object.