We examine theoretically the superconducting state of BaFe$_2$(As$_{1-x}$P$_x$)$_2$, an isovalent doping 122 iron pnictide superconductor. We construct a three dimensional ten orbital model from first principles band calculation, and investigate the superconducting gap within the spin fluctuation mediated pairing mechanism. The gap is basically $spm$, where the gap changes its sign between electron and hole Fermi surfaces, but three dimensional nodal structures appear in the largely warped hole Fermi surface having strong $Z^2/XZ/YZ$ orbital character. The present result, together with our previous study on 1111 systems, explains the strong material dependence of the superconducting gap in the iron pnictides.