Repository: strawberry-graphql/strawberry

Issue:
Linting problems with VS Code & Pylance
Using VS Code and Pylance for type linting I get this error when using arguements on the decorator

![grafik](https://user-images.githubusercontent.com/42282368/137599173-8c0c7107-fa5d-4206-8264-a82b489f6913.png)

Error:
```py
@strawberry.type(name="Test")
class TestType:
    name: str

    @classmethod
    def from_instance(cls, instance);

        return cls(
            name = instance.name
        )
```

No error:
```py
@strawberry.type
class TestType:
    name: str

    @classmethod
    def from_instance(cls, instance);

        return cls(
            name = instance.name
        )
```





Discussion:

Resolving patch:
diff --git a/strawberry/federation.py b/strawberry/federation.py
--- a/strawberry/federation.py
+++ b/strawberry/federation.py
@@ -162,16 +162,42 @@ def _resolve_type(self, value, _type):
     return entity_type
 
 
+@overload
+@__dataclass_transform__(
+    order_default=True, field_descriptors=(base_field, field, StrawberryField)
+)
+def type(
+    cls: T,
+    *,
+    name: str = None,
+    description: str = None,
+    keys: List[str] = None,
+    extend: bool = False,
+) -> T:
+    ...
+
+
+@overload
 @__dataclass_transform__(
     order_default=True, field_descriptors=(base_field, field, StrawberryField)
 )
 def type(
-    cls: Type = None,
     *,
     name: str = None,
     description: str = None,
     keys: List[str] = None,
     extend: bool = False,
+) -> Callable[[T], T]:
+    ...
+
+
+def type(
+    cls=None,
+    *,
+    name=None,
+    description=None,
+    keys=None,
+    extend=False,
 ):
     return base_type(
         cls,
diff --git a/strawberry/object_type.py b/strawberry/object_type.py
--- a/strawberry/object_type.py
+++ b/strawberry/object_type.py
@@ -1,6 +1,6 @@
 import dataclasses
 import inspect
-from typing import List, Optional, Type, cast
+from typing import Callable, List, Optional, Type, TypeVar, cast, overload
 
 from .exceptions import (
     MissingFieldAnnotationError,
@@ -127,15 +127,44 @@ def _process_type(
     return cls
 
 
+T = TypeVar("T")
+
+
+@overload
 @__dataclass_transform__(order_default=True, field_descriptors=(field, StrawberryField))
 def type(
-    cls: Type = None,
+    cls: T,
     *,
     name: str = None,
     is_input: bool = False,
     is_interface: bool = False,
     description: str = None,
     federation: Optional[FederationTypeParams] = None,
+) -> T:
+    ...
+
+
+@overload
+@__dataclass_transform__(order_default=True, field_descriptors=(field, StrawberryField))
+def type(
+    *,
+    name: str = None,
+    is_input: bool = False,
+    is_interface: bool = False,
+    description: str = None,
+    federation: Optional[FederationTypeParams] = None,
+) -> Callable[[T], T]:
+    ...
+
+
+def type(
+    cls=None,
+    *,
+    name=None,
+    is_input=False,
+    is_interface=False,
+    description=None,
+    federation=None,
 ):
     """Annotates a class as a GraphQL type.
 
@@ -172,13 +201,35 @@ def wrap(cls):
     return wrap(cls)
 
 
+@overload
 @__dataclass_transform__(order_default=True, field_descriptors=(field, StrawberryField))
 def input(
-    cls: Type = None,
+    cls: T,
     *,
     name: str = None,
     description: str = None,
     federation: Optional[FederationTypeParams] = None,
+) -> T:
+    ...
+
+
+@overload
+@__dataclass_transform__(order_default=True, field_descriptors=(field, StrawberryField))
+def input(
+    *,
+    name: str = None,
+    description: str = None,
+    federation: Optional[FederationTypeParams] = None,
+) -> Callable[[T], T]:
+    ...
+
+
+def input(
+    cls=None,
+    *,
+    name=None,
+    description=None,
+    federation=None,
 ):
     """Annotates a class as a GraphQL Input type.
     Example usage:


Test patch:
diff --git a/tests/pyright/test_federation_params.py b/tests/pyright/test_federation_params.py
new file mode 100644
--- /dev/null
+++ b/tests/pyright/test_federation_params.py
@@ -0,0 +1,37 @@
+from .utils import Result, requires_pyright, run_pyright, skip_on_windows
+
+
+pytestmark = [skip_on_windows, requires_pyright]
+
+
+CODE = """
+import strawberry
+
+
+@strawberry.federation.type(name="User")
+class UserModel:
+    name: str
+
+
+UserModel(name="Patrick")
+UserModel(n="Patrick")
+"""
+
+
+def test_pyright():
+    results = run_pyright(CODE)
+
+    assert results == [
+        Result(
+            type="error",
+            message='No parameter named "n" (reportGeneralTypeIssues)',
+            line=11,
+            column=11,
+        ),
+        Result(
+            type="error",
+            message='Argument missing for parameter "name" (reportGeneralTypeIssues)',
+            line=11,
+            column=1,
+        ),
+    ]
diff --git a/tests/pyright/test_params.py b/tests/pyright/test_params.py
new file mode 100644
--- /dev/null
+++ b/tests/pyright/test_params.py
@@ -0,0 +1,57 @@
+from .utils import Result, requires_pyright, run_pyright, skip_on_windows
+
+
+pytestmark = [skip_on_windows, requires_pyright]
+
+
+CODE = """
+import strawberry
+
+
+@strawberry.type(name="User")
+class UserModel:
+    name: str
+
+
+@strawberry.input(name="User")
+class UserInput:
+    name: str
+
+
+UserModel(name="Patrick")
+UserModel(n="Patrick")
+
+UserInput(name="Patrick")
+UserInput(n="Patrick")
+"""
+
+
+def test_pyright():
+    results = run_pyright(CODE)
+
+    assert results == [
+        Result(
+            type="error",
+            message='No parameter named "n" (reportGeneralTypeIssues)',
+            line=16,
+            column=11,
+        ),
+        Result(
+            type="error",
+            message='Argument missing for parameter "name" (reportGeneralTypeIssues)',
+            line=16,
+            column=1,
+        ),
+        Result(
+            type="error",
+            message='No parameter named "n" (reportGeneralTypeIssues)',
+            line=19,
+            column=11,
+        ),
+        Result(
+            type="error",
+            message='Argument missing for parameter "name" (reportGeneralTypeIssues)',
+            line=19,
+            column=1,
+        ),
+    ]