Sauté the sliced onion with olive oil until softened and slightly translucent.
Spread the onions into the bottom of a shallow baking dish and place the salmon fillets on top. Season to taste with salt and pepper and rub the tops with mayonnaise.
Layer on thinly sliced mushrooms, followed by a layer of grated cheese. Cover the baking dish with foil and bake at 350°F for 40 minutes.
Serve immediately while the cheese is still melty and enjoy!