We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
from_pydantic error if pydantic models contains contains fields that are resolver field in strawberry type
Hi :),
i have a pydantic model that i want to convert to strawberry type using from_pydantic() method. The pydantic model contains fields that are resolver field in the strawberry type model.

```python

from .pydantic_models import Post as PostModel

# Strawberry type 
@strawberry.experimental.pydantic.type(name="Post", model=PostModel)
class PostType:
    user: Optional[LazyType["UserType", "api_gateway.user"]] = strawberry.field(name="user", resolver=resolve_user)
    create_date: auto
    text: auto
```

```python

# pydantic_models.py

from pydantic import BaseModel

# pydantic model
class Post(BaseModel):
    user: Optional["User"]
    create_date: datetime = Field(default_factory=datetime.utcnow)
    text: str
```

**Actual Behavior**
----------------------------------
__init__() got an unexpected keyword argument user

**Steps to Reproduce the Problem**
----------------------------------
pydantic_post = Post(user=None, text="Hello World!") #create pydantic instance
posttype = PostType.from_pydantic(pydantic_post) # not work - error

This also not work:
pydantic_post = Post(text="Hello World!")
posttype = PostType.from_pydantic(pydantic_post) # also not work

Thx




--- 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/experimental/pydantic/conversion.py`
Content:
```
1 from typing import Union, cast
2 
3 from strawberry.enum import EnumDefinition
4 from strawberry.field import StrawberryField
5 from strawberry.type import StrawberryList, StrawberryOptional, StrawberryType
6 from strawberry.union import StrawberryUnion
7 
8 
9 def _convert_from_pydantic_to_strawberry_type(
10     type_: Union[StrawberryType, type], data_from_model=None, extra=None
11 ):
12     data = data_from_model if data_from_model is not None else extra
13 
14     if isinstance(type_, StrawberryOptional):
15         if data is None:
16             return data
17         return _convert_from_pydantic_to_strawberry_type(
18             type_.of_type, data_from_model=data, extra=extra
19         )
20     if isinstance(type_, StrawberryUnion):
21         for option_type in type_.types:
22             if hasattr(option_type, "_pydantic_type"):
23                 source_type = option_type._pydantic_type  # type: ignore
24             else:
25                 source_type = cast(type, option_type)
26             if isinstance(data, source_type):
27                 return _convert_from_pydantic_to_strawberry_type(
28                     option_type, data_from_model=data, extra=extra
29                 )
30     if isinstance(type_, EnumDefinition):
31         return data
32     if isinstance(type_, StrawberryList):
33         items = []
34         for index, item in enumerate(data):
35             items.append(
36                 _convert_from_pydantic_to_strawberry_type(
37                     type_.of_type,
38                     data_from_model=item,
39                     extra=extra[index] if extra else None,
40                 )
41             )
42 
43         return items
44 
45     if hasattr(type_, "_type_definition"):
46         # in the case of an interface, the concrete type may be more specific
47         # than the type in the field definition
48         if hasattr(type(data), "_strawberry_type"):
49             type_ = type(data)._strawberry_type
50         return convert_pydantic_model_to_strawberry_class(
51             type_, model_instance=data_from_model, extra=extra
52         )
53 
54     return data
55 
56 
57 def convert_pydantic_model_to_strawberry_class(cls, *, model_instance=None, extra=None):
58     extra = extra or {}
59     kwargs = {}
60 
61     for field in cls._type_definition.fields:
62         field = cast(StrawberryField, field)
63         python_name = field.python_name
64 
65         data_from_extra = extra.get(python_name, None)
66         data_from_model = (
67             getattr(model_instance, python_name, None) if model_instance else None
68         )
69         kwargs[python_name] = _convert_from_pydantic_to_strawberry_type(
70             field.type, data_from_model, extra=data_from_extra
71         )
72 
73     return cls(**kwargs)
74
```
--- 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/experimental/pydantic/conversion.py b/strawberry/experimental/pydantic/conversion.py
--- a/strawberry/experimental/pydantic/conversion.py
+++ b/strawberry/experimental/pydantic/conversion.py
@@ -66,8 +66,12 @@
         data_from_model = (
             getattr(model_instance, python_name, None) if model_instance else None
         )
-        kwargs[python_name] = _convert_from_pydantic_to_strawberry_type(
-            field.type, data_from_model, extra=data_from_extra
-        )
+
+        # only convert and add fields to kwargs if they are present in the `__init__`
+        # method of the class
+        if field.init:
+            kwargs[python_name] = _convert_from_pydantic_to_strawberry_type(
+                field.type, data_from_model, extra=data_from_extra
+            )
 
     return cls(**kwargs)

{"golden_diff": "diff --git a/strawberry/experimental/pydantic/conversion.py b/strawberry/experimental/pydantic/conversion.py\n--- a/strawberry/experimental/pydantic/conversion.py\n+++ b/strawberry/experimental/pydantic/conversion.py\n@@ -66,8 +66,12 @@\n         data_from_model = (\n             getattr(model_instance, python_name, None) if model_instance else None\n         )\n-        kwargs[python_name] = _convert_from_pydantic_to_strawberry_type(\n-            field.type, data_from_model, extra=data_from_extra\n-        )\n+\n+        # only convert and add fields to kwargs if they are present in the `__init__`\n+        # method of the class\n+        if field.init:\n+            kwargs[python_name] = _convert_from_pydantic_to_strawberry_type(\n+                field.type, data_from_model, extra=data_from_extra\n+            )\n \n     return cls(**kwargs)\n", "issue": "from_pydantic error if pydantic models contains contains fields that are resolver field in strawberry type\nHi :),\r\ni have a pydantic model that i want to convert to strawberry type using from_pydantic() method. The pydantic model contains fields that are resolver field in the strawberry type model.\r\n\r\n```python\r\n\r\nfrom .pydantic_models import Post as PostModel\r\n\r\n# Strawberry type \r\n@strawberry.experimental.pydantic.type(name=\"Post\", model=PostModel)\r\nclass PostType:\r\n    user: Optional[LazyType[\"UserType\", \"api_gateway.user\"]] = strawberry.field(name=\"user\", resolver=resolve_user)\r\n    create_date: auto\r\n    text: auto\r\n```\r\n\r\n```python\r\n\r\n# pydantic_models.py\r\n\r\nfrom pydantic import BaseModel\r\n\r\n# pydantic model\r\nclass Post(BaseModel):\r\n    user: Optional[\"User\"]\r\n    create_date: datetime = Field(default_factory=datetime.utcnow)\r\n    text: str\r\n```\r\n\r\n**Actual Behavior**\r\n----------------------------------\r\n__init__() got an unexpected keyword argument user\r\n\r\n**Steps to Reproduce the Problem**\r\n----------------------------------\r\npydantic_post = Post(user=None, text=\"Hello World!\") #create pydantic instance\r\nposttype = PostType.from_pydantic(pydantic_post) # not work - error\r\n\r\nThis also not work:\r\npydantic_post = Post(text=\"Hello World!\")\r\nposttype = PostType.from_pydantic(pydantic_post) # also not work\r\n\r\nThx\r\n\r\n\r\n\n", "before_files": [{"content": "from typing import Union, cast\n\nfrom strawberry.enum import EnumDefinition\nfrom strawberry.field import StrawberryField\nfrom strawberry.type import StrawberryList, StrawberryOptional, StrawberryType\nfrom strawberry.union import StrawberryUnion\n\n\ndef _convert_from_pydantic_to_strawberry_type(\n    type_: Union[StrawberryType, type], data_from_model=None, extra=None\n):\n    data = data_from_model if data_from_model is not None else extra\n\n    if isinstance(type_, StrawberryOptional):\n        if data is None:\n            return data\n        return _convert_from_pydantic_to_strawberry_type(\n            type_.of_type, data_from_model=data, extra=extra\n        )\n    if isinstance(type_, StrawberryUnion):\n        for option_type in type_.types:\n            if hasattr(option_type, \"_pydantic_type\"):\n                source_type = option_type._pydantic_type  # type: ignore\n            else:\n                source_type = cast(type, option_type)\n            if isinstance(data, source_type):\n                return _convert_from_pydantic_to_strawberry_type(\n                    option_type, data_from_model=data, extra=extra\n                )\n    if isinstance(type_, EnumDefinition):\n        return data\n    if isinstance(type_, StrawberryList):\n        items = []\n        for index, item in enumerate(data):\n            items.append(\n                _convert_from_pydantic_to_strawberry_type(\n                    type_.of_type,\n                    data_from_model=item,\n                    extra=extra[index] if extra else None,\n                )\n            )\n\n        return items\n\n    if hasattr(type_, \"_type_definition\"):\n        # in the case of an interface, the concrete type may be more specific\n        # than the type in the field definition\n        if hasattr(type(data), \"_strawberry_type\"):\n            type_ = type(data)._strawberry_type\n        return convert_pydantic_model_to_strawberry_class(\n            type_, model_instance=data_from_model, extra=extra\n        )\n\n    return data\n\n\ndef convert_pydantic_model_to_strawberry_class(cls, *, model_instance=None, extra=None):\n    extra = extra or {}\n    kwargs = {}\n\n    for field in cls._type_definition.fields:\n        field = cast(StrawberryField, field)\n        python_name = field.python_name\n\n        data_from_extra = extra.get(python_name, None)\n        data_from_model = (\n            getattr(model_instance, python_name, None) if model_instance else None\n        )\n        kwargs[python_name] = _convert_from_pydantic_to_strawberry_type(\n            field.type, data_from_model, extra=data_from_extra\n        )\n\n    return cls(**kwargs)\n", "path": "strawberry/experimental/pydantic/conversion.py"}], "after_files": [{"content": "from typing import Union, cast\n\nfrom strawberry.enum import EnumDefinition\nfrom strawberry.field import StrawberryField\nfrom strawberry.type import StrawberryList, StrawberryOptional, StrawberryType\nfrom strawberry.union import StrawberryUnion\n\n\ndef _convert_from_pydantic_to_strawberry_type(\n    type_: Union[StrawberryType, type], data_from_model=None, extra=None\n):\n    data = data_from_model if data_from_model is not None else extra\n\n    if isinstance(type_, StrawberryOptional):\n        if data is None:\n            return data\n        return _convert_from_pydantic_to_strawberry_type(\n            type_.of_type, data_from_model=data, extra=extra\n        )\n    if isinstance(type_, StrawberryUnion):\n        for option_type in type_.types:\n            if hasattr(option_type, \"_pydantic_type\"):\n                source_type = option_type._pydantic_type  # type: ignore\n            else:\n                source_type = cast(type, option_type)\n            if isinstance(data, source_type):\n                return _convert_from_pydantic_to_strawberry_type(\n                    option_type, data_from_model=data, extra=extra\n                )\n    if isinstance(type_, EnumDefinition):\n        return data\n    if isinstance(type_, StrawberryList):\n        items = []\n        for index, item in enumerate(data):\n            items.append(\n                _convert_from_pydantic_to_strawberry_type(\n                    type_.of_type,\n                    data_from_model=item,\n                    extra=extra[index] if extra else None,\n                )\n            )\n\n        return items\n\n    if hasattr(type_, \"_type_definition\"):\n        # in the case of an interface, the concrete type may be more specific\n        # than the type in the field definition\n        if hasattr(type(data), \"_strawberry_type\"):\n            type_ = type(data)._strawberry_type\n        return convert_pydantic_model_to_strawberry_class(\n            type_, model_instance=data_from_model, extra=extra\n        )\n\n    return data\n\n\ndef convert_pydantic_model_to_strawberry_class(cls, *, model_instance=None, extra=None):\n    extra = extra or {}\n    kwargs = {}\n\n    for field in cls._type_definition.fields:\n        field = cast(StrawberryField, field)\n        python_name = field.python_name\n\n        data_from_extra = extra.get(python_name, None)\n        data_from_model = (\n            getattr(model_instance, python_name, None) if model_instance else None\n        )\n\n        # only convert and add fields to kwargs if they are present in the `__init__`\n        # method of the class\n        if field.init:\n            kwargs[python_name] = _convert_from_pydantic_to_strawberry_type(\n                field.type, data_from_model, extra=data_from_extra\n            )\n\n    return cls(**kwargs)\n", "path": "strawberry/experimental/pydantic/conversion.py"}]}