@@ -19,7 +19,7 @@ Syntax to validate:
19
19
20
20
struct Concrete ;
21
21
22
- struct DefaultName ;
22
+ struct CustomName ;
23
23
24
24
#[ allow( dead_code) ]
25
25
struct WithLifetime < ' a > { data : PhantomData < & ' a i64 > }
@@ -42,7 +42,7 @@ graphql_object!(Concrete: () |&self| {
42
42
field simple( ) -> i64 { 0 }
43
43
} ) ;
44
44
45
- graphql_interface ! ( DefaultName : ( ) |& self | {
45
+ graphql_interface ! ( CustomName : ( ) as "ACustomNamedInterface" |& self | {
46
46
field simple( ) -> i64 { 0 }
47
47
48
48
instance_resolvers: |_| { Concrete => Some ( Concrete ) }
@@ -60,31 +60,31 @@ graphql_interface!(<T> WithGenerics<T>: () as "WithGenerics" |&self| {
60
60
} ) ;
61
61
62
62
63
- graphql_interface ! ( DescriptionFirst : ( ) as "DescriptionFirst" |& self | {
63
+ graphql_interface ! ( DescriptionFirst : ( ) |& self | {
64
64
description: "A description"
65
65
66
66
field simple( ) -> i64 { 0 }
67
67
68
68
instance_resolvers: |_| { Concrete => Some ( Concrete ) }
69
69
} ) ;
70
70
71
- graphql_interface ! ( FieldsFirst : ( ) as "FieldsFirst" |& self | {
71
+ graphql_interface ! ( FieldsFirst : ( ) |& self | {
72
72
field simple( ) -> i64 { 0 }
73
73
74
74
description: "A description"
75
75
76
76
instance_resolvers: |_| { Concrete => Some ( Concrete ) }
77
77
} ) ;
78
78
79
- graphql_interface ! ( InterfacesFirst : ( ) as "InterfacesFirst" |& self | {
79
+ graphql_interface ! ( InterfacesFirst : ( ) |& self | {
80
80
instance_resolvers: |_| { Concrete => Some ( Concrete ) }
81
81
82
82
field simple( ) -> i64 { 0 }
83
83
84
84
description: "A description"
85
85
} ) ;
86
86
87
- graphql_interface ! ( CommasWithTrailing : ( ) as "CommasWithTrailing" |& self | {
87
+ graphql_interface ! ( CommasWithTrailing : ( ) |& self | {
88
88
instance_resolvers: |_| { Concrete => Some ( Concrete ) } ,
89
89
90
90
field simple( ) -> i64 { 0 } ,
@@ -93,23 +93,23 @@ graphql_interface!(CommasWithTrailing: () as "CommasWithTrailing" |&self| {
93
93
} ) ;
94
94
95
95
96
- graphql_interface ! ( CommasOnMeta : ( ) as "CommasOnMeta" |& self | {
96
+ graphql_interface ! ( CommasOnMeta : ( ) |& self | {
97
97
instance_resolvers: |_| { Concrete => Some ( Concrete ) }
98
98
description: "A description" ,
99
99
100
100
field simple( ) -> i64 { 0 }
101
101
} ) ;
102
102
103
103
104
- graphql_interface ! ( ResolversWithTrailingComma : ( ) as "ResolversWithTrailingComma" |& self | {
104
+ graphql_interface ! ( ResolversWithTrailingComma : ( ) |& self | {
105
105
instance_resolvers: |_| { Concrete => Some ( Concrete ) , }
106
106
description: "A description" ,
107
107
108
108
field simple( ) -> i64 { 0 }
109
109
} ) ;
110
110
111
111
graphql_object ! ( <' a> Root : ( ) as "Root" |& self | {
112
- field default_name ( ) -> DefaultName { DefaultName { } }
112
+ field custom_name ( ) -> CustomName { CustomName { } }
113
113
114
114
field with_lifetime( ) -> WithLifetime <' a> { WithLifetime { data: PhantomData } }
115
115
field with_generics( ) -> WithGenerics <i64 > { WithGenerics { data: 123 } }
@@ -167,9 +167,9 @@ fn run_type_info_query<F>(type_name: &str, f: F)
167
167
}
168
168
169
169
#[ test]
170
- fn introspect_default_name ( ) {
171
- run_type_info_query ( "DefaultName " , |object, fields| {
172
- assert_eq ! ( object. get( "name" ) , Some ( & Value :: string( "DefaultName " ) ) ) ;
170
+ fn introspect_custom_name ( ) {
171
+ run_type_info_query ( "ACustomNamedInterface " , |object, fields| {
172
+ assert_eq ! ( object. get( "name" ) , Some ( & Value :: string( "ACustomNamedInterface " ) ) ) ;
173
173
assert_eq ! ( object. get( "description" ) , Some ( & Value :: null( ) ) ) ;
174
174
175
175
assert ! ( fields. contains( & Value :: object( vec![
0 commit comments