Skip to content

Commit 39c849a

Browse files
authored
Fix deprecation_reason not being copied in InputMutationExtension (#4353)
1 parent 7405ac7 commit 39c849a

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Release type: patch
2+
3+
Fix `deprecation_reason` not being copied from arguments to auto-generated input type fields in `InputMutationExtension`.

strawberry/field_extensions/input_mutation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def apply(self, field: StrawberryField) -> None:
3131
python_name=arg.python_name,
3232
graphql_name=arg.graphql_name,
3333
description=arg.description,
34+
deprecation_reason=arg.deprecation_reason,
3435
default=arg.default,
3536
type_annotation=arg.type_annotation,
3637
directives=tuple(arg.directives),

tests/schema/extensions/test_input_mutation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ def create_fruit(
4141
directives=[SomeDirective(some="foo", directive="bar")],
4242
),
4343
],
44+
variety: Annotated[
45+
str | None,
46+
strawberry.argument(
47+
deprecation_reason="Use `color` instead",
48+
),
49+
] = None,
4450
) -> Fruit:
4551
return Fruit(
4652
name=name,
@@ -76,6 +82,7 @@ def test_schema():
7682
7783
"""The color of the fruit"""
7884
color: String! @some_directive(some: "foo", directive: "bar")
85+
variety: String = null @deprecated(reason: "Use `color` instead")
7986
}
8087
8188
type Fruit {

0 commit comments

Comments
 (0)