Repository: strawberry-graphql/strawberry

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 -->



Discussion:
Encountered this issue today. Any chance of it being fixed? @patrick91 if you can give a back-of-napkin sketch of how it should be solve I can submit a PR.

Resolving patch:
diff --git a/strawberry/enum.py b/strawberry/enum.py
--- a/strawberry/enum.py
+++ b/strawberry/enum.py
@@ -57,6 +57,9 @@ class EnumValueDefinition:
     directives: Iterable[object] = ()
     description: Optional[str] = None
 
+    def __int__(self) -> int:
+        return self.value
+
 
 def enum_value(
     value: Any,


Test patch:
diff --git a/tests/enums/test_enum.py b/tests/enums/test_enum.py
--- a/tests/enums/test_enum.py
+++ b/tests/enums/test_enum.py
@@ -1,4 +1,4 @@
-from enum import Enum
+from enum import Enum, IntEnum
 
 import pytest
 
@@ -153,3 +153,19 @@ class TestEnum(Enum):
         "B",
         "Coconut",
     ]
+
+
+def test_int_enums():
+    @strawberry.enum
+    class TestEnum(IntEnum):
+        A = 1
+        B = 2
+        C = 3
+        D = strawberry.enum_value(4, description="D")
+
+    assert TestEnum.A.value == 1
+    assert TestEnum.B.value == 2
+    assert TestEnum.C.value == 3
+    assert TestEnum.D.value == 4
+
+    assert [x.value for x in TestEnum.__members__.values()] == [1, 2, 3, 4]