01 - Bring a large pot of salted water to a boil over high heat.
02 - Combine basil, garlic, pine nuts, and Parmesan in a food processor. Pulse until coarsely chopped. With the motor running, slowly stream in the olive oil until a smooth, creamy sauce forms. Season with salt, pepper, and lemon juice if using. Set aside.
03 - Add gnocchi to the boiling water and cook according to package instructions, typically 2–3 minutes until they float to the surface.
04 - Drain the gnocchi in a colander, reserving about 1/4 cup of the cooking water.
05 - Transfer hot gnocchi to a large bowl. Add the pesto and toss gently to coat, adding a splash of reserved cooking water if needed to achieve a silky consistency.
06 - Plate immediately, topped with extra grated Parmesan, fresh basil leaves, and additional pine nuts if desired.