def METHOD_NAME():
    @strawberry.type
    class A:
        a: int
    @strawberry.type
    class B:
        b: int
    with pytest.deprecated_call(
        match="Passing types to `strawberry.union` is deprecated"
    ):
        Result = strawberry.union("Result", (A, B))
    @strawberry.type
    class Query:
        ab: Result = strawberry.field(default_factory=lambda: A(a=5))
    schema = strawberry.Schema(query=Query)
    query = """{
        __type(name: "Result") {
            kind
            description
        }
        ab {
            __typename,
            ... on A {
                a
            }
        }
    }"""
    result = schema.execute_sync(query, root_value=Query())
    assert not result.errors
    assert result.data["ab"] == {"__typename": "A", "a": 5}
    assert result.data["__type"] == {"kind": "UNION", "description": None}