Heat the olive oil in a large skillet over medium heat. Add the diced onion and sauté for about 3-4 minutes until it becomes translucent.
Stir in the minced garlic and cook for another 1 minute, being careful not to let it burn.
Add the diced tomatoes (with juice), vegetable broth, dried oregano, red pepper flakes (if using), salt, and black pepper. Bring the mixture to a simmer.
Once simmering, add the gnocchi to the skillet. Stir gently to ensure the gnocchi are submerged in the liquid.
Cover the skillet and let it cook for about 5-7 minutes, stirring occasionally, until the gnocchi are tender and cooked through.
Reduce the heat to low and stir in the fresh spinach and heavy cream. Allow the spinach to wilt, which should take about 2-3 minutes.
Add the grated Parmesan cheese and mix well until the cheese is melted and well incorporated. Adjust seasoning with additional salt and pepper if needed.
Remove from heat, garnish with fresh basil leaves, and serve hot.
Notes
Feel free to adjust the spice level by adding more or less red pepper flakes.