Skip to content

Commit 37bd1f0

Browse files
authored
Merge branch 'master' into updated-with-bens-fix
2 parents 385c45b + 2e2b648 commit 37bd1f0

File tree

3 files changed

+68
-50
lines changed

3 files changed

+68
-50
lines changed

introspection.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@ func init() {
312312
},
313313
"deprecationReason": &Field{
314314
Type: String,
315+
Resolve: func(p ResolveParams) (interface{}, error) {
316+
if field, ok := p.Source.(*FieldDefinition); ok {
317+
if field.DeprecationReason != "" {
318+
return field.DeprecationReason, nil
319+
}
320+
}
321+
return nil, nil
322+
},
315323
},
316324
},
317325
})
@@ -497,6 +505,14 @@ func init() {
497505
},
498506
"deprecationReason": &Field{
499507
Type: String,
508+
Resolve: func(p ResolveParams) (interface{}, error) {
509+
if field, ok := p.Source.(*EnumValueDefinition); ok {
510+
if field.DeprecationReason != "" {
511+
return field.DeprecationReason, nil
512+
}
513+
}
514+
return nil, nil
515+
},
500516
},
501517
},
502518
})

0 commit comments

Comments
 (0)