async def test_derived_interface(mocker: MockerFixture):
    """Test if correct resolve_type is called on a derived interface."""

    class NodeInterfaceTester:
        @classmethod
        def resolve_type(cls, obj: Any, *args: Any, **kwargs: Any) -> str:
            del args, kwargs
            return obj.__strawberry_definition__.name

    class NamedNodeInterfaceTester:
        @classmethod
        def resolve_type(cls, obj: Any, *args: Any, **kwargs: Any) -> str:
            del args, kwargs
            return obj.__strawberry_definition__.name

    spy_node_resolve_type = mocker.spy(NodeInterfaceTester, "resolve_type")
    spy_named_node_resolve_type = mocker.spy(NamedNodeInterfaceTester, "resolve_type")

    @strawberry.interface
    class Node(NodeInterfaceTester):
        id: int

    @strawberry.interface
    class NamedNode(NamedNodeInterfaceTester, Node):
        name: str

    @strawberry.type
    class Person(NamedNode):
        pass

    @strawberry.type
    class Query:
        @strawberry.field
        def friends(self) -> list[NamedNode]:
            return [Person(id=1, name="foo"), Person(id=2, name="bar")]

    schema = strawberry.Schema(Query, types=[Person])
    result = await schema.execute("query { friends { name } }")

    assert not result.errors
    assert result.data == {"friends": [{"name": "foo"}, {"name": "bar"}]}

    assert result.data is not None
    assert spy_named_node_resolve_type.call_count == len(result.data["friends"])
    spy_node_resolve_type.assert_not_called()
Test if correct resolve_type is called on a derived interface.
tests/schema/test_interface.py