Skip to content

Commit

Permalink
(warp) impl_object refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
theduke committed May 7, 2019
1 parent 3b34ffa commit c7e0c1f
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions juniper_warp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
///
Expand Down

0 comments on commit c7e0c1f

Please sign in to comment.