We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add support for field deprecation
I was looking in the code and I couldn't find a way to mark field as deprecated. I also didn't find any issues regarding this.
I know that it is handled by `deprecation_reason` in graphql's `GraphQLField` but how I mark a field as deprecated in strawberry-graphql?

<!-- POLAR PLEDGE BADGE START -->
## Upvote & Fund

- We're using [Polar.sh](https://polar.sh/strawberry-graphql) so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.

<a href="https://polar.sh/strawberry-graphql/strawberry/issues/375">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/375/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/375/pledge.svg">
</picture>
</a>
<!-- POLAR PLEDGE BADGE END -->


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `strawberry/field.py`
Content:
```
1 import dataclasses
2 import inspect
3 from typing import Callable, List, Optional, Type
4 
5 from .arguments import get_arguments_from_resolver
6 from .permission import BasePermission
7 from .types.types import FederationFieldParams, FieldDefinition
8 from .utils.str_converters import to_camel_case
9 
10 
11 class StrawberryField(dataclasses.Field):
12     _field_definition: FieldDefinition
13 
14     def __init__(self, field_definition: FieldDefinition):
15         self._field_definition = field_definition
16 
17         super().__init__(  # type: ignore
18             default=dataclasses.MISSING,
19             default_factory=dataclasses.MISSING,
20             init=field_definition.base_resolver is None,
21             repr=True,
22             hash=None,
23             compare=True,
24             metadata=None,
25         )
26 
27     def __call__(self, resolver: Callable) -> Callable:
28         """Migrate the field definition to the resolver"""
29 
30         field_definition = self._field_definition
31         # note that field_definition.name is finalized in type_resolver._get_fields
32 
33         field_definition.origin_name = resolver.__name__
34         field_definition.origin = resolver
35         field_definition.base_resolver = resolver
36         field_definition.arguments = get_arguments_from_resolver(resolver)
37         field_definition.type = resolver.__annotations__.get("return", None)
38 
39         if not inspect.ismethod(resolver):
40             # resolver is a normal function
41             resolver._field_definition = field_definition  # type: ignore
42         else:
43             # resolver is a bound method and immutable (most likely a
44             # classmethod or an instance method). We need to monkeypatch its
45             # underlying .__func__ function
46             # https://stackoverflow.com/a/7891681/8134178
47             resolver.__func__._field_definition = field_definition  # type:ignore
48 
49         return resolver
50 
51     def __setattr__(self, name, value):
52         if name == "type":
53             self._field_definition.type = value
54 
55         if value and name == "name":
56             if not self._field_definition.origin_name:
57                 self._field_definition.origin_name = value
58 
59             if not self._field_definition.name:
60                 self._field_definition.name = to_camel_case(value)
61 
62         return super().__setattr__(name, value)
63 
64 
65 def field(
66     resolver: Optional[Callable] = None,
67     *,
68     name: Optional[str] = None,
69     is_subscription: bool = False,
70     description: Optional[str] = None,
71     permission_classes: Optional[List[Type[BasePermission]]] = None,
72     federation: Optional[FederationFieldParams] = None
73 ):
74     """Annotates a method or property as a GraphQL field.
75 
76     This is normally used inside a type declaration:
77 
78     >>> @strawberry.type:
79     >>> class X:
80     >>>     field_abc: str = strawberry.field(description="ABC")
81 
82     >>>     @strawberry.field(description="ABC")
83     >>>     def field_with_resolver(self, info) -> str:
84     >>>         return "abc"
85 
86     it can be used both as decorator and as a normal function.
87     """
88 
89     field_definition = FieldDefinition(
90         origin_name=None,  # modified by resolver in __call__
91         name=name,  # modified by resolver in __call__
92         type=None,  # type: ignore
93         origin=resolver,  # type: ignore
94         description=description,
95         base_resolver=resolver,
96         is_subscription=is_subscription,
97         permission_classes=permission_classes or [],
98         arguments=[],  # modified by resolver in __call__
99         federation=federation or FederationFieldParams(),
100     )
101 
102     field_ = StrawberryField(field_definition)
103 
104     if resolver:
105         return field_(resolver)
106     return field_
107
```

