Repository: strawberry-graphql/strawberry
Issue: DuplicatedTypeName exception raised for nested generics

Using nested generics causes an invalid `DuplicatedTypeName` exception to be raised when using the same type twice.

## Minimal reproducible example

```python
from typing import Generic, TypeVar

import strawberry

T = TypeVar("T")

@strawberry.type
class Wrapper(Generic[T]):
    value: T

@strawberry.type
class Query:
    a: Wrapper[Wrapper[int]]
    b: Wrapper[Wrapper[int]]

schema = strawberry.Schema(query=Query)
```

## Exception

```
strawberry.exceptions.duplicated_type_name.DuplicatedTypeName:
Type IntWrapperWrapper is defined multiple times in the schema
```

## System Information

 - Operating system: Ubuntu 22.04.1 LTS
 - Strawberry version: The check was first introduced in 0.144 and up until 0.159 it fails.

Changed files:
tests/schema/test_generics.py, strawberry/schema/schema_converter.py

diff --git a/strawberry/schema/schema_converter.py b/strawberry/schema/schema_converter.py
index 61657865..61c9fc43 100644
--- a/strawberry/schema/schema_converter.py
+++ b/strawberry/schema/schema_converter.py
@@ -735,25 +735,31 @@ class GraphQLCoreConverter:
             # manually compare type_var_maps while resolving any lazy types
             # so that they're considered equal to the actual types they're referencing
             equal = True
+            lazy_types = False
+
             for type_var, type1 in cached_type.definition.type_var_map.items():
                 type2 = type_definition.type_var_map[type_var]
                 # both lazy types are always resolved because two different lazy types
                 # may be referencing the same actual type
                 if isinstance(type1, LazyType):
                     type1 = type1.resolve_type()
+                    lazy_types = True
                 elif isinstance(type1, StrawberryOptional) and isinstance(
                     type1.of_type, LazyType
                 ):
+                    lazy_types = True
                     type1.of_type = type1.of_type.resolve_type()
 
                 if isinstance(type2, LazyType):
                     type2 = type2.resolve_type()
+                    lazy_types = True
                 elif isinstance(type2, StrawberryOptional) and isinstance(
                     type2.of_type, LazyType
                 ):
                     type2.of_type = type2.of_type.resolve_type()
+                    lazy_types = True
 
-                if type1 != type2:
+                if lazy_types and type1 != type2:
                     equal = False
                     break
             if equal:
diff --git a/tests/schema/test_generics.py b/tests/schema/test_generics.py
index 73ac7e08..edec57db 100644
--- a/tests/schema/test_generics.py
+++ b/tests/schema/test_generics.py
@@ -1128,3 +1128,18 @@ def test_generic_interface():
             "repr": "foo",
         }
     }
+
+
+def test_nested_generics():
+    T = TypeVar("T")
+
+    @strawberry.type
+    class Wrapper(Generic[T]):
+        value: T
+
+    @strawberry.type
+    class Query:
+        a: Wrapper[Wrapper[int]]
+        b: Wrapper[Wrapper[int]]
+
+    schema = strawberry.Schema(query=Query)