don't add the eggs directly to the heat. remove the pan from the heat and add the eggs into the pan and stir. the residual heat from the pan/pasta will cook the eggs for you. also, adding a splash of the gnocchi/pasta water to the egg mix will help bring the eggs up to temperature so they don't get "shocked" and scramble when added to the pan.