@@ -414,7 +414,8 @@ func defineArgumentMap(args: GraphQLArgumentConfigMap) throws -> [GraphQLArgumen
414
414
name: name,
415
415
type: config. type,
416
416
defaultValue: config. defaultValue,
417
- description: config. description
417
+ description: config. description,
418
+ deprecationReason: config. deprecationReason
418
419
)
419
420
arguments. append ( argument)
420
421
}
@@ -661,15 +662,18 @@ public struct GraphQLArgument {
661
662
public let type : GraphQLInputType
662
663
public let description : String ?
663
664
public let defaultValue : Map ?
665
+ public let deprecationReason : String ?
664
666
665
667
public init (
666
668
type: GraphQLInputType ,
667
669
description: String ? = nil ,
668
- defaultValue: Map ? = nil
670
+ defaultValue: Map ? = nil ,
671
+ deprecationReason: String ? = nil
669
672
) {
670
673
self . type = type
671
674
self . description = description
672
675
self . defaultValue = defaultValue
676
+ self . deprecationReason = deprecationReason
673
677
}
674
678
}
675
679
@@ -678,17 +682,20 @@ public struct GraphQLArgumentDefinition {
678
682
public let type : GraphQLInputType
679
683
public let defaultValue : Map ?
680
684
public let description : String ?
685
+ public let deprecationReason : String ?
681
686
682
687
init (
683
688
name: String ,
684
689
type: GraphQLInputType ,
685
690
defaultValue: Map ? = nil ,
686
- description: String ? = nil
691
+ description: String ? = nil ,
692
+ deprecationReason: String ? = nil
687
693
) {
688
694
self . name = name
689
695
self . type = type
690
696
self . defaultValue = defaultValue
691
697
self . description = description
698
+ self . deprecationReason = deprecationReason
692
699
}
693
700
}
694
701
@@ -702,6 +709,7 @@ extension GraphQLArgumentDefinition: Encodable {
702
709
case description
703
710
case type
704
711
case defaultValue
712
+ case deprecationReason
705
713
}
706
714
707
715
public func encode( to encoder: Encoder ) throws {
@@ -710,6 +718,7 @@ extension GraphQLArgumentDefinition: Encodable {
710
718
try container. encode ( description, forKey: . description)
711
719
try container. encode ( AnyEncodable ( type) , forKey: . type)
712
720
try container. encode ( defaultValue, forKey: . defaultValue)
721
+ try container. encode ( deprecationReason, forKey: . deprecationReason)
713
722
}
714
723
}
715
724
@@ -724,6 +733,8 @@ extension GraphQLArgumentDefinition: KeySubscriptable {
724
733
return type
725
734
case CodingKeys . defaultValue. rawValue:
726
735
return defaultValue
736
+ case CodingKeys . deprecationReason. rawValue:
737
+ return deprecationReason
727
738
default :
728
739
return nil
729
740
}
@@ -1292,7 +1303,8 @@ func defineInputObjectFieldMap(
1292
1303
name: name,
1293
1304
type: field. type,
1294
1305
description: field. description,
1295
- defaultValue: field. defaultValue
1306
+ defaultValue: field. defaultValue,
1307
+ deprecationReason: field. deprecationReason
1296
1308
)
1297
1309
1298
1310
definitionMap [ name] = definition
@@ -1305,11 +1317,18 @@ public struct InputObjectField {
1305
1317
public let type : GraphQLInputType
1306
1318
public let defaultValue : Map ?
1307
1319
public let description : String ?
1320
+ public let deprecationReason : String ?
1308
1321
1309
- public init ( type: GraphQLInputType , defaultValue: Map ? = nil , description: String ? = nil ) {
1322
+ public init (
1323
+ type: GraphQLInputType ,
1324
+ defaultValue: Map ? = nil ,
1325
+ description: String ? = nil ,
1326
+ deprecationReason: String ? = nil
1327
+ ) {
1310
1328
self . type = type
1311
1329
self . defaultValue = defaultValue
1312
1330
self . description = description
1331
+ self . deprecationReason = deprecationReason
1313
1332
}
1314
1333
}
1315
1334
@@ -1320,17 +1339,20 @@ public final class InputObjectFieldDefinition {
1320
1339
public internal( set) var type : GraphQLInputType
1321
1340
public let description : String ?
1322
1341
public let defaultValue : Map ?
1342
+ public let deprecationReason : String ?
1323
1343
1324
1344
init (
1325
1345
name: String ,
1326
1346
type: GraphQLInputType ,
1327
1347
description: String ? = nil ,
1328
- defaultValue: Map ? = nil
1348
+ defaultValue: Map ? = nil ,
1349
+ deprecationReason: String ? = nil
1329
1350
) {
1330
1351
self . name = name
1331
1352
self . type = type
1332
1353
self . description = description
1333
1354
self . defaultValue = defaultValue
1355
+ self . deprecationReason = deprecationReason
1334
1356
}
1335
1357
1336
1358
func replaceTypeReferences( typeMap: TypeMap ) throws {
@@ -1352,6 +1374,7 @@ extension InputObjectFieldDefinition: Encodable {
1352
1374
case description
1353
1375
case type
1354
1376
case defaultValue
1377
+ case deprecationReason
1355
1378
}
1356
1379
1357
1380
public func encode( to encoder: Encoder ) throws {
@@ -1360,6 +1383,7 @@ extension InputObjectFieldDefinition: Encodable {
1360
1383
try container. encode ( description, forKey: . description)
1361
1384
try container. encode ( AnyEncodable ( type) , forKey: . type)
1362
1385
try container. encode ( defaultValue, forKey: . defaultValue)
1386
+ try container. encode ( deprecationReason, forKey: . deprecationReason)
1363
1387
}
1364
1388
}
1365
1389
@@ -1374,6 +1398,8 @@ extension InputObjectFieldDefinition: KeySubscriptable {
1374
1398
return type
1375
1399
case CodingKeys . defaultValue. rawValue:
1376
1400
return defaultValue
1401
+ case CodingKeys . deprecationReason. rawValue:
1402
+ return deprecationReason
1377
1403
default :
1378
1404
return nil
1379
1405
}
0 commit comments