Add the drained pasta to the onion and mushroom mixture, stirring to combine. If the sauce is too thick, add a bit of the reserved pasta water to reach the desired consistency.
Remove the pan from the heat and sprinkle the shredded gruyere cheese over the pasta. Cover the pan with a lid for a minute to allow the cheese to melt.