Preheat oven to 350 degrees and spray a 8 x 8" baking dish with nonstick cooking spray.
Peel and thinly slice potatoes using a mandoline or sharp knife
Slice onion on mandoline
Place a layer of potatoes in casserole dish
Add a layer of onions
Sprinkle with 2 tablespoons of flour and 1/4 teaspoon of salt and pepper
Top with 1 cup of ham and 1/2 cup of cheese
Add a third layer of potatoes
Mix dijon mustard with a small amount of milk in a large glass measuring cup. Slowly add remaining milk, stirring as you add. Sprinkle in dried thyme. Pour milk mixture over prepared casserole.
Add remaining 1/2 cup of cheese
Cover with foil and place casserole dish on a baking sheet
Bake in preheated oven for one hour. Remove foil and continue baking for 30-45 minutes until top is browned, mixture is bubbly and potatoes are soft
Top with fresh chopped parsley, if desired