def test_interface_resolve_type(mocker: MockerFixture):
    """Check that the default implemenetation of `resolve_type` functions as expected.

    In this test-case the default implementation of `resolve_type` defined in
    `GraphQLCoreConverter.from_interface`, should immediately resolve the type of the
    returned concrete object. A concrete object is defined as one that is an instance of
    the interface it implements.

    Before the default implementation of `resolve_type`, the `is_type_of` methods of all
    specializations of an interface (in this case Anime & Movie) would be called. As
    this needlessly reduces performance, this test checks if only `Anime.is_type_of` is
    called when `Query.node` returns an `Anime` object.
    """

    class IsTypeOfTester:
        @classmethod
        def is_type_of(cls, obj: Any, _) -> bool:
            return isinstance(obj, cls)

    spy_is_type_of = mocker.spy(IsTypeOfTester, "is_type_of")

    @strawberry.interface
    class Node:
        id: int

    @strawberry.type
    class Anime(Node, IsTypeOfTester):
        name: str

    @strawberry.type
    class Movie(Node):
        title: str

        @classmethod
        def is_type_of(cls, *args: Any, **kwargs: Any) -> bool:
            del args, kwargs
            raise RuntimeError("Movie.is_type_of shouldn't have been called")

    @strawberry.type
    class Query:
        @strawberry.field
        def node(self) -> Node:
            return Anime(id=1, name="One Pierce")

    schema = strawberry.Schema(query=Query, types=[Anime, Movie])

    query = "{ node {  __typename, id } }"
    result = schema.execute_sync(query)

    assert not result.errors
    assert result.data == {"node": {"__typename": "Anime", "id": 1}}
    spy_is_type_of.assert_called_once()
Check that the default implemenetation of `resolve_type` functions as expected.

    In this test-case the default implementation of `resolve_type` defined in
    `GraphQLCoreConverter.from_interface`, should immediately resolve the type of the
    returned concrete object. A concrete object is defined as one that is an instance of
    the interface it implements.

    Before the default implementation of `resolve_type`, the `is_type_of` methods of all
    specializations of an interface (in this case Anime & Movie) would be called. As
    this needlessly reduces performance, this test checks if only `Anime.is_type_of` is
    called when `Query.node` returns an `Anime` object.
    
tests/schema/test_interface.py