Bring a large pot of salted water to a rolling boil and keep it at a boil for cooking the gnocchi later.
Heat a large high-sided skillet over medium heat and 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 about 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 milk while whisking or stirring constantly to dissolve any lumps; continue to cook until the sauce bubbles and thickens enough to coat the back of a spoon, about 4–5 minutes.
Remove the sauce from the heat, stir in the ground nutmeg, and season with salt and freshly ground black pepper to taste.
When the water is boiling, add the dried gnocchi 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 warm cream sauce until the spinach begins to wilt and the cheese melts.
Use a spider strainer or slotted spoon to transfer the cooked gnocchi to the skillet with the sauce, then toss gently to combine and serve immediately.