@@ -88,6 +88,44 @@ macro_rules! graphql_interface {
88
88
( @as_item, $i: item) => { $i } ;
89
89
( @as_expr, $e: expr) => { $e } ;
90
90
91
+ // field deprecated <reason> <name>(...) -> <type> as <description> { ... }
92
+ (
93
+ @gather_meta,
94
+ $reg: expr, $acc: expr, $descr: expr,
95
+ field deprecated $reason: tt $name: ident $args: tt -> $t: ty as $desc: tt $body: block $( $rest: tt ) *
96
+ ) => {
97
+ $acc. push( __graphql__args!(
98
+ @apply_args,
99
+ $reg,
100
+ $reg. field_inside_result(
101
+ & $crate:: to_snake_case( stringify!( $name) ) ,
102
+ Err ( "dummy" . to_owned( ) ) as $t)
103
+ . description( $desc)
104
+ . deprecated( $reason) ,
105
+ $args) ) ;
106
+
107
+ graphql_interface!( @gather_meta, $reg, $acc, $descr, $( $rest ) * ) ;
108
+ } ;
109
+
110
+ // field deprecated <reason> <name>(...) -> <type> { ... }
111
+ (
112
+ @gather_meta,
113
+ $reg: expr, $acc: expr, $descr: expr,
114
+ field deprecated $reason: tt $name: ident $args: tt -> $t: ty $body: block $( $rest: tt ) *
115
+ ) => {
116
+ $acc. push( __graphql__args!(
117
+ @apply_args,
118
+ $reg,
119
+ $reg. field_inside_result(
120
+ & $crate:: to_snake_case( stringify!( $name) ) ,
121
+ Err ( "dummy" . to_owned( ) ) as $t)
122
+ . deprecated( $reason) ,
123
+ $args) ) ;
124
+
125
+ graphql_interface!( @gather_meta, $reg, $acc, $descr, $( $rest ) * ) ;
126
+ } ;
127
+
128
+ // field <name>(...) -> <type> as <description> { ... }
91
129
(
92
130
@gather_meta,
93
131
$reg: expr, $acc: expr, $descr: expr,
@@ -105,6 +143,7 @@ macro_rules! graphql_interface {
105
143
graphql_interface!( @gather_meta, $reg, $acc, $descr, $( $rest ) * ) ;
106
144
} ;
107
145
146
+ // field <name>(...) -> <type> { ... }
108
147
(
109
148
@gather_meta,
110
149
$reg: expr, $acc: expr, $descr: expr,
@@ -121,6 +160,7 @@ macro_rules! graphql_interface {
121
160
graphql_interface!( @gather_meta, $reg, $acc, $descr, $( $rest ) * ) ;
122
161
} ;
123
162
163
+ // description: <description>
124
164
(
125
165
@gather_meta,
126
166
$reg: expr, $acc: expr, $descr: expr,
@@ -131,16 +171,36 @@ macro_rules! graphql_interface {
131
171
graphql_interface!( @gather_meta, $reg, $acc, $descr, $( $rest ) * )
132
172
} ;
133
173
174
+ // instance_resolvers: | <ctxtvar> | [...]
134
175
(
135
176
@gather_meta,
136
177
$reg: expr, $acc: expr, $descr: expr,
137
- instance_resolvers: | $execvar : pat | $resolvers: tt $( $rest: tt ) *
178
+ instance_resolvers: | $ctxtvar : pat | $resolvers: tt $( $rest: tt ) *
138
179
) => {
139
180
graphql_interface!( @gather_meta, $reg, $acc, $descr, $( $rest ) * )
140
181
} ;
141
182
142
183
( @gather_meta, $reg: expr, $acc: expr, $descr: expr, $( , ) * ) => { } ;
143
184
185
+ // field deprecated <reason> <name>(...) -> <type> as <description> { ... }
186
+ (
187
+ @resolve_into_type,
188
+ $buildargs: tt,
189
+ field deprecated $reason: tt $name: ident $args: tt -> $t: ty as $descr: tt $body: block $( $rest: tt ) *
190
+ ) => {
191
+ graphql_interface!( @resolve_into_type, $buildargs, $( $rest ) * )
192
+ } ;
193
+
194
+ // field deprecated <reason> <name>(...) -> <type> { ... }
195
+ (
196
+ @resolve_into_type,
197
+ $buildargs: tt,
198
+ field deprecated $reason: tt $name: ident $args: tt -> $t: ty $body: block $( $rest: tt ) *
199
+ ) => {
200
+ graphql_interface!( @resolve_into_type, $buildargs, $( $rest ) * )
201
+ } ;
202
+
203
+ // field <name>(...) -> <type> as <description> { ... }
144
204
(
145
205
@resolve_into_type,
146
206
$buildargs: tt,
@@ -149,6 +209,7 @@ macro_rules! graphql_interface {
149
209
graphql_interface!( @resolve_into_type, $buildargs, $( $rest ) * )
150
210
} ;
151
211
212
+ // field <name>(...) -> <type> { ... }
152
213
(
153
214
@resolve_into_type,
154
215
$buildargs: tt,
@@ -157,50 +218,59 @@ macro_rules! graphql_interface {
157
218
graphql_interface!( @resolve_into_type, $buildargs, $( $rest ) * )
158
219
} ;
159
220
221
+ // description: <description>
160
222
(
161
223
@resolve_into_type,
162
224
$buildargs: tt, description : $value: tt $( $rest: tt ) *
163
225
) => {
164
226
graphql_interface!( @resolve_into_type, $buildargs, $( $rest ) * )
165
227
} ;
166
228
229
+ // field deprecated <reason> <name>(...) -> <type> as <description> { ... }
167
230
(
168
- @resolve_into_type,
169
- $buildargs: tt, interfaces : $value: tt $( $rest: tt ) *
231
+ @concrete_type_name,
232
+ $buildargs: tt,
233
+ field deprecated $reason: tt $name: ident $args: tt -> $t: ty as $descr: tt $body: block $( $rest: tt ) *
170
234
) => {
171
- graphql_interface!( @resolve_into_type , $buildargs, $( $rest ) * )
235
+ graphql_interface!( @concrete_type_name , $buildargs, $( $rest ) * )
172
236
} ;
173
237
238
+ // field deprecated <reason> <name>(...) -> <type> { ... }
174
239
(
175
240
@concrete_type_name,
176
241
$buildargs: tt,
177
- field $ name: ident $args: tt -> $t: ty as $descr : tt $body: block $( $rest: tt ) *
242
+ field deprecated $reason : tt $ name: ident $args: tt -> $t: ty $body: block $( $rest: tt ) *
178
243
) => {
179
244
graphql_interface!( @concrete_type_name, $buildargs, $( $rest ) * )
180
245
} ;
181
246
247
+ // field <name>(...) -> <type> as <description> { ... }
182
248
(
183
249
@concrete_type_name,
184
250
$buildargs: tt,
185
- field $name: ident $args: tt -> $t: ty $body: block $( $rest: tt ) *
251
+ field $name: ident $args: tt -> $t: ty as $descr : tt $body: block $( $rest: tt ) *
186
252
) => {
187
253
graphql_interface!( @concrete_type_name, $buildargs, $( $rest ) * )
188
254
} ;
189
255
256
+ // field <name>(...) -> <type> { ... }
190
257
(
191
258
@concrete_type_name,
192
- $buildargs: tt, description : $value: tt $( $rest: tt ) *
259
+ $buildargs: tt,
260
+ field $name: ident $args: tt -> $t: ty $body: block $( $rest: tt ) *
193
261
) => {
194
262
graphql_interface!( @concrete_type_name, $buildargs, $( $rest ) * )
195
263
} ;
196
264
265
+ // description: <description>
197
266
(
198
267
@concrete_type_name,
199
- $buildargs: tt, interfaces : $value: tt $( $rest: tt ) *
268
+ $buildargs: tt, description : $value: tt $( $rest: tt ) *
200
269
) => {
201
270
graphql_interface!( @concrete_type_name, $buildargs, $( $rest ) * )
202
271
} ;
203
272
273
+ // instance_resolvers: | <ctxtvar> | [...]
204
274
(
205
275
@concrete_type_name,
206
276
( $outname: tt, $ctxtarg: ident, $ctxttype: ty) ,
@@ -225,6 +295,7 @@ macro_rules! graphql_interface {
225
295
( )
226
296
} ;
227
297
298
+ // instance_resolvers: | <ctxtvar> |
228
299
(
229
300
@resolve_into_type,
230
301
( $outname: tt, $typenamearg: ident, $execarg: ident, $ctxttype: ty) ,
0 commit comments