Start by washing the squash thoroughly and slicing it into thin, even rounds. I like keeping the skin on because it becomes tender when baked. Removing seeds is important to ensure a smooth texture in every bite.
In a mixing bowl, combine heavy cream, milk, minced garlic, salt, pepper, and nutmeg. Stir everything well so the flavors blend nicely. This mixture is what gives the gratin its creamy and rich consistency.
Grease your baking dish with butter, then start layering squash slices evenly. Sprinkle some Gruyère cheese and thyme between each layer. Repeat until all ingredients are used, finishing with a generous cheese layer on top.
Cover the dish with foil and bake in a preheated oven at 375°F (190°C) for about 30 minutes. Then remove the foil and bake for another 10–15 minutes. This helps the top turn golden and bubbly.
Once baked, let the gratin rest for 5–10 minutes before serving. This allows the layers to set properly. I find that this step really improves the texture and makes it easier to serve.