Heat 1 tablespoon oil in a large nonstick skillet over medium heat. Add gnocchi and cook, stirring often, until plumped and starting to brown, 5 to 7 minutes. Transfer to a bowl.
Add the remaining 1 teaspoon oil and onion to the pan and cook, stirring, over medium heat, for 2 minutes. Stir in garlic and water. Cover and cook until the onion is soft, 4 to 6 minutes. Add chard (or spinach) and cook, stirring, until starting to wilt, 1 to 2 minutes.
Stir in tomatoes, beans and pepper and bring to a simmer. Stir in the gnocchi and sprinkle with mozzarella and Parmesan. Cover and cook until the cheese is melted and the sauce is bubbling, about 3 minutes.