(warp) impl_object refactor
This commit is contained in:
parent
1b30e012ae
commit
f72f808be3
1 changed files with 11 additions and 6 deletions
|
@ -134,13 +134,18 @@ where
|
||||||
///
|
///
|
||||||
/// struct QueryRoot;
|
/// struct QueryRoot;
|
||||||
///
|
///
|
||||||
/// juniper::graphql_object! (QueryRoot: ExampleContext |&self| {
|
/// #[juniper::impl_object(
|
||||||
/// field say_hello(&executor) -> String {
|
/// Context = ExampleContext
|
||||||
/// let context = executor.context();
|
/// )]
|
||||||
///
|
/// impl QueryRoot {
|
||||||
/// format!("good morning {}, the app state is {:?}", context.1, context.0)
|
/// fn say_hello(context: &ExampleContext) -> String {
|
||||||
|
/// format!(
|
||||||
|
/// "good morning {}, the app state is {:?}",
|
||||||
|
/// context.1,
|
||||||
|
/// context.0
|
||||||
|
/// )
|
||||||
/// }
|
/// }
|
||||||
/// });
|
/// }
|
||||||
///
|
///
|
||||||
/// let schema = RootNode::new(QueryRoot, EmptyMutation::new());
|
/// let schema = RootNode::new(QueryRoot, EmptyMutation::new());
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Reference in a new issue