Place the flour, salt and butter in a food processor and whizz until it resembles breadcrumbs. Add 1 egg along with 1 tbsp of water and pulse again once or twice, until it is just starting to come together. Tip the dough out on to a floured surface and knead briefly until it comes together. Flatten into a disk and wrap in clingfilm. Chill for at least 30 minutes.
Preheat the oven to 200°C/gas mark 6. Roll out into a wide circle on a floured surface to around 3mm thick and transfer to a large flat baking sheet. Place the apple slices all over the pastry, leaving about a 2cm rim. Layer up the onion and shredded ham, then sprinkle over the cheddar. Bring up the edges. Beat the remaining egg and brush it all over, then leave to chill for 20 minutes until the pastry is firm.
Bake in the oven for 20-25 minutes, until golden. Leave to cool on a wire rack.