Skip to content

Commit 64a2c55

Browse files
committed
Preserve deprecation_reason on GraphQLInputField
Backport from main branch Replicates graphql/graphql-js@1293dfa
1 parent d549878 commit 64a2c55

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/type/test_definition.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,20 @@ def rejects_an_input_object_type_with_resolver_constant():
15861586
{"f": GraphQLInputField(ScalarType, resolve={})}, # type: ignore
15871587
)
15881588

1589+
def deprecation_reason_is_preserved_on_fields():
1590+
input_obj_type = GraphQLInputObjectType(
1591+
"SomeInputObject",
1592+
{
1593+
"deprecatedField": GraphQLInputField(
1594+
ScalarType, deprecation_reason="not used anymore"
1595+
)
1596+
},
1597+
)
1598+
assert (
1599+
input_obj_type.fields["deprecatedField"].deprecation_reason
1600+
== "not used anymore"
1601+
)
1602+
15891603

15901604
def describe_type_system_arguments():
15911605
def accepts_an_argument_with_a_description():

0 commit comments

Comments
 (0)