Bring a large pot of salted water to a boil. Boil the gnocchi according to package directions (typically about 2-3 minutes.) Before draining the gnocchi, be sure to reserve about 1/4 cup of the pasta water.
Melt the butter in a large non-stick pan over low heat.
Stir the pesto into the butter, then stir in the whipped ricotta (or heavy cream) until fully combined.
Stir in three tablespoons of the pasta water until the sauce is smooth and creamy, then stir in the cooked gnocchi until coated in the sauce. (If you'd like a creamier texture, add more pasta water one tablespoon at a time until it is the consistency you love!)
Stir in the parmesan and the lemon juice until fully combined. Serve immediately!
For Homemade Basil Pesto:
Spread pine nuts in a single layer in a dry skillet. Cook the nuts over medium heat for 7-8 minutes, tossing regularly until golden brown and fragrant. Set aside to cool for a few minutes.
In a mini food processor, combine basil leaves, toasted pine nuts, and smashed garlic clove. Pulse on "high" until all ingredients are minced.
Slowly drizzle in olive oil, pulsing frequently, until totally combined.
Add finely grated parmesan, salt, and lemon juice. Pulse until the cheese is just combined.
Notes
*Store-bought basil pesto works perfectly with this recipe! If you would prefer a homemade version, refer to the recipe provided.**Whip ricotta in a mini food processor for 1-2 minutes until very smooth. Alternatively, use heavy cream instead of whipped ricotta!