Bring a large pot of salted water to a rolling boil and keep it at a boil for cooking the gnocchi.
Heat a large high-sided skillet over medium heat, add the olive oil and diced onion, season with kosher salt, and cook 4–5 minutes until the onion is 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 the flour over the mixture and cook, stirring, for 1 minute to form a roux.
Slowly pour in the whole milk while whisking or stirring constantly 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 sauce from heat, stir in the ground nutmeg, and adjust seasoning with salt and pepper to taste.
Add the dried gnocchi to the boiling water and cook according to package instructions (about 3 minutes) until they rise to the surface.
While the gnocchi cook, stir the grated Parmesan, fresh spinach, and lemon juice into the cream sauce; the spinach will wilt partially from the heat.
Scoop the cooked gnocchi from the pot with a spider strainer or slotted spoon and add them to the skillet with the spinach cream sauce; toss gently to combine and serve.