@@ -20,7 +20,7 @@ naturally map to GraphQL features, such as `Option<T>`, `Vec<T>`, `Box<T>`,
20
20
21
21
For more advanced mappings, Juniper provides multiple macros to map your Rust
22
22
types to a GraphQL schema. The most important one is the
23
- [ impl_object ] [ jp_impl_object ] procedural macro that is used for declaring an object with
23
+ [ object ] [ jp_object ] procedural macro that is used for declaring an object with
24
24
resolvers, which you will use for the ` Query ` and ` Mutation ` roots.
25
25
26
26
``` rust
@@ -60,7 +60,7 @@ struct NewHuman {
60
60
}
61
61
62
62
// Now, we create our root Query and Mutation types with resolvers by using the
63
- // impl_object macro.
63
+ // object macro.
64
64
// Objects can have contexts that allow accessing shared state like a database
65
65
// pool.
66
66
@@ -74,7 +74,7 @@ impl juniper::Context for Context {}
74
74
75
75
struct Query ;
76
76
77
- #[juniper:: impl_object (
77
+ #[juniper:: object (
78
78
// Here we specify the context type for the object.
79
79
// We need to do this in every type that
80
80
// needs access to the context.
@@ -105,7 +105,7 @@ impl Query {
105
105
106
106
struct Mutation ;
107
107
108
- #[juniper:: impl_object (
108
+ #[juniper:: object (
109
109
Context = Context ,
110
110
)]
111
111
impl Mutation {
@@ -156,7 +156,7 @@ impl juniper::Context for Ctx {}
156
156
157
157
struct Query ;
158
158
159
- #[juniper:: impl_object (
159
+ #[juniper:: object (
160
160
Context = Ctx ,
161
161
)]
162
162
impl Query {
@@ -198,4 +198,4 @@ fn main() {
198
198
[ rocket ] : servers/rocket.md
199
199
[ iron ] : servers/iron.md
200
200
[ tutorial ] : ./tutorial.html
201
- [ jp_obj_macro ] : https://docs.rs/juniper/latest/juniper/macro.impl_object .html
201
+ [ jp_obj_macro ] : https://docs.rs/juniper/latest/juniper/macro.object .html
0 commit comments