Path: `strawberry/types/types.py`
Content:
```
1 import dataclasses
2 from typing import Any, Callable, Dict, List, Optional, Type, Union
3 
4 from strawberry.permission import BasePermission
5 from strawberry.union import StrawberryUnion
6 
7 
8 undefined = object()
9 
10 
11 @dataclasses.dataclass
12 class FederationTypeParams:
13     keys: List[str] = dataclasses.field(default_factory=list)
14     extend: bool = False
15 
16 
17 @dataclasses.dataclass
18 class TypeDefinition:
19     name: str
20     is_input: bool
21     is_interface: bool
22     is_generic: bool
23     origin: Type
24     description: Optional[str]
25     federation: FederationTypeParams
26     interfaces: List["TypeDefinition"]
27 
28     _fields: List["FieldDefinition"]
29     _type_params: Dict[str, Type] = dataclasses.field(default_factory=dict, init=False)
30 
31     def get_field(self, name: str) -> Optional["FieldDefinition"]:
32         return next((field for field in self.fields if field.name == name), None)
33 
34     @property
35     def fields(self) -> List["FieldDefinition"]:
36         from .type_resolver import _resolve_types
37 
38         return _resolve_types(self._fields)
39 
40     @property
41     def type_params(self) -> Dict[str, Type]:
42         if not self._type_params:
43             from .type_resolver import _get_type_params
44 
45             self._type_params = _get_type_params(self.fields)
46 
47         return self._type_params
48 
49 
50 @dataclasses.dataclass
51 class ArgumentDefinition:
52     name: Optional[str] = None
53     origin_name: Optional[str] = None
54     type: Optional[Type] = None
55     origin: Optional[Type] = None
56     child: Optional["ArgumentDefinition"] = None
57     is_subscription: bool = False
58     is_optional: bool = False
59     is_child_optional: bool = False
60     is_list: bool = False
61     is_union: bool = False
62     description: Optional[str] = None
63     default_value: Any = undefined
64 
65 
66 @dataclasses.dataclass
67 class FederationFieldParams:
68     provides: List[str] = dataclasses.field(default_factory=list)
69     requires: List[str] = dataclasses.field(default_factory=list)
70     external: bool = False
71 
72 
73 @dataclasses.dataclass
74 class FieldDefinition:
75     name: Optional[str]
76     origin_name: Optional[str]
77     type: Optional[Union[Type, StrawberryUnion]]
78     origin: Union[Type, Callable]
79     child: Optional["FieldDefinition"] = None
80     is_subscription: bool = False
81     is_optional: bool = False
82     is_child_optional: bool = False
83     is_list: bool = False
84     is_union: bool = False
85     federation: FederationFieldParams = dataclasses.field(
86         default_factory=FederationFieldParams
87     )
88     arguments: List[ArgumentDefinition] = dataclasses.field(default_factory=list)
89     description: Optional[str] = None
90     base_resolver: Optional[Callable] = None
91     permission_classes: List[Type[BasePermission]] = dataclasses.field(
92         default_factory=list
93     )
94     default_value: Any = undefined
95
```

