Bring a large pot of salted water to a rolling boil over medium-high heat.
Heat a large high-sided skillet over medium heat, then add the olive oil and diced onion; season with a pinch of salt and cook 4–5 minutes until soft and beginning to brown.
Add the minced garlic and dried thyme to the skillet and cook for 1 minute until fragrant.
Add the butter and stir until melted, then sprinkle in the flour and cook, stirring, for about 1 minute to form a roux.
Slowly pour in the milk while whisking to smooth any lumps, then bring the sauce to a gentle bubble and cook about 5 minutes until it coats the back of a spoon.
Remove the pan from the heat, stir in the ground nutmeg, and season the sauce with salt and pepper to taste.
Meanwhile, add the gnocchi to the boiling water and cook according to package directions, usually about 3 minutes, until they float to the surface.
While the gnocchi cook, stir the grated Parmesan, fresh spinach, and lemon juice into the cream sauce; the spinach will wilt from the sauce's heat.
Scoop the cooked gnocchi from the pot with a spider strainer or slotted spoon and add them to the skillet with the sauce.
Toss gently to combine, adding a splash (about 1/4–1/2 cup) of the hot starchy gnocchi water if the sauce needs thinning, then serve immediately with extra Parmesan if desired.