Gravity does affect things with no mass in general relativity. it does so by curving spacetime, which affects anything, whether it has a mass or not.
Also, the converse is true. Anything with energy produces gravity, whether it has mass or not.
Also, the converse is true. Anything with energy produces gravity, whether it has mass or not.