Path: `strawberry/schema/types/fields.py`
Content:
```
1 import typing
2 
3 from graphql import GraphQLField, GraphQLInputField
4 
5 from strawberry.arguments import UNSET
6 from strawberry.field import FieldDefinition
7 from strawberry.resolvers import get_resolver
8 from strawberry.types.types import undefined
9 
10 from .arguments import convert_arguments
11 from .type import get_graphql_type
12 from .types import Field, TypeMap
13 
14 
15 def get_field(
16     field: FieldDefinition,
17     is_input: bool,
18     type_map: TypeMap,
19 ) -> Field:
20     graphql_type = get_graphql_type(field, type_map)
21 
22     TypeClass: typing.Union[
23         typing.Type[GraphQLInputField], typing.Type[GraphQLField]
24     ] = GraphQLField
25 
26     kwargs: typing.Dict[str, typing.Any] = {
27         "description": field.description,
28     }
29 
30     resolver = get_resolver(field)
31 
32     if is_input:
33         TypeClass = GraphQLInputField
34         if field.default_value not in (undefined, UNSET):
35             kwargs["default_value"] = field.default_value
36     elif field.is_subscription:
37         kwargs["args"] = convert_arguments(field.arguments, type_map)
38         kwargs["subscribe"] = resolver
39         kwargs["resolve"] = lambda event, *args, **kwargs: event
40     else:
41         kwargs["args"] = convert_arguments(field.arguments, type_map)
42         kwargs["resolve"] = resolver
43 
44     return TypeClass(graphql_type, **kwargs)  # type: ignore
45
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/strawberry/field.py b/strawberry/field.py
--- a/strawberry/field.py
+++ b/strawberry/field.py
@@ -69,7 +69,8 @@
     is_subscription: bool = False,
     description: Optional[str] = None,
     permission_classes: Optional[List[Type[BasePermission]]] = None,
-    federation: Optional[FederationFieldParams] = None
+    federation: Optional[FederationFieldParams] = None,
+    deprecation_reason: Optional[str] = None,
 ):
     """Annotates a method or property as a GraphQL field.
 
@@ -97,6 +98,7 @@
         permission_classes=permission_classes or [],
         arguments=[],  # modified by resolver in __call__
         federation=federation or FederationFieldParams(),
+        deprecation_reason=deprecation_reason,
     )
 
     field_ = StrawberryField(field_definition)
diff --git a/strawberry/schema/types/fields.py b/strawberry/schema/types/fields.py
--- a/strawberry/schema/types/fields.py
+++ b/strawberry/schema/types/fields.py
@@ -41,4 +41,7 @@
         kwargs["args"] = convert_arguments(field.arguments, type_map)
         kwargs["resolve"] = resolver
 
+    if not is_input:
+        kwargs["deprecation_reason"] = field.deprecation_reason
+
     return TypeClass(graphql_type, **kwargs)  # type: ignore
diff --git a/strawberry/types/types.py b/strawberry/types/types.py
--- a/strawberry/types/types.py
+++ b/strawberry/types/types.py
@@ -92,3 +92,4 @@
         default_factory=list
     )
     default_value: Any = undefined
+    deprecation_reason: Optional[str] = None

{"golden_diff": "diff --git a/strawberry/field.py b/strawberry/field.py\n--- a/strawberry/field.py\n+++ b/strawberry/field.py\n@@ -69,7 +69,8 @@\n     is_subscription: bool = False,\n     description: Optional[str] = None,\n     permission_classes: Optional[List[Type[BasePermission]]] = None,\n-    federation: Optional[FederationFieldParams] = None\n+    federation: Optional[FederationFieldParams] = None,\n+    deprecation_reason: Optional[str] = None,\n ):\n     \"\"\"Annotates a method or property as a GraphQL field.\n \n@@ -97,6 +98,7 @@\n         permission_classes=permission_classes or [],\n         arguments=[],  # modified by resolver in __call__\n         federation=federation or FederationFieldParams(),\n+        deprecation_reason=deprecation_reason,\n     )\n \n     field_ = StrawberryField(field_definition)\ndiff --git a/strawberry/schema/types/fields.py b/strawberry/schema/types/fields.py\n--- a/strawberry/schema/types/fields.py\n+++ b/strawberry/schema/types/fields.py\n@@ -41,4 +41,7 @@\n         kwargs[\"args\"] = convert_arguments(field.arguments, type_map)\n         kwargs[\"resolve\"] = resolver\n \n+    if not is_input:\n+        kwargs[\"deprecation_reason\"] = field.deprecation_reason\n+\n     return TypeClass(graphql_type, **kwargs)  # type: ignore\ndiff --git a/strawberry/types/types.py b/strawberry/types/types.py\n--- a/strawberry/types/types.py\n+++ b/strawberry/types/types.py\n@@ -92,3 +92,4 @@\n         default_factory=list\n     )\n     default_value: Any = undefined\n+    deprecation_reason: Optional[str] = None\n", "issue": "Add support for field deprecation\nI was looking in the code and I couldn't find a way to mark field as deprecated. I also didn't find any issues regarding this.\r\nI know that it is handled by `deprecation_reason` in graphql's `GraphQLField` but how I mark a field as deprecated in strawberry-graphql?\n\n<!-- POLAR PLEDGE BADGE START -->\n## Upvote & Fund\n\n- We're using [Polar.sh](https://polar.sh/strawberry-graphql) so you can upvote and help fund this issue.\n- We receive the funding once the issue is completed & confirmed by you.\n- Thank you in advance for helping prioritize & fund our backlog.\n\n<a href=\"https://polar.sh/strawberry-graphql/strawberry/issues/375\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://polar.sh/api/github/strawberry-graphql/strawberry/issues/375/pledge.svg?darkmode=1\">\n  <img alt=\"Fund with Polar\" src=\"https://polar.sh/api/github/strawberry-graphql/strawberry/issues/375/pledge.svg\">\n</picture>\n</a>\n<!-- POLAR PLEDGE BADGE END -->\n\n", "before_files": [{"content": "import dataclasses\nimport inspect\nfrom typing import Callable, List, Optional, Type\n\nfrom .arguments import get_arguments_from_resolver\nfrom .permission import BasePermission\nfrom .types.types import FederationFieldParams, FieldDefinition\nfrom .utils.str_converters import to_camel_case\n\n\nclass StrawberryField(dataclasses.Field):\n    _field_definition: FieldDefinition\n\n    def __init__(self, field_definition: FieldDefinition):\n        self._field_definition = field_definition\n\n        super().__init__(  # type: ignore\n            default=dataclasses.MISSING,\n            default_factory=dataclasses.MISSING,\n            init=field_definition.base_resolver is None,\n            repr=True,\n            hash=None,\n            compare=True,\n            metadata=None,\n        )\n\n    def __call__(self, resolver: Callable) -> Callable:\n        \"\"\"Migrate the field definition to the resolver\"\"\"\n\n        field_definition = self._field_definition\n        # note that field_definition.name is finalized in type_resolver._get_fields\n\n        field_definition.origin_name = resolver.__name__\n        field_definition.origin = resolver\n        field_definition.base_resolver = resolver\n        field_definition.arguments = get_arguments_from_resolver(resolver)\n        field_definition.type = resolver.__annotations__.get(\"return\", None)\n\n        if not inspect.ismethod(resolver):\n            # resolver is a normal function\n            resolver._field_definition = field_definition  # type: ignore\n        else:\n            # resolver is a bound method and immutable (most likely a\n            # classmethod or an instance method). We need to monkeypatch its\n            # underlying .__func__ function\n            # https://stackoverflow.com/a/7891681/8134178\n            resolver.__func__._field_definition = field_definition  # type:ignore\n\n        return resolver\n\n    def __setattr__(self, name, value):\n        if name == \"type\":\n            self._field_definition.type = value\n\n        if value and name == \"name\":\n            if not self._field_definition.origin_name:\n                self._field_definition.origin_name = value\n\n            if not self._field_definition.name:\n                self._field_definition.name = to_camel_case(value)\n\n        return super().__setattr__(name, value)\n\n\ndef field(\n    resolver: Optional[Callable] = None,\n    *,\n    name: Optional[str] = None,\n    is_subscription: bool = False,\n    description: Optional[str] = None,\n    permission_classes: Optional[List[Type[BasePermission]]] = None,\n    federation: Optional[FederationFieldParams] = None\n):\n    \"\"\"Annotates a method or property as a GraphQL field.\n\n    This is normally used inside a type declaration:\n\n    >>> @strawberry.type:\n    >>> class X:\n    >>>     field_abc: str = strawberry.field(description=\"ABC\")\n\n    >>>     @strawberry.field(description=\"ABC\")\n    >>>     def field_with_resolver(self, info) -> str:\n    >>>         return \"abc\"\n\n    it can be used both as decorator and as a normal function.\n    \"\"\"\n\n    field_definition = FieldDefinition(\n        origin_name=None,  # modified by resolver in __call__\n        name=name,  # modified by resolver in __call__\n        type=None,  # type: ignore\n        origin=resolver,  # type: ignore\n        description=description,\n        base_resolver=resolver,\n        is_subscription=is_subscription,\n        permission_classes=permission_classes or [],\n        arguments=[],  # modified by resolver in __call__\n        federation=federation or FederationFieldParams(),\n    )\n\n    field_ = StrawberryField(field_definition)\n\n    if resolver:\n        return field_(resolver)\n    return field_\n", "path": "strawberry/field.py"}, {"content": "import dataclasses\nfrom typing import Any, Callable, Dict, List, Optional, Type, Union\n\nfrom strawberry.permission import BasePermission\nfrom strawberry.union import StrawberryUnion\n\n\nundefined = object()\n\n\n@dataclasses.dataclass\nclass FederationTypeParams:\n    keys: List[str] = dataclasses.field(default_factory=list)\n    extend: bool = False\n\n\n@dataclasses.dataclass\nclass TypeDefinition:\n    name: str\n    is_input: bool\n    is_interface: bool\n    is_generic: bool\n    origin: Type\n    description: Optional[str]\n    federation: FederationTypeParams\n    interfaces: List[\"TypeDefinition\"]\n\n    _fields: List[\"FieldDefinition\"]\n    _type_params: Dict[str, Type] = dataclasses.field(default_factory=dict, init=False)\n\n    def get_field(self, name: str) -> Optional[\"FieldDefinition\"]:\n        return next((field for field in self.fields if field.name == name), None)\n\n    @property\n    def fields(self) -> List[\"FieldDefinition\"]:\n        from .type_resolver import _resolve_types\n\n        return _resolve_types(self._fields)\n\n    @property\n    def type_params(self) -> Dict[str, Type]:\n        if not self._type_params:\n            from .type_resolver import _get_type_params\n\n            self._type_params = _get_type_params(self.fields)\n\n        return self._type_params\n\n\n@dataclasses.dataclass\nclass ArgumentDefinition:\n    name: Optional[str] = None\n    origin_name: Optional[str] = None\n    type: Optional[Type] = None\n    origin: Optional[Type] = None\n    child: Optional[\"ArgumentDefinition\"] = None\n    is_subscription: bool = False\n    is_optional: bool = False\n    is_child_optional: bool = False\n    is_list: bool = False\n    is_union: bool = False\n    description: Optional[str] = None\n    default_value: Any = undefined\n\n\n@dataclasses.dataclass\nclass FederationFieldParams:\n    provides: List[str] = dataclasses.field(default_factory=list)\n    requires: List[str] = dataclasses.field(default_factory=list)\n    external: bool = False\n\n\n@dataclasses.dataclass\nclass FieldDefinition:\n    name: Optional[str]\n    origin_name: Optional[str]\n    type: Optional[Union[Type, StrawberryUnion]]\n    origin: Union[Type, Callable]\n    child: Optional[\"FieldDefinition\"] = None\n    is_subscription: bool = False\n    is_optional: bool = False\n    is_child_optional: bool = False\n    is_list: bool = False\n    is_union: bool = False\n    federation: FederationFieldParams = dataclasses.field(\n        default_factory=FederationFieldParams\n    )\n    arguments: List[ArgumentDefinition] = dataclasses.field(default_factory=list)\n    description: Optional[str] = None\n    base_resolver: Optional[Callable] = None\n    permission_classes: List[Type[BasePermission]] = dataclasses.field(\n        default_factory=list\n    )\n    default_value: Any = undefined\n", "path": "strawberry/types/types.py"}, {"content": "import typing\n\nfrom graphql import GraphQLField, GraphQLInputField\n\nfrom strawberry.arguments import UNSET\nfrom strawberry.field import FieldDefinition\nfrom strawberry.resolvers import get_resolver\nfrom strawberry.types.types import undefined\n\nfrom .arguments import convert_arguments\nfrom .type import get_graphql_type\nfrom .types import Field, TypeMap\n\n\ndef get_field(\n    field: FieldDefinition,\n    is_input: bool,\n    type_map: TypeMap,\n) -> Field:\n    graphql_type = get_graphql_type(field, type_map)\n\n    TypeClass: typing.Union[\n        typing.Type[GraphQLInputField], typing.Type[GraphQLField]\n    ] = GraphQLField\n\n    kwargs: typing.Dict[str, typing.Any] = {\n        \"description\": field.description,\n    }\n\n    resolver = get_resolver(field)\n\n    if is_input:\n        TypeClass = GraphQLInputField\n        if field.default_value not in (undefined, UNSET):\n            kwargs[\"default_value\"] = field.default_value\n    elif field.is_subscription:\n        kwargs[\"args\"] = convert_arguments(field.arguments, type_map)\n        kwargs[\"subscribe\"] = resolver\n        kwargs[\"resolve\"] = lambda event, *args, **kwargs: event\n    else:\n        kwargs[\"args\"] = convert_arguments(field.arguments, type_map)\n        kwargs[\"resolve\"] = resolver\n\n    return TypeClass(graphql_type, **kwargs)  # type: ignore\n", "path": "strawberry/schema/types/fields.py"}], "after_files": [{"content": "import dataclasses\nimport inspect\nfrom typing import Callable, List, Optional, Type\n\nfrom .arguments import get_arguments_from_resolver\nfrom .permission import BasePermission\nfrom .types.types import FederationFieldParams, FieldDefinition\nfrom .utils.str_converters import to_camel_case\n\n\nclass StrawberryField(dataclasses.Field):\n    _field_definition: FieldDefinition\n\n    def __init__(self, field_definition: FieldDefinition):\n        self._field_definition = field_definition\n\n        super().__init__(  # type: ignore\n            default=dataclasses.MISSING,\n            default_factory=dataclasses.MISSING,\n            init=field_definition.base_resolver is None,\n            repr=True,\n            hash=None,\n            compare=True,\n            metadata=None,\n        )\n\n    def __call__(self, resolver: Callable) -> Callable:\n        \"\"\"Migrate the field definition to the resolver\"\"\"\n\n        field_definition = self._field_definition\n        # note that field_definition.name is finalized in type_resolver._get_fields\n\n        field_definition.origin_name = resolver.__name__\n        field_definition.origin = resolver\n        field_definition.base_resolver = resolver\n        field_definition.arguments = get_arguments_from_resolver(resolver)\n        field_definition.type = resolver.__annotations__.get(\"return\", None)\n\n        if not inspect.ismethod(resolver):\n            # resolver is a normal function\n            resolver._field_definition = field_definition  # type: ignore\n        else:\n            # resolver is a bound method and immutable (most likely a\n            # classmethod or an instance method). We need to monkeypatch its\n            # underlying .__func__ function\n            # https://stackoverflow.com/a/7891681/8134178\n            resolver.__func__._field_definition = field_definition  # type:ignore\n\n        return resolver\n\n    def __setattr__(self, name, value):\n        if name == \"type\":\n            self._field_definition.type = value\n\n        if value and name == \"name\":\n            if not self._field_definition.origin_name:\n                self._field_definition.origin_name = value\n\n            if not self._field_definition.name:\n                self._field_definition.name = to_camel_case(value)\n\n        return super().__setattr__(name, value)\n\n\ndef field(\n    resolver: Optional[Callable] = None,\n    *,\n    name: Optional[str] = None,\n    is_subscription: bool = False,\n    description: Optional[str] = None,\n    permission_classes: Optional[List[Type[BasePermission]]] = None,\n    federation: Optional[FederationFieldParams] = None,\n    deprecation_reason: Optional[str] = None,\n):\n    \"\"\"Annotates a method or property as a GraphQL field.\n\n    This is normally used inside a type declaration:\n\n    >>> @strawberry.type:\n    >>> class X:\n    >>>     field_abc: str = strawberry.field(description=\"ABC\")\n\n    >>>     @strawberry.field(description=\"ABC\")\n    >>>     def field_with_resolver(self, info) -> str:\n    >>>         return \"abc\"\n\n    it can be used both as decorator and as a normal function.\n    \"\"\"\n\n    field_definition = FieldDefinition(\n        origin_name=None,  # modified by resolver in __call__\n        name=name,  # modified by resolver in __call__\n        type=None,  # type: ignore\n        origin=resolver,  # type: ignore\n        description=description,\n        base_resolver=resolver,\n        is_subscription=is_subscription,\n        permission_classes=permission_classes or [],\n        arguments=[],  # modified by resolver in __call__\n        federation=federation or FederationFieldParams(),\n        deprecation_reason=deprecation_reason,\n    )\n\n    field_ = StrawberryField(field_definition)\n\n    if resolver:\n        return field_(resolver)\n    return field_\n", "path": "strawberry/field.py"}, {"content": "import dataclasses\nfrom typing import Any, Callable, Dict, List, Optional, Type, Union\n\nfrom strawberry.permission import BasePermission\nfrom strawberry.union import StrawberryUnion\n\n\nundefined = object()\n\n\n@dataclasses.dataclass\nclass FederationTypeParams:\n    keys: List[str] = dataclasses.field(default_factory=list)\n    extend: bool = False\n\n\n@dataclasses.dataclass\nclass TypeDefinition:\n    name: str\n    is_input: bool\n    is_interface: bool\n    is_generic: bool\n    origin: Type\n    description: Optional[str]\n    federation: FederationTypeParams\n    interfaces: List[\"TypeDefinition\"]\n\n    _fields: List[\"FieldDefinition\"]\n    _type_params: Dict[str, Type] = dataclasses.field(default_factory=dict, init=False)\n\n    def get_field(self, name: str) -> Optional[\"FieldDefinition\"]:\n        return next((field for field in self.fields if field.name == name), None)\n\n    @property\n    def fields(self) -> List[\"FieldDefinition\"]:\n        from .type_resolver import _resolve_types\n\n        return _resolve_types(self._fields)\n\n    @property\n    def type_params(self) -> Dict[str, Type]:\n        if not self._type_params:\n            from .type_resolver import _get_type_params\n\n            self._type_params = _get_type_params(self.fields)\n\n        return self._type_params\n\n\n@dataclasses.dataclass\nclass ArgumentDefinition:\n    name: Optional[str] = None\n    origin_name: Optional[str] = None\n    type: Optional[Type] = None\n    origin: Optional[Type] = None\n    child: Optional[\"ArgumentDefinition\"] = None\n    is_subscription: bool = False\n    is_optional: bool = False\n    is_child_optional: bool = False\n    is_list: bool = False\n    is_union: bool = False\n    description: Optional[str] = None\n    default_value: Any = undefined\n\n\n@dataclasses.dataclass\nclass FederationFieldParams:\n    provides: List[str] = dataclasses.field(default_factory=list)\n    requires: List[str] = dataclasses.field(default_factory=list)\n    external: bool = False\n\n\n@dataclasses.dataclass\nclass FieldDefinition:\n    name: Optional[str]\n    origin_name: Optional[str]\n    type: Optional[Union[Type, StrawberryUnion]]\n    origin: Union[Type, Callable]\n    child: Optional[\"FieldDefinition\"] = None\n    is_subscription: bool = False\n    is_optional: bool = False\n    is_child_optional: bool = False\n    is_list: bool = False\n    is_union: bool = False\n    federation: FederationFieldParams = dataclasses.field(\n        default_factory=FederationFieldParams\n    )\n    arguments: List[ArgumentDefinition] = dataclasses.field(default_factory=list)\n    description: Optional[str] = None\n    base_resolver: Optional[Callable] = None\n    permission_classes: List[Type[BasePermission]] = dataclasses.field(\n        default_factory=list\n    )\n    default_value: Any = undefined\n    deprecation_reason: Optional[str] = None\n", "path": "strawberry/types/types.py"}, {"content": "import typing\n\nfrom graphql import GraphQLField, GraphQLInputField\n\nfrom strawberry.arguments import UNSET\nfrom strawberry.field import FieldDefinition\nfrom strawberry.resolvers import get_resolver\nfrom strawberry.types.types import undefined\n\nfrom .arguments import convert_arguments\nfrom .type import get_graphql_type\nfrom .types import Field, TypeMap\n\n\ndef get_field(\n    field: FieldDefinition,\n    is_input: bool,\n    type_map: TypeMap,\n) -> Field:\n    graphql_type = get_graphql_type(field, type_map)\n\n    TypeClass: typing.Union[\n        typing.Type[GraphQLInputField], typing.Type[GraphQLField]\n    ] = GraphQLField\n\n    kwargs: typing.Dict[str, typing.Any] = {\n        \"description\": field.description,\n    }\n\n    resolver = get_resolver(field)\n\n    if is_input:\n        TypeClass = GraphQLInputField\n        if field.default_value not in (undefined, UNSET):\n            kwargs[\"default_value\"] = field.default_value\n    elif field.is_subscription:\n        kwargs[\"args\"] = convert_arguments(field.arguments, type_map)\n        kwargs[\"subscribe\"] = resolver\n        kwargs[\"resolve\"] = lambda event, *args, **kwargs: event\n    else:\n        kwargs[\"args\"] = convert_arguments(field.arguments, type_map)\n        kwargs[\"resolve\"] = resolver\n\n    if not is_input:\n        kwargs[\"deprecation_reason\"] = field.deprecation_reason\n\n    return TypeClass(graphql_type, **kwargs)  # type: ignore\n", "path": "strawberry/schema/types/fields.py"}]}