Preheat the oven to 400˚F.
Pour about half of the olive oil in the bottom of an oven-safe baking dish. Add the tomatoes and toss until coated with oil.
Place the block of feta cheese in the center of the dish, moving the tomatoes around the sides.
Sprinkle on the minced garlic, chopped basil, red pepper flakes, salt, and pepper. Stir the tomatoes to evenly distribute the spices.
Bake for 35-40 minutes or until the tomatoes start to burst and soften and the cheese starts to brown on top.
Once the tomato/feta mixture is about halfway done, boil a pot of water and cook the gnocchi according to package directions. Make sure to reserve the pasta water before draining.
When the tomato and feta mixture is done, stir well, using your spoon to break up the tomatoes and release their juices.
Add the pasta water, spinach, and gnocchi. Stir well. Place back into the oven for 8-10 minutes, or until the dish begins to bubble.
Stir well and garnish with fresh basil if desired.