Boil 600g of whole starchy potatoes until tender. Drain, dry briefly in the warm pan, then cool and peel.
Warm 4 tablespoons of olive oil and 2 crushed garlic cloves in a saucepan over medium heat until the garlic sizzles. Add 600g of passata and 60ml of water, cover and simmer for 30 minutes, stirring occasionally. Season with salt and pepper.
Measure 150g of all-purpose flour. Scatter three-quarters onto a work surface and rice the potatoes over it. Add 2 egg yolks; gently mix, adding the remaining flour to form a soft dough.
On a floured surface, roll the dough into thumb-thick ropes. Cut into short pieces and press lightly against a fork to form ridges.
Preheat the oven to 400°F / 200°C. Boil the gnocchi in salted water until they float, about 3 minutes. Lift out with a slotted spoon and stir into the sauce.
Transfer to a baking dish. Top with 250g of torn mozzarella, 8 torn basil leaves and grated pecorino. Cover with foil and bake for 10 minutes; uncover and broil for 2-3 minutes, until golden.