File tree Expand file tree Collapse file tree 4 files changed +71
-0
lines changed Expand file tree Collapse file tree 4 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1052
1052
"name" : " String" ,
1053
1053
"ofType" : null
1054
1054
}
1055
+ },
1056
+ {
1057
+ "args" : [],
1058
+ "deprecationReason" : null ,
1059
+ "description" : null ,
1060
+ "isDeprecated" : false ,
1061
+ "name" : " isDeprecated" ,
1062
+ "type" : {
1063
+ "kind" : " NON_NULL" ,
1064
+ "name" : null ,
1065
+ "ofType" : {
1066
+ "kind" : " SCALAR" ,
1067
+ "name" : " Boolean" ,
1068
+ "ofType" : null
1069
+ }
1070
+ }
1071
+ },
1072
+ {
1073
+ "args" : [],
1074
+ "deprecationReason" : null ,
1075
+ "description" : null ,
1076
+ "isDeprecated" : false ,
1077
+ "name" : " deprecationReason" ,
1078
+ "type" : {
1079
+ "kind" : " SCALAR" ,
1080
+ "name" : " String" ,
1081
+ "ofType" : null
1082
+ }
1055
1083
}
1056
1084
],
1057
1085
"inputFields" : null ,
Original file line number Diff line number Diff line change 1694
1694
"name" : " String" ,
1695
1695
"ofType" : null
1696
1696
}
1697
+ },
1698
+ {
1699
+ "args" : [],
1700
+ "deprecationReason" : null ,
1701
+ "description" : null ,
1702
+ "isDeprecated" : false ,
1703
+ "name" : " isDeprecated" ,
1704
+ "type" : {
1705
+ "kind" : " NON_NULL" ,
1706
+ "name" : null ,
1707
+ "ofType" : {
1708
+ "kind" : " SCALAR" ,
1709
+ "name" : " Boolean" ,
1710
+ "ofType" : null
1711
+ }
1712
+ }
1713
+ },
1714
+ {
1715
+ "args" : [],
1716
+ "deprecationReason" : null ,
1717
+ "description" : null ,
1718
+ "isDeprecated" : false ,
1719
+ "name" : " deprecationReason" ,
1720
+ "type" : {
1721
+ "kind" : " SCALAR" ,
1722
+ "name" : " String" ,
1723
+ "ofType" : null
1724
+ }
1697
1725
}
1698
1726
],
1699
1727
"inputFields" : null ,
Original file line number Diff line number Diff line change @@ -148,6 +148,8 @@ var metaSrc = `
148
148
type: __Type!
149
149
# A GraphQL-formatted string representing the default value for this input value.
150
150
defaultValue: String
151
+ isDeprecated: Boolean!
152
+ deprecationReason: String
151
153
}
152
154
153
155
# A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all
Original file line number Diff line number Diff line change @@ -270,6 +270,19 @@ func (r *InputValue) DefaultValue() *string {
270
270
return & s
271
271
}
272
272
273
+ func (r * InputValue ) IsDeprecated () bool {
274
+ return r .value .Directives .Get ("deprecated" ) != nil
275
+ }
276
+
277
+ func (r * InputValue ) DeprecationReason () * string {
278
+ d := r .value .Directives .Get ("deprecated" )
279
+ if d == nil {
280
+ return nil
281
+ }
282
+ reason := d .Arguments .MustGet ("reason" ).Deserialize (nil ).(string )
283
+ return & reason
284
+ }
285
+
273
286
type EnumValue struct {
274
287
value * ast.EnumValueDefinition
275
288
}
You can’t perform that action at this time.
0 commit comments