You want to use an apple that is not too sweet to counterbalance the other ingredients. It should also be able to maintain its structure after baking. I recommend tart and firm apples such as Granny Smith and Pink Lady. You can also use Golden Delicious and Honey Crisp