Pierce sweet potato skin with a fork in several places. Wet a paper towel, and place on a glass pie plate. Put sweet potato on the towel, then fold wet paper towel over top of it loosely. Place in microwave, and cook on high for 3 minutes. Turn potato over, cover again with the towel, and cook an additional 3 minutes. Test for tenderness. When potato can be easily pierced through with a fork, it is done. Cool slightly. Cut potato in half and cool a little more. Scoop out flesh into a measuring cup. Line a cookie sheet with waxed paper and sprinkle lightly with flour. Use about the same measurement of flour, starting with a little less. Work into a dough that is slightly sticky. Roll portions of the dough into about a 1"-round snake. Chop into about 1" chunks. Using well-floured fingers and board, roll each chunk into a little shell. (lots of youtube videos that show this technique). Place on cookie sheet in single layer to dry, until ready to cook. When ready to cook, boil a large pot of well-salted water. Drop gnocchi in, about a dozen at a time. When they rise to the top, cook for about 1 minute, then remove with a spider to the sauce. Keep warm.
Sauce: Heat oil in large frying pan. Saute onions until soft. Add mushrooms and cook for a few minutes. Add garlic - cook about 30 seconds. Splash in a little wine or water, and continue cooking on low. Add the tomatoes now, if using. Add salt, pepper and seasonings to your liking.
When gnocchi are ready, have pan on medium low heat. Add gnocchi to mushroom-onion mixture as they are done. Keep warm. Serve with grated Parmesan.