Pour enough water into a large pot to be a few inches deep. Set a large stainless steel bowl atop the pot to make a double-boiler. Put garlic cloves into the bowl and turn heat below double-boiler to medium; cook until the garlic is fragrant and warm, 2 to 3 minutes.
Pour wine into the bowl; cook until fragrant, 2 to 3 minutes. Remove garlic from wine and discard.
Mix Gruyere cheese, Cheddar cheese, and flour in a bowl; gradually add to the wine while stirring continually. Cook and stir the mixture until the cheese is melted and the mixture is smooth, 2 to 3 minutes.