Fill a large pot with water.
Add salt and bring to boil.
Drop green beans into boiling water.
Cook for exactly 5 minutes.
They should be bright green.
Drain beans in a colander immediately.
Run cold water over them.
This stops the cooking process.
Pat the beans dry with towels.
Melt butter in a large pan.
Add sliced mushrooms to the butter.
Cook for about 5 minutes.
The mushrooms should turn golden brown.
Add minced garlic and cook briefly.
Sprinkle flour over the mushroom mixture.
Stir everything together for 2 minutes.
This creates a roux base.
Pour half-and-half into the pan slowly.
Whisk constantly to avoid lumps.
The sauce will start to thicken.
Add salt, pepper, and nutmeg now.
Keep stirring for 3-4 minutes.
The sauce should coat your spoon.
Remove from heat when it's creamy.
Preheat your oven to 375°F.
Place green beans in baking dish.
Pour the mushroom sauce over beans.
Sprinkle Gruyere cheese on top evenly.
Add half the fried onions now.
Bake for 20 minutes uncovered.
Add remaining onions on top.
Bake 10 more minutes until bubbly.