def test_private_field_with_str_annotations():
    """Check compatibility of strawberry.Private with annotations as string."""
    schema = strawberry.Schema(query=Query)

    result = schema.execute_sync(
        "query { accessibleInfo }",
        root_value=Query(not_seen=SensitiveData(1, "foo")),
    )
    assert result.data == {"accessibleInfo": "foo"}

    # Check if querying `notSeen` raises error and no data is returned
    assert "notSeen" not in str(schema)
    failed_result = schema.execute_sync(
        "query { notSeen }", root_value=Query(not_seen=SensitiveData(1, "foo"))
    )
    assert failed_result.data is None
Check compatibility of strawberry.Private with annotations as string.
tests/schema/test_private_field.py