@@ -35,7 +35,7 @@ impl GqlObject {
35
35
let mut item = GqlObject :: new ( obj. name . into ( ) , description) ;
36
36
item. fields
37
37
. extend ( obj. fields . iter ( ) . map ( |f| GqlObjectField {
38
- description : None ,
38
+ description : f . description . clone ( ) ,
39
39
name : f. name . clone ( ) ,
40
40
type_ : FieldType :: from ( f. field_type . clone ( ) ) ,
41
41
} ) ) ;
@@ -50,7 +50,7 @@ impl GqlObject {
50
50
) ;
51
51
let fields = obj. fields . clone ( ) . unwrap ( ) . into_iter ( ) . filter_map ( |t| {
52
52
t. map ( |t| GqlObjectField {
53
- description : None ,
53
+ description : t . description . clone ( ) ,
54
54
name : t. name . expect ( "field name" ) ,
55
55
type_ : FieldType :: from ( t. type_ . expect ( "field type" ) ) ,
56
56
} )
@@ -70,11 +70,13 @@ impl GqlObject {
70
70
let name = Ident :: new ( prefix, Span :: call_site ( ) ) ;
71
71
let fields = self . response_fields_for_selection ( query_context, selection, prefix) ?;
72
72
let field_impls = self . field_impls_for_selection ( query_context, selection, & prefix) ?;
73
+ let description = self . description . as_ref ( ) . map ( |desc| quote ! ( #[ doc = #desc] ) ) ;
73
74
Ok ( quote ! {
74
75
#( #field_impls) *
75
76
76
77
#[ derive( Debug , Serialize , Deserialize ) ]
77
78
#[ serde( rename_all = "camelCase" ) ]
79
+ #description
78
80
pub struct #name {
79
81
#( #fields, ) *
80
82
}
0 commit comments