File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ use juniper::Value;
17
17
18
18
struct UserID (String );
19
19
20
- juniper :: graphql_scalar! (UserID {
20
+ juniper :: graphql_scalar! (UserID where Scalar = < S > {
21
21
description : " An opaque identifier, represented as a string"
22
22
23
23
resolve (& self ) -> Value {
@@ -30,11 +30,17 @@ juniper::graphql_scalar!(UserID {
30
30
v . as_scalar_value :: <String >(). map (| s | UserID (s . to_owned ()))
31
31
}
32
32
33
- from_str <'a >(value : ScalarToken <'a >) -> juniper :: ParseScalarResult <'a , juniper :: DefaultScalarValue > {
34
- <String as juniper :: ParseScalarValue >:: from_str (value )
33
+ from_str <'a >(value : ScalarToken <'a >) -> juniper :: ParseScalarResult <'a , S > {
34
+ <String as juniper :: ParseScalarValue < S > >:: from_str (value )
35
35
}
36
36
});
37
37
38
+ #[derive(juniper:: GraphQLObject )]
39
+ struct User {
40
+ id : UserID ,
41
+ username : String ,
42
+ }
43
+
38
44
# fn main () {}
39
45
```
40
46
You can’t perform that action at this time.
0 commit comments