Repository: strawberry-graphql/strawberry

Issue:
Type resolver not called when extending from pydantic model
I have 2 types, Category and Articles, and I want the Category type to return its related Articles(I have tried with other simpler types too), but when defining a resolver in the Category type its not being called:

```python
def articles_helper(root):  
    return []      #  <-whatever I return here, it always shows null
   
   
@strawberry.experimental.pydantic.type(
    model=Category,
    fields=[
        'title',
        'description',
        'content',
        'template',
        'slug',
        'date_published',
        'date_updated',
    ])
class CategoryType(Category):
    id: int
    articles: Optional[List[ArticleType]] = strawberry.field(resolver=articles_helper)  # <- resolver not called
```    

Query type:
```python
@strawberry.type()
class Query:
    category: Optional[CategoryType] = field(resolver=get_category)  # this resolver is OK
```

Always returns `null`:
```
Query:

{
  category(categoryId: 1) {
    id
    title
    articles {
      title
    }
  }
}

Response:

{
  "data": {
    "category": {
      "id": 1,
      "title": "test",
      "articles": null      <- always
    }
  }
}
```

**I works when I don't extend from a pydantic model**


Discussion:

Resolving patch:
diff --git a/strawberry/experimental/pydantic/object_type.py b/strawberry/experimental/pydantic/object_type.py
--- a/strawberry/experimental/pydantic/object_type.py
+++ b/strawberry/experimental/pydantic/object_type.py
@@ -12,7 +12,8 @@
 )
 from strawberry.experimental.pydantic.fields import get_basic_type
 from strawberry.field import StrawberryField
-from strawberry.object_type import _process_type
+from strawberry.object_type import _process_type, _wrap_dataclass
+from strawberry.types.type_resolver import _get_fields
 from strawberry.types.types import FederationTypeParams, TypeDefinition
 
 from .exceptions import MissingFieldsListError, UnregisteredTypeException
@@ -91,34 +92,36 @@ def wrap(cls):
             if name in fields_set
         ]
 
-        cls_annotations = getattr(cls, "__annotations__", {})
+        wrapped = _wrap_dataclass(cls)
+        extra_fields = _get_fields(wrapped)
+
         all_fields.extend(
             (
                 (
-                    name,
-                    type_,
-                    StrawberryField(
-                        python_name=name,
-                        graphql_name=None,
-                        type_annotation=type_,
-                        # we need a default value when adding additional fields
-                        # on top of a type generated from Pydantic, this is because
-                        # Pydantic Optional fields always have None as default value
-                        # which breaks dataclasses generation; as we can't define
-                        # a field without a default value after one with a default value
-                        # adding fields at the beginning won't work as we will also
-                        # support default values on them (so the problem will be just
-                        # shifted around)
-                        default=None,
-                    ),
+                    field.name,
+                    field.type,
+                    field,
                 )
-                for name, type_ in cls_annotations.items()
+                for field in extra_fields
             )
         )
 
+        # Sort fields so that fields with missing defaults go first
+        # because dataclasses require that fields with no defaults are defined
+        # first
+        missing_default = []
+        has_default = []
+        for field in all_fields:
+            if field[2].default is dataclasses.MISSING:
+                missing_default.append(field)
+            else:
+                has_default.append(field)
+
+        sorted_fields = missing_default + has_default
+
         cls = dataclasses.make_dataclass(
             cls.__name__,
-            all_fields,
+            sorted_fields,
         )
 
         _process_type(


Test patch:
diff --git a/tests/experimental/pydantic/schema/test_basic.py b/tests/experimental/pydantic/schema/test_basic.py
--- a/tests/experimental/pydantic/schema/test_basic.py
+++ b/tests/experimental/pydantic/schema/test_basic.py
@@ -205,3 +205,31 @@ def user(self) -> User:
     assert not result.errors
     assert result.data["user"]["name"] == "Marco"
     assert result.data["user"]["age"] == 100
+
+
+def test_type_with_custom_resolver():
+    class UserModel(pydantic.BaseModel):
+        age: int
+
+    def get_age_in_months(root):
+        return root.age * 12
+
+    @strawberry.experimental.pydantic.type(UserModel, fields=["age"])
+    class User:
+        age_in_months: int = strawberry.field(resolver=get_age_in_months)
+
+    @strawberry.type
+    class Query:
+        @strawberry.field
+        def user(self) -> User:
+            return User(age=20)
+
+    schema = strawberry.Schema(query=Query)
+
+    query = "{ user { age ageInMonths } }"
+
+    result = schema.execute_sync(query)
+
+    assert not result.errors
+    assert result.data["user"]["age"] == 20
+    assert result.data["user"]["ageInMonths"] == 240
diff --git a/tests/experimental/pydantic/test_basic.py b/tests/experimental/pydantic/test_basic.py
--- a/tests/experimental/pydantic/test_basic.py
+++ b/tests/experimental/pydantic/test_basic.py
@@ -160,12 +160,12 @@ class UserType:
     assert field1.python_name == "age"
     assert field1.type is int
 
-    assert field2.python_name == "password"
-    assert isinstance(field2.type, StrawberryOptional)
-    assert field2.type.of_type is str
+    assert field2.python_name == "name"
+    assert field2.type is str
 
-    assert field3.python_name == "name"
-    assert field3.type is str
+    assert field3.python_name == "password"
+    assert isinstance(field3.type, StrawberryOptional)
+    assert field3.type.of_type is str
 
 
 @pytest.mark.xfail(
@@ -222,12 +222,12 @@ class UserType:
     assert field1.python_name == "age"
     assert field1.type is int
 
-    assert field2.python_name == "password"
-    assert isinstance(field2.type, StrawberryOptional)
-    assert field2.type.of_type is str
+    assert field2.python_name == "name"
+    assert field2.type is Name
 
-    assert field3.python_name == "name"
-    assert field3.type is Name
+    assert field3.python_name == "password"
+    assert isinstance(field3.type, StrawberryOptional)
+    assert field3.type.of_type is str
 
 
 def test_type_with_aliased_pydantic_field():