Place the canned 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 flavors concentrate.
Blend the sauce until smooth using a blender or immersion blender, then 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 according to package instructions until they float (about 1–2 minutes for store-bought gnocchi).
About 1–1.5 minutes before the gnocchi are done, add the baby spinach to the pot and cook until wilted; then drain both in a colander.
Transfer the drained gnocchi and wilted spinach to an ovenproof baking dish.
Stir the cream or crème fraîche through half to three-quarters of the blended tomato sauce, then add the sliced basil (or pesto) and mix well.
Pour the creamy tomato sauce over the gnocchi and spinach and fold gently to combine evenly.
Scatter slices or pieces of fior di latte (mozzarella) over the top and sprinkle with the grated Parmesan.
Bake in the preheated oven for 25–30 minutes, until the top is golden and bubbling.
Serve immediately, garnished with a few extra spinach leaves and additional Parmesan if desired.