Skip to content

Commit c7e0c1f

Browse files
committed
(warp) impl_object refactor
1 parent 3b34ffa commit c7e0c1f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

juniper_warp/src/lib.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,18 @@ where
134134
///
135135
/// struct QueryRoot;
136136
///
137-
/// juniper::graphql_object! (QueryRoot: ExampleContext |&self| {
138-
/// field say_hello(&executor) -> String {
139-
/// let context = executor.context();
140-
///
141-
/// format!("good morning {}, the app state is {:?}", context.1, context.0)
137+
/// #[juniper::impl_object(
138+
/// Context = ExampleContext
139+
/// )]
140+
/// impl QueryRoot {
141+
/// fn say_hello(context: &ExampleContext) -> String {
142+
/// format!(
143+
/// "good morning {}, the app state is {:?}",
144+
/// context.1,
145+
/// context.0
146+
/// )
142147
/// }
143-
/// });
148+
/// }
144149
///
145150
/// let schema = RootNode::new(QueryRoot, EmptyMutation::new());
146151
///

0 commit comments

Comments
 (0)