File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,8 @@ var DeprecatedDirective = NewDirective(DirectiveConfig{
143
143
},
144
144
Locations : []string {
145
145
DirectiveLocationFieldDefinition ,
146
+ DirectiveLocationArgumentDefinition ,
147
+ DirectiveLocationInputFieldDefinition ,
146
148
DirectiveLocationEnumValue ,
147
149
},
148
150
})
Original file line number Diff line number Diff line change @@ -275,6 +275,26 @@ func init() {
275
275
return nil , nil
276
276
},
277
277
},
278
+ "isDeprecated" : & Field {
279
+ Type : NewNonNull (Boolean ),
280
+ Resolve : func (p ResolveParams ) (interface {}, error ) {
281
+ if field , ok := p .Source .(* FieldDefinition ); ok {
282
+ return (field .DeprecationReason != "" ), nil
283
+ }
284
+ return false , nil
285
+ },
286
+ },
287
+ "deprecationReason" : & Field {
288
+ Type : String ,
289
+ Resolve : func (p ResolveParams ) (interface {}, error ) {
290
+ if field , ok := p .Source .(* FieldDefinition ); ok {
291
+ if field .DeprecationReason != "" {
292
+ return field .DeprecationReason , nil
293
+ }
294
+ }
295
+ return nil , nil
296
+ },
297
+ },
278
298
},
279
299
})
280
300
You can’t perform that action at this time.
0 commit comments