We use the spin and valley degrees of freedom to design the bipolar and unipolar valley filter effects based on the graphene-based P/N junction. When the modified Haldane model and staggered potential are applied on the region P, while the off-resonant circularly polarized light and staggered ferromagnetic exchange field are applied on the region N, the unipolar valley filter effect emerges with the unidirectional spin–valley current. The direction and type of the unidirectional spin–valley current depend on the phase of the modified Haldane model and the direction of polarized light. Other types of the bipolar valley filter effects are also reported, such as the valley-mixed bipolar spin filter effect, valley-mixed bipolar filter effect, valley-locked bipolar spin filter effect and valley-locked bipolar filter effect. These bipolar filter effects have the similarity that the spin–valley currents flow bidirectionally. These types of the unipolar and bipolar valley filter effects can be also mutually switched by modulating the external fields. Moreover, these unipolar and bipolar valley filter effects are robust against a weak temperature. This work reveals that the graphene-based junction has the potential applications in designing the valley filter device and improving the reprogrammable spin logic.