Repository: strawberry-graphql/strawberry

Issue:
Using Generic class without type parameter in `strawberry.Private` causes ValueError
When using generic types with `strawberry.Private` if a type-parameter is not used within the annotation then `StrawberryAnnotation` will incorrectly treat it as a generic class and try to resolve it as such.

```python
from __future__ import annotations

from typing import Generic, Sequence, TypeVar

import strawberry


T = TypeVar("T")


@strawberry.type
class Foo(Generic[T]):

    private_field: strawberry.Private[Sequence]


@strawberry.type
class Query:
    @strawberry.field
    def foo(self) -> Foo[str]:
        return Foo(private_field=[1, 2, 3])

```

This results in the following traceback:

<details>
  <summary>Traceback</summary>
  
```bash
Traceback (most recent call last):
  File "~/strawberry/annotation.py", line 21, in <module>
    @strawberry.type
  File "~\strawberry\object_type.py", line 222, in type
    return wrap(cls)
  File "~\strawberry\object_type.py", line 208, in wrap
    wrapped = _wrap_dataclass(cls)
  File "~\strawberry\object_type.py", line 91, in _wrap_dataclass
    return dataclasses.dataclass(cls)
  File "~\Python37\lib\dataclasses.py", line 1010, in dataclass
    return wrap(_cls)
  File "~\Python37\lib\dataclasses.py", line 1002, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
  File "~\Python37\lib\dataclasses.py", line 850, in _process_class
    for name, type in cls_annotations.items()]
  File "~\Python37\lib\dataclasses.py", line 850, in <listcomp>
    for name, type in cls_annotations.items()]
  File "~\Python37\lib\dataclasses.py", line 699, in _get_field
    or (isinstance(f.type, str)
  File "~\strawberry\field.py", line 207, in type
    if self.base_resolver.type is not None:
  File "~\strawberry\types\fields\resolver.py", line 218, in type
    return self.type_annotation.resolve()
  File "~\strawberry\annotation.py", line 84, in resolve
    return self.create_concrete_type(evaled_type)
  File "~\strawberry\annotation.py", line 111, in create_concrete_type
    return type_definition.resolve_generic(evaled_type)
  File "~\strawberry\types\types.py", line 62, in resolve_generic
    return self.copy_with(type_var_map)
  File "~\strawberry\types\types.py", line 71, in copy_with
    field_type = field.type
  File "~\strawberry\field.py", line 221, in type
    return self.type_annotation.resolve()
  File "~\strawberry\annotation.py", line 84, in resolve
    return self.create_concrete_type(evaled_type)
  File "~\strawberry\annotation.py", line 113, in create_concrete_type
    raise ValueError(f"Not supported {evaled_type}")
ValueError: Not supported typing_extensions.Annotated[__main__.PrivateGenericType, <strawberry.private.StrawberryPrivate object at 0x000001C3D3E109C8>]
```

</details>

Passing `Any` to the Generic type is currently a workaround for this bug.
```python
    private_field: strawberry.Private[Sequence[Any]]
```
As per CPython [docs](https://docs.python.org/3/library/typing.html#user-defined-generic-types):

>Using a generic class without specifying type parameters assumes [Any](https://docs.python.org/3/library/typing.html#typing.Any) for each position. In the following example, MyIterable is not generic but implicitly inherits from Iterable[Any]:

Therefore, defining Generic type annotations without an explicit `Any` should be supported.
## System Information

 - Python 3.7.9
 - Operating system: Windows 10
 - Strawberry version (if applicable): 0.114.0


Discussion:

Resolving patch:
diff --git a/strawberry/annotation.py b/strawberry/annotation.py
--- a/strawberry/annotation.py
+++ b/strawberry/annotation.py
@@ -12,6 +12,8 @@
     _eval_type,
 )
 
+from strawberry.private import is_private
+
 
 try:
     from typing import ForwardRef
@@ -69,6 +71,8 @@ def resolve(self) -> Union[StrawberryType, type]:
             annotation = self.annotation
 
         evaled_type = _eval_type(annotation, self.namespace, None)
+        if is_private(evaled_type):
+            return evaled_type
         if self._is_async_type(evaled_type):
             evaled_type = self._strip_async_type(evaled_type)
         if self._is_lazy_type(evaled_type):


Test patch:
diff --git a/tests/schema/test_private_field.py b/tests/schema/test_private_field.py
--- a/tests/schema/test_private_field.py
+++ b/tests/schema/test_private_field.py
@@ -1,9 +1,12 @@
 from dataclasses import dataclass
+from typing import Generic, TypeVar
 
 import pytest
 
 import strawberry
+from strawberry.annotation import StrawberryAnnotation
 from strawberry.exceptions import PrivateStrawberryFieldError
+from strawberry.field import StrawberryField
 
 
 def test_private_field():
@@ -114,3 +117,23 @@ class LocallyScopedSensitiveData:
 
         # If schema-conversion does not raise, check if private field is visible
         assert "notSeen" not in str(schema)
+
+
+def test_private_field_type_resolution_with_generic_type():
+    """Check strawberry.Private when its argument is a implicit `Any` generic type.
+
+    Refer to: https://github.com/strawberry-graphql/strawberry/issues/1938
+    """
+
+    T = TypeVar("T")
+
+    class GenericPrivateType(Generic[T]):
+        pass
+
+    private_field = StrawberryField(
+        type_annotation=StrawberryAnnotation(
+            annotation="strawberry.Private[GenericPrivateType]",
+            namespace={**globals(), **locals()},
+        ),
+    )
+    assert private_field.type == strawberry.Private[GenericPrivateType]