Struct juniper_iron::GraphQLHandler[][src]

pub struct GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S = DefaultScalarValue> where
    S: ScalarValue,
    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,
    Subscription: GraphQLType<S, Context = CtxT> + Send + Sync + 'static, 
{ /* fields omitted */ }
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

Performs the conversion.

Performs the conversion.

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.