Cut the pastry into 2 pieces, then roll each into a rectangle slightly larger than A4.
Fill a saucepan with boiling water and add the stock cube. Cut the potatoes into 5mm discs and boil for 3 to 4 minutes, then drain and allow to steam dry.
Line a baking tray with greaseproof paper and lay one pastry rectangle on top.
Arrange half the potatoes in an even layer over the pastry, leaving a 2cm gap around the edges, and season.
Finely slice the apples into discs, then layer half over the potatoes.
Peel, finely slice and scatter over half the shallot, grate over half the cheese and pick over half the thyme leaves.
Repeat with another layer of potatoes, seasoning, apples, shallot, cheese and thyme.
Beat the egg and brush the edges of the pastry with a little egg, then lay the second pastry rectangle on top, carefully stretching and moulding it over the filling. Press the edges together with your fingers or a fork.
Score the top of the pie, brush the pastry with egg then bake for about 30 to 40 minutes, or until golden and puffed up.
Cut the pie into wedges and serve with chutney and salad leaves.