def test_extension_execution_order_sync():
    """Ensure mixed hooks (async & sync) are called correctly."""
    execution_order: list[type[SchemaExtension]] = []

    class ExtensionB(SchemaExtension):
        def on_execute(self):
            execution_order.append(type(self))
            yield
            execution_order.append(type(self))

    class ExtensionC(SchemaExtension):
        def on_execute(self):
            execution_order.append(type(self))
            yield
            execution_order.append(type(self))

    @strawberry.type
    class Query:
        food: str = "strawberry"

    extensions = [ExtensionB, ExtensionC]
    schema = strawberry.Schema(query=Query, extensions=extensions)

    query = """
        query TestQuery {
            food
        }
    """

    result = schema.execute_sync(query, root_value=Query())

    assert not result.errors
    assert result.data == {"food": "strawberry"}
    assert execution_order == [ExtensionB, ExtensionC, ExtensionC, ExtensionB]
Ensure mixed hooks (async & sync) are called correctly.
tests/schema/extensions/schema_extensions/test_extensions.py