(warp) impl_object refactor

This commit is contained in:
Christoph Herzog 2019-05-07 10:56:33 +02:00
parent 1b30e012ae
commit f72f808be3
No known key found for this signature in database
GPG key ID: DAFF71D48B493238

View file

@ -134,13 +134,18 @@ where
///
/// struct QueryRoot;
///
/// juniper::graphql_object! (QueryRoot: ExampleContext |&self| {
/// field say_hello(&executor) -> String {
/// let context = executor.context();
///
/// format!("good morning {}, the app state is {:?}", context.1, context.0)
/// #[juniper::impl_object(
/// Context = ExampleContext
/// )]
/// impl QueryRoot {
/// fn say_hello(context: &ExampleContext) -> String {
/// format!(
/// "good morning {}, the app state is {:?}",
/// context.1,
/// context.0
/// )
/// }
/// });
/// }
///
/// let schema = RootNode::new(QueryRoot, EmptyMutation::new());
///