We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Error in handling enum values while using IntEnum in input type
## Describe the Bug

I have enum defined as below and when I initialize input, I get Type Error. The same works when I use Enum instead of IntEnum

```python
@strawberry.enum(description="Reproducing IntEnum issue")
class Color(IntEnum):
    OTHER = strawberry.enum_value(
        -1,
    RED = strawberry.enum_value(0, description="Red: The color red.")
    BLUE = strawberry.enum_value(1, description="Blue: The color blue.")
    GREEN = strawberry.enum_value(2, description="Green: The color green.")

@strawberry.input(description="Test Input for reproducing issue")
class ShirtInput:
    color: Optional[ScoreId] = None

arg = ShirtInput(color=random.choice(list(Color)))
```
Exception:
```python
enum_member = __new__(enum_class, *args)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'EnumValueDefinition'
```

I am using latest release which has the fix for enum value as metioned in [this PR](https://github.com/strawberry-graphql/strawberry/pull/2306)

## System Information

 - Operating system: MacOS
 - Strawberry version (if applicable): 0.146.0

## Additional Context

<!-- Add any other relevant information about the problem here. -->


<!-- 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/2385">
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/2385/pledge.svg?darkmode=1">
  <img alt="Fund with Polar" src="https://polar.sh/api/github/strawberry-graphql/strawberry/issues/2385/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/enum.py`
Content:
```
1 import dataclasses
2 from enum import EnumMeta
3 from typing import (
4     Any,
5     Callable,
6     Iterable,
7     List,
8     Mapping,
9     Optional,
10     TypeVar,
11     Union,
12     overload,
13 )
14 
15 from strawberry.type import StrawberryType
16 
17 from .exceptions import ObjectIsNotAnEnumError
18 
19 
20 @dataclasses.dataclass
21 class EnumValue:
22     name: str
23     value: Any
24     deprecation_reason: Optional[str] = None
25     directives: Iterable[object] = ()
26     description: Optional[str] = None
27 
28 
29 @dataclasses.dataclass
30 class EnumDefinition(StrawberryType):
31     wrapped_cls: EnumMeta
32     name: str
33     values: List[EnumValue]
34     description: Optional[str]
35     directives: Iterable[object] = ()
36 
37     def __hash__(self) -> int:
38         # TODO: Is this enough for unique-ness?
39         return hash(self.name)
40 
41     def copy_with(
42         self, type_var_map: Mapping[TypeVar, Union[StrawberryType, type]]
43     ) -> Union[StrawberryType, type]:
44         # enum don't support type parameters, so we can safely return self
45         return self
46 
47     @property
48     def is_generic(self) -> bool:
49         return False
50 
51 
52 # TODO: remove duplication of EnumValueDefinition and EnumValue
53 @dataclasses.dataclass
54 class EnumValueDefinition:
55     value: Any
56     deprecation_reason: Optional[str] = None
57     directives: Iterable[object] = ()
58     description: Optional[str] = None
59 
60 
61 def enum_value(
62     value: Any,
63     deprecation_reason: Optional[str] = None,
64     directives: Iterable[object] = (),
65     description: Optional[str] = None,
66 ) -> EnumValueDefinition:
67     return EnumValueDefinition(
68         value=value,
69         deprecation_reason=deprecation_reason,
70         directives=directives,
71         description=description,
72     )
73 
74 
75 EnumType = TypeVar("EnumType", bound=EnumMeta)
76 
77 
78 def _process_enum(
79     cls: EnumType,
80     name: Optional[str] = None,
81     description: Optional[str] = None,
82     directives: Iterable[object] = (),
83 ) -> EnumType:
84     if not isinstance(cls, EnumMeta):
85         raise ObjectIsNotAnEnumError(cls)
86 
87     if not name:
88         name = cls.__name__
89 
90     description = description
91 
92     values = []
93     for item in cls:  # type: ignore
94         item_value = item.value
95         item_name = item.name
96         deprecation_reason = None
97         item_directives: Iterable[object] = ()
98         enum_value_description = None
99 
100         if isinstance(item_value, EnumValueDefinition):
101             item_directives = item_value.directives
102             enum_value_description = item_value.description
103             deprecation_reason = item_value.deprecation_reason
104             item_value = item_value.value
105 
106             # update _value2member_map_ so that doing `MyEnum.MY_VALUE` and
107             # `MyEnum['MY_VALUE']` both work
108             cls._value2member_map_[item_value] = item
109             cls._member_map_[item_name]._value_ = item_value
110 
111         value = EnumValue(
112             item_name,
113             item_value,
114             deprecation_reason=deprecation_reason,
115             directives=item_directives,
116             description=enum_value_description,
117         )
118         values.append(value)
119 
120     cls._enum_definition = EnumDefinition(  # type: ignore
121         wrapped_cls=cls,
122         name=name,
123         values=values,
124         description=description,
125         directives=directives,
126     )
127 
128     return cls
129 
130 
131 @overload
132 def enum(
133     _cls: EnumType,
134     *,
135     name: Optional[str] = None,
136     description: Optional[str] = None,
137     directives: Iterable[object] = ()
138 ) -> EnumType:
139     ...
140 
141 
142 @overload
143 def enum(
144     _cls: None = None,
145     *,
146     name: Optional[str] = None,
147     description: Optional[str] = None,
148     directives: Iterable[object] = ()
149 ) -> Callable[[EnumType], EnumType]:
150     ...
151 
152 
153 def enum(
154     _cls: Optional[EnumType] = None,
155     *,
156     name: Optional[str] = None,
157     description: Optional[str] = None,
158     directives: Iterable[object] = ()
159 ) -> Union[EnumType, Callable[[EnumType], EnumType]]:
160     """Registers the enum in the GraphQL type system.
161 
162     If name is passed, the name of the GraphQL type will be
163     the value passed of name instead of the Enum class name.
164     """
165 
166     def wrap(cls: EnumType) -> EnumType:
167         return _process_enum(cls, name, description, directives=directives)
168 
169     if not _cls:
170         return wrap
171 
172     return wrap(_cls)
173
```
--- 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/enum.py b/strawberry/enum.py
--- a/strawberry/enum.py
+++ b/strawberry/enum.py
@@ -57,6 +57,9 @@
     directives: Iterable[object] = ()
     description: Optional[str] = None
 
+    def __int__(self) -> int:
+        return self.value
+
 
 def enum_value(
     value: Any,

{"golden_diff": "diff --git a/strawberry/enum.py b/strawberry/enum.py\n--- a/strawberry/enum.py\n+++ b/strawberry/enum.py\n@@ -57,6 +57,9 @@\n     directives: Iterable[object] = ()\n     description: Optional[str] = None\n \n+    def __int__(self) -> int:\n+        return self.value\n+\n \n def enum_value(\n     value: Any,\n", "issue": "Error in handling enum values while using IntEnum in input type\n## Describe the Bug\r\n\r\nI have enum defined as below and when I initialize input, I get Type Error. The same works when I use Enum instead of IntEnum\r\n\r\n```python\r\n@strawberry.enum(description=\"Reproducing IntEnum issue\")\r\nclass Color(IntEnum):\r\n    OTHER = strawberry.enum_value(\r\n        -1,\r\n    RED = strawberry.enum_value(0, description=\"Red: The color red.\")\r\n    BLUE = strawberry.enum_value(1, description=\"Blue: The color blue.\")\r\n    GREEN = strawberry.enum_value(2, description=\"Green: The color green.\")\r\n\r\n@strawberry.input(description=\"Test Input for reproducing issue\")\r\nclass ShirtInput:\r\n    color: Optional[ScoreId] = None\r\n\r\narg = ShirtInput(color=random.choice(list(Color)))\r\n```\r\nException:\r\n```python\r\nenum_member = __new__(enum_class, *args)\r\nTypeError: int() argument must be a string, a bytes-like object or a number, not 'EnumValueDefinition'\r\n```\r\n\r\nI am using latest release which has the fix for enum value as metioned in [this PR](https://github.com/strawberry-graphql/strawberry/pull/2306)\r\n\r\n## System Information\r\n\r\n - Operating system: MacOS\r\n - Strawberry version (if applicable): 0.146.0\r\n\r\n## Additional Context\r\n\r\n<!-- Add any other relevant information about the problem here. -->\r\n\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/2385\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://polar.sh/api/github/strawberry-graphql/strawberry/issues/2385/pledge.svg?darkmode=1\">\n  <img alt=\"Fund with Polar\" src=\"https://polar.sh/api/github/strawberry-graphql/strawberry/issues/2385/pledge.svg\">\n</picture>\n</a>\n<!-- POLAR PLEDGE BADGE END -->\n\n", "before_files": [{"content": "import dataclasses\nfrom enum import EnumMeta\nfrom typing import (\n    Any,\n    Callable,\n    Iterable,\n    List,\n    Mapping,\n    Optional,\n    TypeVar,\n    Union,\n    overload,\n)\n\nfrom strawberry.type import StrawberryType\n\nfrom .exceptions import ObjectIsNotAnEnumError\n\n\n@dataclasses.dataclass\nclass EnumValue:\n    name: str\n    value: Any\n    deprecation_reason: Optional[str] = None\n    directives: Iterable[object] = ()\n    description: Optional[str] = None\n\n\n@dataclasses.dataclass\nclass EnumDefinition(StrawberryType):\n    wrapped_cls: EnumMeta\n    name: str\n    values: List[EnumValue]\n    description: Optional[str]\n    directives: Iterable[object] = ()\n\n    def __hash__(self) -> int:\n        # TODO: Is this enough for unique-ness?\n        return hash(self.name)\n\n    def copy_with(\n        self, type_var_map: Mapping[TypeVar, Union[StrawberryType, type]]\n    ) -> Union[StrawberryType, type]:\n        # enum don't support type parameters, so we can safely return self\n        return self\n\n    @property\n    def is_generic(self) -> bool:\n        return False\n\n\n# TODO: remove duplication of EnumValueDefinition and EnumValue\n@dataclasses.dataclass\nclass EnumValueDefinition:\n    value: Any\n    deprecation_reason: Optional[str] = None\n    directives: Iterable[object] = ()\n    description: Optional[str] = None\n\n\ndef enum_value(\n    value: Any,\n    deprecation_reason: Optional[str] = None,\n    directives: Iterable[object] = (),\n    description: Optional[str] = None,\n) -> EnumValueDefinition:\n    return EnumValueDefinition(\n        value=value,\n        deprecation_reason=deprecation_reason,\n        directives=directives,\n        description=description,\n    )\n\n\nEnumType = TypeVar(\"EnumType\", bound=EnumMeta)\n\n\ndef _process_enum(\n    cls: EnumType,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = (),\n) -> EnumType:\n    if not isinstance(cls, EnumMeta):\n        raise ObjectIsNotAnEnumError(cls)\n\n    if not name:\n        name = cls.__name__\n\n    description = description\n\n    values = []\n    for item in cls:  # type: ignore\n        item_value = item.value\n        item_name = item.name\n        deprecation_reason = None\n        item_directives: Iterable[object] = ()\n        enum_value_description = None\n\n        if isinstance(item_value, EnumValueDefinition):\n            item_directives = item_value.directives\n            enum_value_description = item_value.description\n            deprecation_reason = item_value.deprecation_reason\n            item_value = item_value.value\n\n            # update _value2member_map_ so that doing `MyEnum.MY_VALUE` and\n            # `MyEnum['MY_VALUE']` both work\n            cls._value2member_map_[item_value] = item\n            cls._member_map_[item_name]._value_ = item_value\n\n        value = EnumValue(\n            item_name,\n            item_value,\n            deprecation_reason=deprecation_reason,\n            directives=item_directives,\n            description=enum_value_description,\n        )\n        values.append(value)\n\n    cls._enum_definition = EnumDefinition(  # type: ignore\n        wrapped_cls=cls,\n        name=name,\n        values=values,\n        description=description,\n        directives=directives,\n    )\n\n    return cls\n\n\n@overload\ndef enum(\n    _cls: EnumType,\n    *,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = ()\n) -> EnumType:\n    ...\n\n\n@overload\ndef enum(\n    _cls: None = None,\n    *,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = ()\n) -> Callable[[EnumType], EnumType]:\n    ...\n\n\ndef enum(\n    _cls: Optional[EnumType] = None,\n    *,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = ()\n) -> Union[EnumType, Callable[[EnumType], EnumType]]:\n    \"\"\"Registers the enum in the GraphQL type system.\n\n    If name is passed, the name of the GraphQL type will be\n    the value passed of name instead of the Enum class name.\n    \"\"\"\n\n    def wrap(cls: EnumType) -> EnumType:\n        return _process_enum(cls, name, description, directives=directives)\n\n    if not _cls:\n        return wrap\n\n    return wrap(_cls)\n", "path": "strawberry/enum.py"}], "after_files": [{"content": "import dataclasses\nfrom enum import EnumMeta\nfrom typing import (\n    Any,\n    Callable,\n    Iterable,\n    List,\n    Mapping,\n    Optional,\n    TypeVar,\n    Union,\n    overload,\n)\n\nfrom strawberry.type import StrawberryType\n\nfrom .exceptions import ObjectIsNotAnEnumError\n\n\n@dataclasses.dataclass\nclass EnumValue:\n    name: str\n    value: Any\n    deprecation_reason: Optional[str] = None\n    directives: Iterable[object] = ()\n    description: Optional[str] = None\n\n\n@dataclasses.dataclass\nclass EnumDefinition(StrawberryType):\n    wrapped_cls: EnumMeta\n    name: str\n    values: List[EnumValue]\n    description: Optional[str]\n    directives: Iterable[object] = ()\n\n    def __hash__(self) -> int:\n        # TODO: Is this enough for unique-ness?\n        return hash(self.name)\n\n    def copy_with(\n        self, type_var_map: Mapping[TypeVar, Union[StrawberryType, type]]\n    ) -> Union[StrawberryType, type]:\n        # enum don't support type parameters, so we can safely return self\n        return self\n\n    @property\n    def is_generic(self) -> bool:\n        return False\n\n\n# TODO: remove duplication of EnumValueDefinition and EnumValue\n@dataclasses.dataclass\nclass EnumValueDefinition:\n    value: Any\n    deprecation_reason: Optional[str] = None\n    directives: Iterable[object] = ()\n    description: Optional[str] = None\n\n    def __int__(self) -> int:\n        return self.value\n\n\ndef enum_value(\n    value: Any,\n    deprecation_reason: Optional[str] = None,\n    directives: Iterable[object] = (),\n    description: Optional[str] = None,\n) -> EnumValueDefinition:\n    return EnumValueDefinition(\n        value=value,\n        deprecation_reason=deprecation_reason,\n        directives=directives,\n        description=description,\n    )\n\n\nEnumType = TypeVar(\"EnumType\", bound=EnumMeta)\n\n\ndef _process_enum(\n    cls: EnumType,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = (),\n) -> EnumType:\n    if not isinstance(cls, EnumMeta):\n        raise ObjectIsNotAnEnumError(cls)\n\n    if not name:\n        name = cls.__name__\n\n    description = description\n\n    values = []\n    for item in cls:  # type: ignore\n        item_value = item.value\n        item_name = item.name\n        deprecation_reason = None\n        item_directives: Iterable[object] = ()\n        enum_value_description = None\n\n        if isinstance(item_value, EnumValueDefinition):\n            item_directives = item_value.directives\n            enum_value_description = item_value.description\n            deprecation_reason = item_value.deprecation_reason\n            item_value = item_value.value\n\n            # update _value2member_map_ so that doing `MyEnum.MY_VALUE` and\n            # `MyEnum['MY_VALUE']` both work\n            cls._value2member_map_[item_value] = item\n            cls._member_map_[item_name]._value_ = item_value\n\n        value = EnumValue(\n            item_name,\n            item_value,\n            deprecation_reason=deprecation_reason,\n            directives=item_directives,\n            description=enum_value_description,\n        )\n        values.append(value)\n\n    cls._enum_definition = EnumDefinition(  # type: ignore\n        wrapped_cls=cls,\n        name=name,\n        values=values,\n        description=description,\n        directives=directives,\n    )\n\n    return cls\n\n\n@overload\ndef enum(\n    _cls: EnumType,\n    *,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = ()\n) -> EnumType:\n    ...\n\n\n@overload\ndef enum(\n    _cls: None = None,\n    *,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = ()\n) -> Callable[[EnumType], EnumType]:\n    ...\n\n\ndef enum(\n    _cls: Optional[EnumType] = None,\n    *,\n    name: Optional[str] = None,\n    description: Optional[str] = None,\n    directives: Iterable[object] = ()\n) -> Union[EnumType, Callable[[EnumType], EnumType]]:\n    \"\"\"Registers the enum in the GraphQL type system.\n\n    If name is passed, the name of the GraphQL type will be\n    the value passed of name instead of the Enum class name.\n    \"\"\"\n\n    def wrap(cls: EnumType) -> EnumType:\n        return _process_enum(cls, name, description, directives=directives)\n\n    if not _cls:\n        return wrap\n\n    return wrap(_cls)\n", "path": "strawberry/enum.py"}]}