Bring a large pot of salted water to a boil. Add the gnocchi and cook according to package instructions, usually for 2-3 minutes until they float to the top. Drain and set aside.
In the same pot, heat the olive oil over medium heat. Add the minced garlic and sauté for about 1 minute until fragrant.
Add the chopped spinach to the pot and cook until wilted, approximately 2-3 minutes.
Pour in the heavy cream and pesto, stirring well to combine. Allow the mixture to simmer for 2-3 minutes until it starts to thicken.
Stir in the grated Parmesan cheese until melted and smooth. Season with salt and pepper to taste.
Gently fold in the cooked gnocchi, ensuring they are well coated in the creamy pesto sauce. Cook for an additional 2 minutes to heat through.
Remove from heat and serve immediately, garnished with fresh basil leaves and extra Parmesan cheese if desired.
Notes
Serve immediately for the best flavor and texture.