Warm the olive oil in a large pot over medium heat. Add the onion, carrots, and celery. Cook for about 5 minutes, stirring occasionally, until softened.
Add the garlic and cook for 1 more minute, stirring until fragrant.
Stir in the thyme and basil. Pour in the chicken broth and bring the mixture to a boil.
Reduce the heat to a simmer. Add the shredded chicken and gnocchi. Cook for 5 to 7 minutes, or until the gnocchi float and turn tender.
Stir in the spinach and heavy cream. Let the soup cook for 2 to 3 more minutes. Season with salt and black pepper to taste.
Serve warm with grated Parmesan cheese on top, if desired.