@@ -604,6 +604,7 @@ class GraphQLArgument:
604
604
type : "GraphQLInputType"
605
605
default_value : Any
606
606
description : Optional [str ]
607
+ deprecation_reason : Optional [str ]
607
608
out_name : Optional [str ] # for transforming names (extension of GraphQL.js)
608
609
extensions : Optional [Dict [str , Any ]]
609
610
ast_node : Optional [InputValueDefinitionNode ]
@@ -613,6 +614,7 @@ def __init__(
613
614
type_ : "GraphQLInputType" ,
614
615
default_value : Any = Undefined ,
615
616
description : Optional [str ] = None ,
617
+ deprecation_reason : Optional [str ] = None ,
616
618
out_name : Optional [str ] = None ,
617
619
extensions : Optional [Dict [str , Any ]] = None ,
618
620
ast_node : Optional [InputValueDefinitionNode ] = None ,
@@ -621,6 +623,8 @@ def __init__(
621
623
raise TypeError ("Argument type must be a GraphQL input type." )
622
624
if description is not None and not is_description (description ):
623
625
raise TypeError ("Argument description must be a string." )
626
+ if deprecation_reason is not None and not is_description (deprecation_reason ):
627
+ raise TypeError ("Argument deprecation reason must be a string." )
624
628
if out_name is not None and not isinstance (out_name , str ):
625
629
raise TypeError ("Argument out name must be a string." )
626
630
if extensions is not None and (
@@ -635,6 +639,7 @@ def __init__(
635
639
self .type = type_
636
640
self .default_value = default_value
637
641
self .description = description
642
+ self .deprecation_reason = deprecation_reason
638
643
self .out_name = out_name
639
644
self .extensions = extensions
640
645
self .ast_node = ast_node
@@ -645,6 +650,7 @@ def __eq__(self, other: Any) -> bool:
645
650
and self .type == other .type
646
651
and self .default_value == other .default_value
647
652
and self .description == other .description
653
+ and self .deprecation_reason == other .deprecation_reason
648
654
and self .out_name == other .out_name
649
655
and self .extensions == other .extensions
650
656
)
@@ -654,6 +660,7 @@ def to_kwargs(self) -> Dict[str, Any]:
654
660
type_ = self .type ,
655
661
default_value = self .default_value ,
656
662
description = self .description ,
663
+ deprecation_reason = self .deprecation_reason ,
657
664
out_name = self .out_name ,
658
665
extensions = self .extensions ,
659
666
ast_node = self .ast_node ,
@@ -1399,6 +1406,7 @@ class GraphQLInputField:
1399
1406
type : "GraphQLInputType"
1400
1407
default_value : Any
1401
1408
description : Optional [str ]
1409
+ deprecation_reason : Optional [str ]
1402
1410
out_name : Optional [str ] # for transforming names (extension of GraphQL.js)
1403
1411
extensions : Optional [Dict [str , Any ]]
1404
1412
ast_node : Optional [InputValueDefinitionNode ]
@@ -1408,6 +1416,7 @@ def __init__(
1408
1416
type_ : "GraphQLInputType" ,
1409
1417
default_value : Any = Undefined ,
1410
1418
description : Optional [str ] = None ,
1419
+ deprecation_reason : Optional [str ] = None ,
1411
1420
out_name : Optional [str ] = None ,
1412
1421
extensions : Optional [Dict [str , Any ]] = None ,
1413
1422
ast_node : Optional [InputValueDefinitionNode ] = None ,
@@ -1416,6 +1425,8 @@ def __init__(
1416
1425
raise TypeError ("Input field type must be a GraphQL input type." )
1417
1426
if description is not None and not is_description (description ):
1418
1427
raise TypeError ("Input field description must be a string." )
1428
+ if deprecation_reason is not None and not is_description (deprecation_reason ):
1429
+ raise TypeError ("Input field deprecation reason must be a string." )
1419
1430
if out_name is not None and not isinstance (out_name , str ):
1420
1431
raise TypeError ("Input field out name must be a string." )
1421
1432
if extensions is not None and (
@@ -1430,6 +1441,7 @@ def __init__(
1430
1441
self .type = type_
1431
1442
self .default_value = default_value
1432
1443
self .description = description
1444
+ self .deprecation_reason = deprecation_reason
1433
1445
self .out_name = out_name
1434
1446
self .extensions = extensions
1435
1447
self .ast_node = ast_node
@@ -1440,6 +1452,7 @@ def __eq__(self, other: Any) -> bool:
1440
1452
and self .type == other .type
1441
1453
and self .default_value == other .default_value
1442
1454
and self .description == other .description
1455
+ and self .deprecation_reason == other .deprecation_reason
1443
1456
and self .extensions == other .extensions
1444
1457
and self .out_name == other .out_name
1445
1458
)
@@ -1449,6 +1462,7 @@ def to_kwargs(self) -> Dict[str, Any]:
1449
1462
type_ = self .type ,
1450
1463
default_value = self .default_value ,
1451
1464
description = self .description ,
1465
+ deprecation_reason = self .deprecation_reason ,
1452
1466
out_name = self .out_name ,
1453
1467
extensions = self .extensions ,
1454
1468
ast_node = self .ast_node ,
0 commit comments