We propose an all-optical scheme of topological lasing and switching based on the Aubry-Andr\'e-Harper (AAH) model of an exciton-polariton chain. We theoretically show that the phase parameter of the optical potential, with a tunable effective quasimomentum, allows the system to exhibit nontrivial topological properties which are attributed to higher dimensions. The topological modes emerging within the bulk band gaps are spatially localized at the edges of the polariton lattice, and their topological properties are characterized by the nonzero Chern numbers of the bulk bands. Polariton lasing in topological edge modes exhibits a higher efficiency and better robustness than in bulk modes, and can be switched between two opposite edges of the lattice by nonresonant excitation, which paves a way for topologically protected optical circuits.