Preheat the oven to 200 ° C. Chop the garlic, drain the mozzarella and cut into pieces.
Heat the oil in a pan, heat the garlic and fry over medium heat for 30 seconds. Add the tomatoes and olives and fry for another 10 minutes, stirring occasionally. Then mix everything with the pesto, season with salt and pepper and remove from the stove.
In the meantime, cook the gnocchi in salted water until they float on top. Drain the gnocchi and add to the pan with the tomato pesto sauce. Transfer everything to a baking dish, sprinkle with mozzarella and bake for 10 minutes. Serve warm.