Clean the mushrooms and cut them into slices. Heat the olive oil in a high pan. Finely chop the rosemary and add to the pan with the mushrooms. Fry for a few minutes until they are cooked through.
Mix the pesto, lemon juice and water in a bowl. Deglaze the mushrooms with it. Add the gnocchi and heat in the sauce until cooked through. Roughly chop the basil and stir in and season with salt and pepper.
Arrange the gnocchi and mushrooms on plates and serve with the basil leaves.