We show that every abstract homomorphism φ from a locally compact group L to a graph product GΓ, endowed with the discrete topology, is either continuous or φ(L) lies in a 'small' parabolic subgroup. In particular, every locally compact group topology on a graph product whose graph is not 'small' is discrete. This extends earlier work by Morris-Nickolas. We also show the following. If L is a locally compact group and if G is a discrete group which contains no infinite torsion group and no infinitely generated abelian group, then every abstract homomorphism φ:L→G is either continuous, or φ(L) is contained in the normalizer of a finite nontrivial subgroup of G. As an application we obtain results concerning the continuity of homomorphisms from locally compact groups to Artin and Coxeter groups.