Heat olive oil in a large skillet over medium heat. Add the gnocchi and cook until lightly golden and slightly crispy on the outside. This step adds texture and enhances the overall flavor of the dish.
Stir in the minced garlic and cook for about a minute. I always make sure not to burn it, as garlic can turn bitter quickly. The aroma at this stage is already amazing.
Lower the heat slightly and add the heavy cream. Let it gently simmer for a few minutes until it starts to thicken. This forms the rich base of the sauce.
Add the pesto and stir well until fully combined with the cream. The sauce will turn a beautiful green color and become fragrant with basil and herbs.
Stir in the freshly grated parmesan cheese. Season with salt and pepper to taste. The cheese melts into the sauce, making it even creamier.
If using spinach or tomatoes, toss them in now. Cook for another minute or two until the spinach wilts or the tomatoes soften slightly.
Remove from heat and serve warm. The sauce thickens as it sits, so I like to enjoy it fresh off the stove for the best texture.