No, you don't need to cook the apples before adding them to the pie. Combining the apple slices with sugar and flour plus baking at high heat will ensure that the final filling is thick. The flour absorbs the liquid and acts as a thickener.