Bring the salted water to a boil and then add gnocchi. Cook gnocchi, stirring gently until tender, about 1 minute after they rise to the surface of the pot.
Meanwhile, in a large, deep skillet, bring the stock and butter to a boil over medium heat. Add the beans and pesto and season with salt and pepper to taste. Bring to a boil and remove from the heat.
Remove gnocchi from the water and add to the skillet. Heat through until coated with the sauce. Remove from heat and stir in the cheese. Serve immediately.
Wash the herb leaves in cool water and dry them thoroughly, preferably in a salad spinner. Combine the herbs and garlic in a blender and blend on low speed, slowly adding the oil while the machine is running, until the pesto is smooth and all the oil is incorporated. Add salt to taste.
Keep in a sealed jar in the refrigerator and use as needed. Pesto will keep for up to 4 weeks or it may be frozen for up to 3 months.