Bring a large pot of salted water to boil. This will be for cooking the gnocchi, which will be added to the sauce immediately after. While waiting for the water to boil, move on to the sauce preparation.
Melt the butter in a large skillet over medium heat. Add the diced shallot and sauté for about 3 minutes until softened. Keep it moving with a spatula.
Add the minced garlic to the shallots and continue to sauté for another minute or so, until the garlic is fragrant.
Whisk heavy cream into the skillet in a steady stream, then spoon in the mascarpone and stir until smooth.
Add salt and pepper, then reduce the temperature to low and simmer the sauce for 2-3 minutes more.
Remove from the heat and add your gruyere and parmesan cheeses, whisking until they are fully melted and incorporated. Taste test and adjust the salt and pepper, as needed.
Add gnocchi to the boiling water and cook until the gnocchi floats to the top (or according to the package directions).
With a slotted spoon, transfer the cooked gnocchi to the sauce. Stir to combine, coating the gnocchi fully.
Garnish with more grated parmesan and black pepper, and serve immediately.
