Slice the squash and sweet potatoes in similar sized slices. Layer in a Gratin dish that has been coated with cooking spray. Set aside.
In a medium fry pan melt the butter over medium heat. Add the sliced onions and cook stirring occasionally until the onions soften and just begin to brown.
Add the dried cranberries and the herb leaves and cook for 2 – 3 minutes. Stir in the Wondra flour and continue stirring and cooking for another 2 minutes. Do not let the roux brown.
Stir the milk in slowly and continue to stir until it is smoothly incorporated. Continue cooking, stirring frequently until the sauce has thickened. Remove from the heat.
Immediately add 3/4 cup of the grated cheese and stir until the cheese melts and the sauce is smooth. Pour over the squash and potatoes, spreading to evenly cover the top.
Cover with foil and bake in a pre-heated 350 degree oven for 35 minutes or so. Check that the potatoes and squash are tender.
Sprinkle the remaining cheese evenly over the top and return to the oven uncovered. Bake another 10 minutes or so. The top should be golden brown and the sauce should be bubbling.
Remove from the oven and allow to rest for at least 5 minutes before serving.