Combine the tinned tomatoes, quartered onion and butter in a medium saucepan and bring to a low simmer.
Simmer gently, uncovered, for about 45 minutes until reduced and flavorful.
Blend the sauce until smooth (use a blender or immersion blender) and season with salt and pepper to taste.
Preheat the oven to 180°C (350°F).
Cook the gnocchi in a large pot of salted boiling water following package instructions until they float; about 1–2 minutes.
About 1–1.5 minutes before the gnocchi are done, add the spinach to the pot and cook until wilted; then drain gnocchi and spinach in a colander.
Place the drained gnocchi and wilted spinach into an ovenproof baking dish.
Stir the cream or crème fraîche into half to three quarters of the blended tomato sauce, then add the sliced basil or 2 tbsp pesto and mix to combine.
Pour the creamy tomato sauce over the gnocchi and spinach and fold gently to coat evenly.
Top the gnocchi with slices of fior di latte and a generous sprinkle of grated Parmesan.
Bake for 25–30 minutes until the cheese is golden and the dish is bubbling.
Serve immediately with extra Parmesan if desired.