1 1/2 lb fresh New Mexico green chiles (about 5)
1 lb onions, cut lengthwise into 1/4-inch strips
1 tablespoon vegetable oil
3 lb large Yukon Gold potatoes
1 1/2 cups heavy cream
3/4 cup whole milk
ROAST CHILES AND MAKE RAJAS:
Roast chiles on their sides on racks of gas burners (or see cooks’ note, below) on high, turning with tongs, until skins are blackened all over, about 10 minutes. Immediately transfer to a bowl and let stand, covered tightly, 10 minutes.
When chiles are cool enough to handle, peel or rub off skin. Slit chiles lengthwise, then stem, seed, and devein. Cut lengthwise into thin strips.
Cook onions with 1 tsp salt in oil in a 12-inch heavy skillet over medium-low heat, stirring occasionally, until golden, about 8 minutes. Stir in chiles and remove rajas from heat. Reserve 1/2 cup rajas for topping.
Preheat oven to 400°F with rack in middle. Generously butter a 3-qt shallow baking dish.
Peel potatoes, then cut crosswise into 1/16-inch-thick slices with slicer. Transfer to a small heavy pot. Add cream, milk, and 1 tsp salt and bring just to a boil over medium heat, stirring occasionally (liquid will thicken). Stir in rajas, then pour mixture evenly into baking dish. Sprinkle reserved 1/2 cup rajas on top.
Bake until potatoes are tender, 45 minutes to 1 hour. Let stand 15 minutes before serving.