Preheat the oven to 325°F. Grease a 9-inch springform pan.
In a medium bowl, combine the graham cracker crumbs, melted butter, and granulated sugar. Press the mixture firmly into the bottom of the prepared pan to form the crust. Bake for 10 minutes, then remove from the oven and let cool.
In a large mixing bowl, beat the softened cream cheese with an electric mixer until smooth. Gradually add the powdered sugar and vanilla extract, mixing until well combined. Add the sour cream and mix until smooth.
Add the eggs one at a time, mixing on low speed until just combined. Do not overmix.
In a separate bowl, toss the diced apples with cinnamon and nutmeg. Gently fold the apple mixture into the cream cheese batter.
Pour half of the cheesecake batter over the cooled crust in the springform pan. Drizzle half of the caramel sauce over the batter, then pour the remaining cheesecake batter on top. Swirl the remaining caramel sauce into the batter using a knife or toothpick.
Sprinkle the chopped pecans on top if using. Bake for 50-60 minutes, or until the center is set but still slightly jiggly.
Turn off the oven and leave the cheesecake in the oven for an additional hour.
Remove the cheesecake from the oven and let it cool to room temperature. Once cooled, refrigerate for at least 4 hours or overnight before serving.