File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1730,6 +1730,23 @@ def rejects_an_input_field_with_an_incorrect_ast_node():
1730
1730
msg = str (exc_info .value )
1731
1731
assert msg == "Input field AST node must be an InputValueDefinitionNode."
1732
1732
1733
+ def deprecation_reason_is_preserved_on_fields ():
1734
+ input_obj_type = GraphQLInputObjectType (
1735
+ "someInputObject" ,
1736
+ {
1737
+ "deprecatedField" : GraphQLInputField (
1738
+ ScalarType , deprecation_reason = "not used anymore"
1739
+ )
1740
+ },
1741
+ )
1742
+ deprecated_field = input_obj_type .fields ["deprecatedField" ]
1743
+ assert (
1744
+ input_obj_type .to_kwargs ()["fields" ]["deprecatedField" ] is deprecated_field
1745
+ )
1746
+ deprecation_reason = deprecated_field .deprecation_reason
1747
+ assert deprecation_reason == "not used anymore"
1748
+ assert deprecated_field .to_kwargs ()["deprecation_reason" ] is deprecation_reason
1749
+
1733
1750
1734
1751
def describe_type_system_list ():
1735
1752
types = [
You can’t perform that action at this time.
0 commit comments