Now apple pies come in various shapes and sizes, and not always as a pie really when you consider all the other versions of apple in a pastry, like strudel, which I grew up with, or apple turnovers, apple danishes even sweet apple dumplings.
There are literally thousands of recipes for apple pie filling. Most have a fairly consistent foundation, apples of course, sugar and some spices, usually as least cinnamon. This becomes a very versatile little combination for building upon. You can add other fruit to the mix like blueberries, strawberries, actually any berry works. Or like my mother used to, adding apricots, peaches and raisins. Pears work and even chokos (chayote) - in Australia allegedly chokos were used by McDonalds as a filler in their a famous apple pies rather than all apples (some even suggested there no actual apples in the apple pie), that said I am not sure that has ever been verified.
Nonetheless, I've played around with a variety of recipes and the following is as close as I think I can get to the ultimate apple filling for a pie or any other version of an apple filled pastry you want to have a go at. Traditional American apple pie crust was a version of a shortcrust pastry, which of course works if you want to go down that path. Puff pastry definitely works, particularly if you are making strudel or Danishes, sweet style bread dough works for pockets and even sweetened Asian bao dough works. I'll leave the apple filling pastry delivery mechanism for you to decide.
My focus here is on the filling specifically, and because I'm inherently lazy, I will usually use store bought shortcrust or puff pastry, since making these from scratch has never been a big success for me so far. But I'll keep trying.