Preheat oven to 350° Fahrenheit. In a small saucepan, heat shallots, apple juice (or chicken stock), thyme and a pinch of salt and pepper. Butter a 12-cup baking dish and rub with cut garlic. Place the sliced potatoes and sweet potatoes into the baking dish in layers, seasoning lightly with salt and pepper. When all the potatoes are used, pour the apple juice (or chicken stock) and shallots over the potatoes and top with grated cheese. Bake covered for 1 hour. Uncover and bake for an additional 20 minutes until nicely browned.