Repository: strawberry-graphql/strawberry

Issue:
mypy_plugin not compatible with mypy 1.0.0
I get a traceback from `mypy_plugin.py` after upgrading mypy from 0.991 to 1.0.0:

```
> mypy app --show-traceback
C:\workspace\python\flaskpatient\.venv\Lib\site-packages\strawberry\federation\schema_directives.py:33: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.0.0
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "mypy\semanal.py", line 6210, in accept
  File "mypy\nodes.py", line 1133, in accept
  File "mypy\semanal.py", line 1545, in visit_class_def
  File "mypy\semanal.py", line 1625, in analyze_class
  File "mypy\semanal.py", line 1652, in analyze_class_body_common
  File "mypy\semanal.py", line 1721, in apply_class_plugin_hooks
  File "C:\workspace\python\flaskpatient\.venv\Lib\site-packages\strawberry\ext\mypy_plugin.py", line 848, in custom_dataclass_class_maker_callback
    transformer.transform()
  File "C:\workspace\python\flaskpatient\.venv\Lib\site-packages\strawberry\ext\mypy_plugin.py", line 578, in transform
    args=[attr.to_argument() for attr in attributes if attr.is_in_init],
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\workspace\python\flaskpatient\.venv\Lib\site-packages\strawberry\ext\mypy_plugin.py", line 578, in <listcomp>
    args=[attr.to_argument() for attr in attributes if attr.is_in_init],
          ^^^^^^^^^^^^^^^^^^
TypeError: to_argument() missing required argument 'current_info' (pos 1)
C:\workspace\python\flaskpatient\.venv\Lib\site-packages\strawberry\federation\schema_directives.py:33: : note: use --pdb to drop into pdb
```

## System Information

 - Operating system: Windows 11 22H2
 - Strawberry version: 0.155.4


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



Discussion:
Same Error in macOS 13.2 (arm64).

Resolving patch:
diff --git a/strawberry/ext/mypy_plugin.py b/strawberry/ext/mypy_plugin.py
--- a/strawberry/ext/mypy_plugin.py
+++ b/strawberry/ext/mypy_plugin.py
@@ -572,10 +572,14 @@ def transform(self) -> None:
             )
             and attributes
         ):
+            args = [info] if MypyVersion.VERSION >= Decimal("1.0") else []
+
             add_method(
                 ctx,
                 "__init__",
-                args=[attr.to_argument() for attr in attributes if attr.is_in_init],
+                args=[
+                    attr.to_argument(*args) for attr in attributes if attr.is_in_init
+                ],
                 return_type=NoneType(),
             )
 
@@ -817,8 +821,12 @@ def _freeze(self, attributes: List[DataclassAttribute]) -> None:
                 assert isinstance(var, Var)
                 var.is_property = True
             else:
-                var = attr.to_var()
-                var.info = info
+                if MypyVersion.VERSION >= Decimal("1.0"):
+                    var = attr.to_var(current_info=info)
+                else:
+                    var = attr.to_var()  # type: ignore
+                    var.info = info
+
                 var.is_property = True
                 var._fullname = info.fullname + "." + var.name
                 info.names[var.name] = SymbolTableNode(MDEF, var)
@@ -834,8 +842,12 @@ def _propertize_callables(self, attributes: List[DataclassAttribute]) -> None:
         info = self._ctx.cls.info
         for attr in attributes:
             if isinstance(get_proper_type(attr.type), CallableType):
-                var = attr.to_var()
-                var.info = info
+                if MypyVersion.VERSION >= Decimal("1.0"):
+                    var = attr.to_var(current_info=info)
+                else:
+                    var = attr.to_var()  # type: ignore
+                    var.info = info
+
                 var.is_property = True
                 var.is_settable_property = True
                 var._fullname = info.fullname + "." + var.name


Test patch:
diff --git a/tests/mypy/test_enum.yml b/tests/mypy/test_enum.yml
--- a/tests/mypy/test_enum.yml
+++ b/tests/mypy/test_enum.yml
@@ -62,7 +62,7 @@
     reveal_type(Flavour)
     reveal_type(a)
   out: |
-    main:14: note: Revealed type is "builtins.object"
+    main:14: note: Revealed type is "typing._SpecialForm"
     main:15: note: Revealed type is "Type[enum.Enum]"
 
 - case: test_enum_with_decorator
diff --git a/tests/mypy/test_plugin.py b/tests/mypy/test_plugin.py
--- a/tests/mypy/test_plugin.py
+++ b/tests/mypy/test_plugin.py
@@ -24,12 +24,15 @@ def maintain_version():
         ("0.920", Decimal("0.920")),
         ("0.980+dev.d89b28d973c3036ef154c9551b961d9119761380", Decimal("0.980")),
         ("1.0.0", Decimal("1.0")),
+        ("1.0.1", Decimal("1.0")),
+        ("1.1.1", Decimal("1.1")),
         ("99.999", Decimal("99.999")),
     ],
 )
 def test_plugin(version, expected):
 
     plugin(version)
+
     assert MypyVersion.VERSION == expected
 
 
diff --git a/tests/mypy/test_union.yml b/tests/mypy/test_union.yml
--- a/tests/mypy/test_union.yml
+++ b/tests/mypy/test_union.yml
@@ -21,7 +21,7 @@
     a = User(name="abc")
     reveal_type(a)
   out: |
-    main:16: note: Revealed type is "builtins.object"
+    main:16: note: Revealed type is "typing._SpecialForm"
     main:17: note: Revealed type is "Union[main.User, main.Error]"
     main:20: note: Revealed type is "main.User"
 
@@ -47,7 +47,7 @@
     a: Result
     reveal_type(a)
   out: |
-    main:16: note: Revealed type is "builtins.object"
+    main:16: note: Revealed type is "typing._SpecialForm"
     main:19: note: Revealed type is "Union[main.Error, main.Edge[builtins.str]]"
 
 - case: test_union_kwargs
@@ -73,6 +73,6 @@
     a = User(name="abc")
     reveal_type(a)
   out: |
-    main:16: note: Revealed type is "builtins.object"
+    main:16: note: Revealed type is "typing._SpecialForm"
     main:17: note: Revealed type is "Union[main.User, main.Error]"
     main:20: note: Revealed type is "main.User"