Preheat the oven to 350°F.
Grease a small casserole dish and layer half of the potato, yam and apple slices in the casserole, adding three potato slices for every two yam and one apple. Put the remaining slices and the casserole dish aside.
Heat a quarter-sized amount of olive oil in a large, deep skillet until shimmering. Add the onion, the garlic an a large pinch of salt. Saute until the onion is translucent and the garlic is fragrant, about 5-7 minutes. Transfer the onion and garlic from the pan to a bowl and set aside.
Add half of the wine to the hot skillet and deglaze the pan. Toss in the butter and let it melt. Once the butter is frothy, whisk in the flour to form a roux. Cook the roux until it assumes a warm caramel color and gives off a nutty aroma. Slowly add the remaining wine and half and half, whisking constantly. Bring the cream mixture up to a gentle boil and add 3/4 cup of gouda and 1/4 cup of cheddar to the skillet. Reduce the heat to a simmer and stir to melt the cheese. Once the cheese has melted, stir in the salt and the Dijon mustard. Remove the skillet from the heat and stir in the fresh thyme.
Pour half of the gouda sauce over top of the potato, yam, and apple layer you laid out earlier. Use the back of a spoon to ensure the sauce is evenly dispersed. Place the remaining potato, yam and apple slices on top of the sauce and pour the other half of the sauce over top. Sprinkle a mixture of the remaining cheeses over top of the gratin and pop it in the oven. Bake the gratin uncovered for 1 hour or until the potatoes are tender and the cheese is golden. Remove the gratin from the oven and let sit for 10 minutes before serving.