We show that the fundamental groups of any two closed irreducible nongeometric graph manifolds are quasi-isometric. We also classify the quasi-isometry types of fundamental groups of graph manifolds with boundary in terms of certain finite two-colored graphs. A corollary is the quasi-isometric classification of Artin groups whose presentation graphs are trees. In particular, any two right-angled Artin groups whose presentation graphs are trees of diameter greater than $2$ are quasi-isometric; further, this quasi-isometry class does not include any other right-angled Artin groups