Cut the tomatoes and 1 onion in 4, and place on a baking sheet. Sprinkle the sugar, salt, oil and basil.
Place the pan in the oven at 200°C and bake for 40 minutes.
Place the entire contents of the baking dish in a blender, and blend.
Chop 1 onion, and put it in a pan along with olive oil, and take it to the fire.
When the onion withers, add the garlic, and the contents of the blender. Lower the heat and wait for the sauce to thicken and set aside. If you like, add basil leaves.
To make the gnocchi, wash the spinach leaves, and place in a pot of boiling water for 2 minutes.
Remove the spinach from the water, and place the leaves in ice water for about 1 minute.
Remove from the ice water, and squeeze the leaves well with your hands to get the water out., And chop it comes minced.
Break up the ricotta, and mix with the chopped spinach, egg yolks, wheat flour, Parmesan, nutmeg, salt and black pepper.