Preheat your oven to 350°F (175°C) and grease a loaf pan.
In a large bowl, whisk together flour, baking soda, baking powder, salt, and cinnamon.
In another bowl, mix sugars and vegetable oil until well combined.
Add eggs to the sugar mixture, beating well after each addition.
Gradually stir the dry ingredients into the wet mixture until just combined.
Fold in the diced apples and walnuts if using.
Pour the batter into the prepared loaf pan.
Bake for 50-60 minutes, or until a toothpick inserted comes out clean.
Allow to cool in the pan for 10 minutes before transferring to a wire rack.
Slice and serve warm or at room temperature.