Combine flour, egg, garlic powder, cayenne, and salt.
Gradually add beer, stirring, until a thick batter forms.
In a heavy frying pan, heat oil (adjust amount, depending on the size of your pan, so that you have a couple of inches of oil) over medium-high heat. (you can also deep fry, 350 degrees! Just don’t use the basket they will stick!)
When oil is hot, dip onions in batter and fry, turning once to brown evenly on both sides.