Onions peel and very finely dice. Heat 6 tablespoons of oil in 3 portions in a frying pan and fry the gnocchi in it, also in 3 portions, while turning them for about 4 minutes and take them out.
Heat another 2 tablespoons of oil in a frying pan, add onions to the frying fat and sauté. Deglaze with stock and vinegar, bring to the boil and simmer for 1-2 minutes. Stir in pesto. Season to taste with salt and pepper, remove from the pan and allow to cool.
Meanwhile wash and halve the tomatoes. Wash the basil, shake dry and pluck the leaves from the stalks. Clean and wash the rocket, drain well and chop the leaves as desired. Pluck the ham into small pieces. Slice parmesan.
Mix the gnocchi, tomatoes, basil, rocket and ham, fold in the vinaigrette and leave to stand for about 45 minutes. Arrange in small bowls, sprinkle with parmesan