[−][src]Struct juniper_iron::GraphQLHandler
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
impl<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> where
S: ScalarValue + Send + Sync + 'static,
CtxFactory: Fn(&mut Request<'_, '_>) -> IronResult<CtxT> + Send + Sync + 'static,
CtxT: Send + Sync + 'static,
Query: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Mutation: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Subscription: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
[src]
S: ScalarValue + Send + Sync + 'static,
CtxFactory: Fn(&mut Request<'_, '_>) -> IronResult<CtxT> + Send + Sync + 'static,
CtxT: Send + Sync + 'static,
Query: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Mutation: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Subscription: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
pub fn new(
context_factory: CtxFactory,
query: Query,
mutation: Mutation,
subscription: Subscription
) -> Self
[src]
context_factory: CtxFactory,
query: Query,
mutation: Mutation,
subscription: Subscription
) -> Self
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
impl<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> Handler for GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> where
S: ScalarValue + Sync + Send + 'static,
CtxFactory: Fn(&mut Request<'_, '_>) -> IronResult<CtxT> + Send + Sync + 'static,
CtxT: Send + Sync + 'static,
Query: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Mutation: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Subscription: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
'a: 'static,
[src]
S: ScalarValue + Sync + Send + 'static,
CtxFactory: Fn(&mut Request<'_, '_>) -> IronResult<CtxT> + Send + Sync + 'static,
CtxT: Send + Sync + 'static,
Query: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Mutation: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
Subscription: GraphQLType<S, Context = CtxT, TypeInfo = ()> + Send + Sync + 'static,
'a: 'static,
pub fn handle(&self, req: &mut Request<'_, '_>) -> IronResult<Response>
[src]
Auto Trait Implementations
impl<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> RefUnwindSafe for GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> where
CtxFactory: RefUnwindSafe,
Mutation: RefUnwindSafe,
Query: RefUnwindSafe,
S: RefUnwindSafe,
Subscription: RefUnwindSafe,
<Mutation as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
<Query as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
<Subscription as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
CtxFactory: RefUnwindSafe,
Mutation: RefUnwindSafe,
Query: RefUnwindSafe,
S: RefUnwindSafe,
Subscription: RefUnwindSafe,
<Mutation as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
<Query as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
<Subscription as GraphQLValue<S>>::TypeInfo: RefUnwindSafe,
impl<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> Send for GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> where
S: Send,
<Mutation as GraphQLValue<S>>::TypeInfo: Send,
<Query as GraphQLValue<S>>::TypeInfo: Send,
<Subscription as GraphQLValue<S>>::TypeInfo: Send,
S: Send,
<Mutation as GraphQLValue<S>>::TypeInfo: Send,
<Query as GraphQLValue<S>>::TypeInfo: Send,
<Subscription as GraphQLValue<S>>::TypeInfo: Send,
impl<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> Sync for GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> where
S: Sync,
<Mutation as GraphQLValue<S>>::TypeInfo: Sync,
<Query as GraphQLValue<S>>::TypeInfo: Sync,
<Subscription as GraphQLValue<S>>::TypeInfo: Sync,
S: Sync,
<Mutation as GraphQLValue<S>>::TypeInfo: Sync,
<Query as GraphQLValue<S>>::TypeInfo: Sync,
<Subscription as GraphQLValue<S>>::TypeInfo: Sync,
impl<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> Unpin for GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> where
CtxFactory: Unpin,
Mutation: Unpin,
Query: Unpin,
S: Unpin,
Subscription: Unpin,
<Mutation as GraphQLValue<S>>::TypeInfo: Unpin,
<Query as GraphQLValue<S>>::TypeInfo: Unpin,
<Subscription as GraphQLValue<S>>::TypeInfo: Unpin,
CtxFactory: Unpin,
Mutation: Unpin,
Query: Unpin,
S: Unpin,
Subscription: Unpin,
<Mutation as GraphQLValue<S>>::TypeInfo: Unpin,
<Query as GraphQLValue<S>>::TypeInfo: Unpin,
<Subscription as GraphQLValue<S>>::TypeInfo: Unpin,
impl<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> UnwindSafe for GraphQLHandler<'a, CtxFactory, Query, Mutation, Subscription, CtxT, S> where
CtxFactory: UnwindSafe,
Mutation: UnwindSafe,
Query: UnwindSafe,
S: UnwindSafe,
Subscription: UnwindSafe,
<Mutation as GraphQLValue<S>>::TypeInfo: UnwindSafe,
<Query as GraphQLValue<S>>::TypeInfo: UnwindSafe,
<Subscription as GraphQLValue<S>>::TypeInfo: UnwindSafe,
CtxFactory: UnwindSafe,
Mutation: UnwindSafe,
Query: UnwindSafe,
S: UnwindSafe,
Subscription: UnwindSafe,
<Mutation as GraphQLValue<S>>::TypeInfo: UnwindSafe,
<Query as GraphQLValue<S>>::TypeInfo: UnwindSafe,
<Subscription as GraphQLValue<S>>::TypeInfo: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> PersistentInto<Arc<Mutex<T>>> for T
pub fn persistent_into(self) -> Arc<Mutex<T>>
impl<T> PersistentInto<Arc<RwLock<T>>> for T
pub fn persistent_into(self) -> Arc<RwLock<T>>
impl<T> PersistentInto<Arc<T>> for T
pub fn persistent_into(self) -> Arc<T>
impl<T> PersistentInto<T> for T
pub fn persistent_into(self) -> T
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,