Place the extra virgin olive oil in a pot with the peeled onion, then sauté for a couple of minutes.
Add the tomato purée, salt, and half of the basil leaves. Cover and cook over low heat for 15 to 20 minutes, or until the sauce has thickened.
Remove the onion from the sauce, then add the cubed mozzarella. Stir with a wooden spoon for a few minutes, until the mozzarella has fully melted and the sauce is smooth.
Roughly chop the remaining basil, add it to the sauce, then set the sauce aside.
Cook the Gnocchi
Cook the potato gnocchi according to the recipe instructions. Once ready, remove them with a slotted spoon.
Transfer the gnocchi to a pan with the sauce and mix well. Add 2 tablespoons of the thinly grated Parmigiano Reggiano, then stir until combined.
Grease an ovenproof dish. You can use 2 individual dishes or 1 larger dish.
Pour the gnocchi into the prepared dish, then top with the mozzarella slices and the remaining thinly grated Parmigiano Reggiano.
Broil the gnocchi for about 10 minutes, or until the cheese melts, the sauce is bubbling, and the top turns golden.