In a large bowl, combine the cornmeal, flour, sugar, baking powder, baking soda, garlic powder, cayenne, and salt. Set aside.
In a small bowl, whisk together the grated onion, egg, and buttermilk.
Add the liquid ingredients to the dry ingredients and stir together until just combined – literally about 10 times around the bowl.
In a large Dutch oven, pour the oil until you have at least 3-inches of oil. Heat the oil over medium-high heat until it reaches 375 degrees on a deep-fat thermometer.
Drop the batter by rounded tablespoon into the hot oil. The batter will sink at first and then rise to the top. Do not overcrowd the pot. Work in batches.
Fry until golden brown, about 6 minutes.
Remove to a paper towel-lined baking dish. Keep warm in a 200-degree oven while frying the rest of the batter.