We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Cannot create type with multiple Unions
```python
from typing import Union

import strawberry


@strawberry.type
class CoolType:
    @strawberry.type
    class UnionA1:
        value: int

    @strawberry.type
    class UnionA2:
        value: int

    @strawberry.type
    class UnionB1:
        value: int

    @strawberry.type
    class UnionB2:
        value: int

    field1: Union[UnionA1, UnionA2]
    field2: Union[UnionB1, UnionB2]


schema = strawberry.Schema(query=CoolType)
```

```.pytb
Traceback (most recent call last):
  File "/home/ignormies/.config/JetBrains/PyCharm2020.1/scratches/scratch.py", line 28, in <module>
    schema = strawberry.Schema(query=CoolType)
  File "/home/ignormies/.local/share/virtualenvs/gql-bf-XGX4szKA-py3.8/lib/python3.8/site-packages/strawberry/schema.py", line 25, in __init__
    super().__init__(
  File "/home/ignormies/.local/share/virtualenvs/gql-bf-XGX4szKA-py3.8/lib/python3.8/site-packages/graphql/type/schema.py", line 239, in __init__
    raise TypeError(
TypeError: Schema must contain uniquely named types but contains multiple types named '_resolver'.
```

Removing either `field1` or `field2` allows the schema to be created

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `strawberry/type.py`
Content:
```
1 import copy
2 import dataclasses
3 from functools import partial
4 from typing import Optional
5 
6 from graphql import GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType
7 
8 from .constants import IS_STRAWBERRY_FIELD, IS_STRAWBERRY_INPUT, IS_STRAWBERRY_INTERFACE
9 from .field import field, strawberry_field
10 from .type_registry import register_type
11 from .utils.str_converters import to_camel_case
12 from .utils.typing import get_actual_type, has_type_var, is_type_var
13 
14 
15 def _interface_resolve_type(result, info, return_type):
16     """Resolves the correct type for an interface"""
17     return result.__class__.graphql_type
18 
19 
20 def _get_resolver(cls, field_name):
21     class_field = getattr(cls, field_name, None)
22 
23     if class_field and getattr(class_field, "resolver", None):
24         return class_field.resolver
25 
26     def _resolver(root, info):
27         if not root:
28             return None
29 
30         field_resolver = getattr(root, field_name, None)
31 
32         if getattr(field_resolver, IS_STRAWBERRY_FIELD, False):
33             return field_resolver(root, info)
34 
35         elif field_resolver.__class__ is strawberry_field:
36             # TODO: support default values
37             return None
38 
39         return field_resolver
40 
41     return _resolver
42 
43 
44 def _process_type(
45     cls, *, name=None, is_input=False, is_interface=False, description=None
46 ):
47     name = name or cls.__name__
48 
49     def _get_fields(wrapped, types_replacement_map=None):
50         class_fields = dataclasses.fields(wrapped)
51 
52         fields = {}
53 
54         for class_field in class_fields:
55             # we want to make a copy of the original field when dealing
56             # with generic types and also get the actual type for the type var
57             if is_type_var(class_field.type) or has_type_var(class_field.type):
58                 class_field = copy.copy(class_field)
59                 class_field.type = get_actual_type(
60                     class_field.type, types_replacement_map
61                 )
62             # like args, a None default implies Optional
63             if class_field.default is None:
64                 class_field.type = Optional[class_field.type]
65 
66             field_name = getattr(class_field, "field_name", None) or to_camel_case(
67                 class_field.name
68             )
69             description = getattr(class_field, "field_description", None)
70             permission_classes = getattr(class_field, "field_permission_classes", None)
71             resolver = getattr(class_field, "field_resolver", None) or _get_resolver(
72                 cls, class_field.name
73             )
74             resolver.__annotations__["return"] = class_field.type
75 
76             fields[field_name] = field(
77                 resolver,
78                 is_input=is_input,
79                 description=description,
80                 permission_classes=permission_classes,
81             ).graphql_type
82             # supply a graphql default_value if the type annotation has a default
83             if class_field.default not in (dataclasses.MISSING, None):
84                 fields[field_name].default_value = class_field.default
85 
86         strawberry_fields = {}
87 
88         for base in [cls, *cls.__bases__]:
89             strawberry_fields.update(
90                 {
91                     key: value
92                     for key, value in base.__dict__.items()
93                     if getattr(value, IS_STRAWBERRY_FIELD, False)
94                 }
95             )
96 
97         for key, value in strawberry_fields.items():
98             name = getattr(value, "field_name", None) or to_camel_case(key)
99 
100             fields[name] = value.graphql_type
101 
102         return fields
103 
104     if is_input:
105         setattr(cls, IS_STRAWBERRY_INPUT, True)
106     elif is_interface:
107         setattr(cls, IS_STRAWBERRY_INTERFACE, True)
108 
109     extra_kwargs = {"description": description or cls.__doc__}
110 
111     wrapped = dataclasses.dataclass(cls)
112 
113     if is_input:
114         TypeClass = GraphQLInputObjectType
115     elif is_interface:
116         TypeClass = GraphQLInterfaceType
117 
118         # TODO: in future we might want to be able to override this
119         # for example to map a class (like a django model) to one
120         # type of the interface
121         extra_kwargs["resolve_type"] = _interface_resolve_type
122     else:
123         TypeClass = GraphQLObjectType
124 
125         extra_kwargs["interfaces"] = [
126             klass.graphql_type
127             for klass in cls.__bases__
128             if hasattr(klass, IS_STRAWBERRY_INTERFACE)
129         ]
130 
131     graphql_type = TypeClass(
132         name,
133         lambda types_replacement_map=None: _get_fields(wrapped, types_replacement_map),
134         **extra_kwargs
135     )
136     register_type(cls, graphql_type)
137 
138     return wrapped
139 
140 
141 def type(cls=None, *, name=None, is_input=False, is_interface=False, description=None):
142     """Annotates a class as a GraphQL type.
143 
144     Example usage:
145 
146     >>> @strawberry.type:
147     >>> class X:
148     >>>     field_abc: str = "ABC"
149     """
150 
151     def wrap(cls):
152         return _process_type(
153             cls,
154             name=name,
155             is_input=is_input,
156             is_interface=is_interface,
157             description=description,
158         )
159 
160     if cls is None:
161         return wrap
162 
163     return wrap(cls)
164 
165 
166 input = partial(type, is_input=True)
167 interface = partial(type, is_interface=True)
168
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/strawberry/type.py b/strawberry/type.py
--- a/strawberry/type.py
+++ b/strawberry/type.py
@@ -38,6 +38,8 @@
 
         return field_resolver
 
+    _resolver.__name__ = field_name
+
     return _resolver

{"golden_diff": "diff --git a/strawberry/type.py b/strawberry/type.py\n--- a/strawberry/type.py\n+++ b/strawberry/type.py\n@@ -38,6 +38,8 @@\n \n         return field_resolver\n \n+    _resolver.__name__ = field_name\n+\n     return _resolver\n", "issue": "Cannot create type with multiple Unions\n```python\r\nfrom typing import Union\r\n\r\nimport strawberry\r\n\r\n\r\n@strawberry.type\r\nclass CoolType:\r\n    @strawberry.type\r\n    class UnionA1:\r\n        value: int\r\n\r\n    @strawberry.type\r\n    class UnionA2:\r\n        value: int\r\n\r\n    @strawberry.type\r\n    class UnionB1:\r\n        value: int\r\n\r\n    @strawberry.type\r\n    class UnionB2:\r\n        value: int\r\n\r\n    field1: Union[UnionA1, UnionA2]\r\n    field2: Union[UnionB1, UnionB2]\r\n\r\n\r\nschema = strawberry.Schema(query=CoolType)\r\n```\r\n\r\n```.pytb\r\nTraceback (most recent call last):\r\n  File \"/home/ignormies/.config/JetBrains/PyCharm2020.1/scratches/scratch.py\", line 28, in <module>\r\n    schema = strawberry.Schema(query=CoolType)\r\n  File \"/home/ignormies/.local/share/virtualenvs/gql-bf-XGX4szKA-py3.8/lib/python3.8/site-packages/strawberry/schema.py\", line 25, in __init__\r\n    super().__init__(\r\n  File \"/home/ignormies/.local/share/virtualenvs/gql-bf-XGX4szKA-py3.8/lib/python3.8/site-packages/graphql/type/schema.py\", line 239, in __init__\r\n    raise TypeError(\r\nTypeError: Schema must contain uniquely named types but contains multiple types named '_resolver'.\r\n```\r\n\r\nRemoving either `field1` or `field2` allows the schema to be created\n", "before_files": [{"content": "import copy\nimport dataclasses\nfrom functools import partial\nfrom typing import Optional\n\nfrom graphql import GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType\n\nfrom .constants import IS_STRAWBERRY_FIELD, IS_STRAWBERRY_INPUT, IS_STRAWBERRY_INTERFACE\nfrom .field import field, strawberry_field\nfrom .type_registry import register_type\nfrom .utils.str_converters import to_camel_case\nfrom .utils.typing import get_actual_type, has_type_var, is_type_var\n\n\ndef _interface_resolve_type(result, info, return_type):\n    \"\"\"Resolves the correct type for an interface\"\"\"\n    return result.__class__.graphql_type\n\n\ndef _get_resolver(cls, field_name):\n    class_field = getattr(cls, field_name, None)\n\n    if class_field and getattr(class_field, \"resolver\", None):\n        return class_field.resolver\n\n    def _resolver(root, info):\n        if not root:\n            return None\n\n        field_resolver = getattr(root, field_name, None)\n\n        if getattr(field_resolver, IS_STRAWBERRY_FIELD, False):\n            return field_resolver(root, info)\n\n        elif field_resolver.__class__ is strawberry_field:\n            # TODO: support default values\n            return None\n\n        return field_resolver\n\n    return _resolver\n\n\ndef _process_type(\n    cls, *, name=None, is_input=False, is_interface=False, description=None\n):\n    name = name or cls.__name__\n\n    def _get_fields(wrapped, types_replacement_map=None):\n        class_fields = dataclasses.fields(wrapped)\n\n        fields = {}\n\n        for class_field in class_fields:\n            # we want to make a copy of the original field when dealing\n            # with generic types and also get the actual type for the type var\n            if is_type_var(class_field.type) or has_type_var(class_field.type):\n                class_field = copy.copy(class_field)\n                class_field.type = get_actual_type(\n                    class_field.type, types_replacement_map\n                )\n            # like args, a None default implies Optional\n            if class_field.default is None:\n                class_field.type = Optional[class_field.type]\n\n            field_name = getattr(class_field, \"field_name\", None) or to_camel_case(\n                class_field.name\n            )\n            description = getattr(class_field, \"field_description\", None)\n            permission_classes = getattr(class_field, \"field_permission_classes\", None)\n            resolver = getattr(class_field, \"field_resolver\", None) or _get_resolver(\n                cls, class_field.name\n            )\n            resolver.__annotations__[\"return\"] = class_field.type\n\n            fields[field_name] = field(\n                resolver,\n                is_input=is_input,\n                description=description,\n                permission_classes=permission_classes,\n            ).graphql_type\n            # supply a graphql default_value if the type annotation has a default\n            if class_field.default not in (dataclasses.MISSING, None):\n                fields[field_name].default_value = class_field.default\n\n        strawberry_fields = {}\n\n        for base in [cls, *cls.__bases__]:\n            strawberry_fields.update(\n                {\n                    key: value\n                    for key, value in base.__dict__.items()\n                    if getattr(value, IS_STRAWBERRY_FIELD, False)\n                }\n            )\n\n        for key, value in strawberry_fields.items():\n            name = getattr(value, \"field_name\", None) or to_camel_case(key)\n\n            fields[name] = value.graphql_type\n\n        return fields\n\n    if is_input:\n        setattr(cls, IS_STRAWBERRY_INPUT, True)\n    elif is_interface:\n        setattr(cls, IS_STRAWBERRY_INTERFACE, True)\n\n    extra_kwargs = {\"description\": description or cls.__doc__}\n\n    wrapped = dataclasses.dataclass(cls)\n\n    if is_input:\n        TypeClass = GraphQLInputObjectType\n    elif is_interface:\n        TypeClass = GraphQLInterfaceType\n\n        # TODO: in future we might want to be able to override this\n        # for example to map a class (like a django model) to one\n        # type of the interface\n        extra_kwargs[\"resolve_type\"] = _interface_resolve_type\n    else:\n        TypeClass = GraphQLObjectType\n\n        extra_kwargs[\"interfaces\"] = [\n            klass.graphql_type\n            for klass in cls.__bases__\n            if hasattr(klass, IS_STRAWBERRY_INTERFACE)\n        ]\n\n    graphql_type = TypeClass(\n        name,\n        lambda types_replacement_map=None: _get_fields(wrapped, types_replacement_map),\n        **extra_kwargs\n    )\n    register_type(cls, graphql_type)\n\n    return wrapped\n\n\ndef type(cls=None, *, name=None, is_input=False, is_interface=False, description=None):\n    \"\"\"Annotates a class as a GraphQL type.\n\n    Example usage:\n\n    >>> @strawberry.type:\n    >>> class X:\n    >>>     field_abc: str = \"ABC\"\n    \"\"\"\n\n    def wrap(cls):\n        return _process_type(\n            cls,\n            name=name,\n            is_input=is_input,\n            is_interface=is_interface,\n            description=description,\n        )\n\n    if cls is None:\n        return wrap\n\n    return wrap(cls)\n\n\ninput = partial(type, is_input=True)\ninterface = partial(type, is_interface=True)\n", "path": "strawberry/type.py"}], "after_files": [{"content": "import copy\nimport dataclasses\nfrom functools import partial\nfrom typing import Optional\n\nfrom graphql import GraphQLInputObjectType, GraphQLInterfaceType, GraphQLObjectType\n\nfrom .constants import IS_STRAWBERRY_FIELD, IS_STRAWBERRY_INPUT, IS_STRAWBERRY_INTERFACE\nfrom .field import field, strawberry_field\nfrom .type_registry import register_type\nfrom .utils.str_converters import to_camel_case\nfrom .utils.typing import get_actual_type, has_type_var, is_type_var\n\n\ndef _interface_resolve_type(result, info, return_type):\n    \"\"\"Resolves the correct type for an interface\"\"\"\n    return result.__class__.graphql_type\n\n\ndef _get_resolver(cls, field_name):\n    class_field = getattr(cls, field_name, None)\n\n    if class_field and getattr(class_field, \"resolver\", None):\n        return class_field.resolver\n\n    def _resolver(root, info):\n        if not root:\n            return None\n\n        field_resolver = getattr(root, field_name, None)\n\n        if getattr(field_resolver, IS_STRAWBERRY_FIELD, False):\n            return field_resolver(root, info)\n\n        elif field_resolver.__class__ is strawberry_field:\n            # TODO: support default values\n            return None\n\n        return field_resolver\n\n    _resolver.__name__ = field_name\n\n    return _resolver\n\n\ndef _process_type(\n    cls, *, name=None, is_input=False, is_interface=False, description=None\n):\n    name = name or cls.__name__\n\n    def _get_fields(wrapped, types_replacement_map=None):\n        class_fields = dataclasses.fields(wrapped)\n\n        fields = {}\n\n        for class_field in class_fields:\n            # we want to make a copy of the original field when dealing\n            # with generic types and also get the actual type for the type var\n            if is_type_var(class_field.type) or has_type_var(class_field.type):\n                class_field = copy.copy(class_field)\n                class_field.type = get_actual_type(\n                    class_field.type, types_replacement_map\n                )\n            # like args, a None default implies Optional\n            if class_field.default is None:\n                class_field.type = Optional[class_field.type]\n\n            field_name = getattr(class_field, \"field_name\", None) or to_camel_case(\n                class_field.name\n            )\n            description = getattr(class_field, \"field_description\", None)\n            permission_classes = getattr(class_field, \"field_permission_classes\", None)\n            resolver = getattr(class_field, \"field_resolver\", None) or _get_resolver(\n                cls, class_field.name\n            )\n            resolver.__annotations__[\"return\"] = class_field.type\n\n            fields[field_name] = field(\n                resolver,\n                is_input=is_input,\n                description=description,\n                permission_classes=permission_classes,\n            ).graphql_type\n            # supply a graphql default_value if the type annotation has a default\n            if class_field.default not in (dataclasses.MISSING, None):\n                fields[field_name].default_value = class_field.default\n\n        strawberry_fields = {}\n\n        for base in [cls, *cls.__bases__]:\n            strawberry_fields.update(\n                {\n                    key: value\n                    for key, value in base.__dict__.items()\n                    if getattr(value, IS_STRAWBERRY_FIELD, False)\n                }\n            )\n\n        for key, value in strawberry_fields.items():\n            name = getattr(value, \"field_name\", None) or to_camel_case(key)\n\n            fields[name] = value.graphql_type\n\n        return fields\n\n    if is_input:\n        setattr(cls, IS_STRAWBERRY_INPUT, True)\n    elif is_interface:\n        setattr(cls, IS_STRAWBERRY_INTERFACE, True)\n\n    extra_kwargs = {\"description\": description or cls.__doc__}\n\n    wrapped = dataclasses.dataclass(cls)\n\n    if is_input:\n        TypeClass = GraphQLInputObjectType\n    elif is_interface:\n        TypeClass = GraphQLInterfaceType\n\n        # TODO: in future we might want to be able to override this\n        # for example to map a class (like a django model) to one\n        # type of the interface\n        extra_kwargs[\"resolve_type\"] = _interface_resolve_type\n    else:\n        TypeClass = GraphQLObjectType\n\n        extra_kwargs[\"interfaces\"] = [\n            klass.graphql_type\n            for klass in cls.__bases__\n            if hasattr(klass, IS_STRAWBERRY_INTERFACE)\n        ]\n\n    graphql_type = TypeClass(\n        name,\n        lambda types_replacement_map=None: _get_fields(wrapped, types_replacement_map),\n        **extra_kwargs\n    )\n    register_type(cls, graphql_type)\n\n    return wrapped\n\n\ndef type(cls=None, *, name=None, is_input=False, is_interface=False, description=None):\n    \"\"\"Annotates a class as a GraphQL type.\n\n    Example usage:\n\n    >>> @strawberry.type:\n    >>> class X:\n    >>>     field_abc: str = \"ABC\"\n    \"\"\"\n\n    def wrap(cls):\n        return _process_type(\n            cls,\n            name=name,\n            is_input=is_input,\n            is_interface=is_interface,\n            description=description,\n        )\n\n    if cls is None:\n        return wrap\n\n    return wrap(cls)\n\n\ninput = partial(type, is_input=True)\ninterface = partial(type, is_interface=True)\n", "path": "strawberry/type.py"}]}