@@ -604,6 +604,7 @@ class GraphQLArgument:
604604 type : "GraphQLInputType"
605605 default_value : Any
606606 description : Optional [str ]
607+ deprecation_reason : Optional [str ]
607608 out_name : Optional [str ] # for transforming names (extension of GraphQL.js)
608609 extensions : Optional [Dict [str , Any ]]
609610 ast_node : Optional [InputValueDefinitionNode ]
@@ -613,6 +614,7 @@ def __init__(
613614 type_ : "GraphQLInputType" ,
614615 default_value : Any = Undefined ,
615616 description : Optional [str ] = None ,
617+ deprecation_reason : Optional [str ] = None ,
616618 out_name : Optional [str ] = None ,
617619 extensions : Optional [Dict [str , Any ]] = None ,
618620 ast_node : Optional [InputValueDefinitionNode ] = None ,
@@ -621,6 +623,8 @@ def __init__(
621623 raise TypeError ("Argument type must be a GraphQL input type." )
622624 if description is not None and not is_description (description ):
623625 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." )
624628 if out_name is not None and not isinstance (out_name , str ):
625629 raise TypeError ("Argument out name must be a string." )
626630 if extensions is not None and (
@@ -635,6 +639,7 @@ def __init__(
635639 self .type = type_
636640 self .default_value = default_value
637641 self .description = description
642+ self .deprecation_reason = deprecation_reason
638643 self .out_name = out_name
639644 self .extensions = extensions
640645 self .ast_node = ast_node
@@ -645,6 +650,7 @@ def __eq__(self, other: Any) -> bool:
645650 and self .type == other .type
646651 and self .default_value == other .default_value
647652 and self .description == other .description
653+ and self .deprecation_reason == other .deprecation_reason
648654 and self .out_name == other .out_name
649655 and self .extensions == other .extensions
650656 )
@@ -654,6 +660,7 @@ def to_kwargs(self) -> Dict[str, Any]:
654660 type_ = self .type ,
655661 default_value = self .default_value ,
656662 description = self .description ,
663+ deprecation_reason = self .deprecation_reason ,
657664 out_name = self .out_name ,
658665 extensions = self .extensions ,
659666 ast_node = self .ast_node ,
@@ -1399,6 +1406,7 @@ class GraphQLInputField:
13991406 type : "GraphQLInputType"
14001407 default_value : Any
14011408 description : Optional [str ]
1409+ deprecation_reason : Optional [str ]
14021410 out_name : Optional [str ] # for transforming names (extension of GraphQL.js)
14031411 extensions : Optional [Dict [str , Any ]]
14041412 ast_node : Optional [InputValueDefinitionNode ]
@@ -1408,6 +1416,7 @@ def __init__(
14081416 type_ : "GraphQLInputType" ,
14091417 default_value : Any = Undefined ,
14101418 description : Optional [str ] = None ,
1419+ deprecation_reason : Optional [str ] = None ,
14111420 out_name : Optional [str ] = None ,
14121421 extensions : Optional [Dict [str , Any ]] = None ,
14131422 ast_node : Optional [InputValueDefinitionNode ] = None ,
@@ -1416,6 +1425,8 @@ def __init__(
14161425 raise TypeError ("Input field type must be a GraphQL input type." )
14171426 if description is not None and not is_description (description ):
14181427 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." )
14191430 if out_name is not None and not isinstance (out_name , str ):
14201431 raise TypeError ("Input field out name must be a string." )
14211432 if extensions is not None and (
@@ -1430,6 +1441,7 @@ def __init__(
14301441 self .type = type_
14311442 self .default_value = default_value
14321443 self .description = description
1444+ self .deprecation_reason = deprecation_reason
14331445 self .out_name = out_name
14341446 self .extensions = extensions
14351447 self .ast_node = ast_node
@@ -1440,6 +1452,7 @@ def __eq__(self, other: Any) -> bool:
14401452 and self .type == other .type
14411453 and self .default_value == other .default_value
14421454 and self .description == other .description
1455+ and self .deprecation_reason == other .deprecation_reason
14431456 and self .extensions == other .extensions
14441457 and self .out_name == other .out_name
14451458 )
@@ -1449,6 +1462,7 @@ def to_kwargs(self) -> Dict[str, Any]:
14491462 type_ = self .type ,
14501463 default_value = self .default_value ,
14511464 description = self .description ,
1465+ deprecation_reason = self .deprecation_reason ,
14521466 out_name = self .out_name ,
14531467 extensions = self .extensions ,
14541468 ast_node = self .ast_node ,
0 commit comments