Preheat oven to 400F.
Cook potato gnocchi according to package directions. Drain, and transfer to a large bowl.
Melt 2 tablespoons butter in a large pot or dutch oven over medium-high heat. Add ham to pot and cook until ham is browned, stirring frequently.
Use a slotted spoon to transfer ham to the bowl with gnocchi.
Wipe dutch oven clean.
Melt remaining 4 tablespoons butter in the dutch oven over medium-high heat. Add flour. Cook, whisking constantly, until the mixture is a light golden brown, about a minute.
Add milk to the flour mixture, slowly. Bring to a boil. Whisk strongly to break up any lumps.
Add salt and pepper. Lower the heat to warm. Slowly add shredded Gryere and half the Parmesan, whisking until melted.
Pour the cheese sauce over the ham and gnocchi.
Stir in the thawed peas.
Spray 11x7" baking dish with cooking spray. Transfer mixture to baking dish.
Sprinkle the remaining Parmesan cheese over the ham and gnocchi mixture.
Bake in oven until bubbly and golden brown, about 20 minutes. Serve warm and enjoy!