Assuming some geometry, here is an argument avoiding rank-one rigidity. Assuming that our graph $\Gamma$ is not a join and contains at least two vertices, we want to construct an element in the right-angled Artin group $A(\Gamma)$ whose centraliser is infinite cyclic. Saying that $\Gamma$ is not a join amounts to saying that $\Gamma^{\mathrm{opp}}$, namely the graph whose vertex-set is $V(\Gamma)$ and whose edges connect two vertices whenever they are not adjacent in $\Gamma$, is connected. Thus, we can fix a path $\gamma$ in $\Gamma^{\mathrm{opp}}$ passing through all the vertices at least once and whose endpoints are adjacent. Let $g \in A(\Gamma)$ denote the element given by the product of the generators encountered along $\gamma$, say $g=u_1 \dots u_k$. The Cayley graph $M(\Gamma)$ of $A(\Gamma)$ given by the canonical generators is a median graph$^\ast$. We will use some median geometry to prove that the centraliser of $g$ is infinite cyclic. Consider the bi-infinite path $\alpha = \bigcup_{i \in \mathbb{Z}} g^i (1,u_1,u_1u_2, \ldots, u_1 \cdots u_k)$. Observe that no two consecutive edges span a $4$-cycle (which amounts to saying that no two consecutive letters in $g^\infty$ commute), which implies that $\alpha$ is convex. In particular, this is a geodesic on which $g$ acts as a translation. In other words, it's an axis for $g$. The key point is that $\alpha$ is the unique axis of $g$. Indeed, two axes of an isometry either have the same convex hull or are separated by a hyperplane. Because $\alpha$ is convex, if there exists another axis it must be separated from $\alpha$ by some hyperplane, say $J$. And, since any two axes crosse exactly the same hyperplanes, this hyperplane must be transverse to all the hyperplanes crossing $\alpha$. However, all the edges of a hyperplane are labelled by the same generator, so the hyperplanes of $M(\Gamma)$ are naturally labelled by vertices of $\Gamma$, and any two transverse hyperplanes must be labelled by adjacent vertices. Thus, since every vertex of $\Gamma$ labels edges of $\alpha$, the vertex of $\Gamma$ labelling $J$ must be adjacent to all the vertices of $\Gamma$, which is of course impossible. We conclude that $\alpha$ is indeed the unique axis of $g$. Now, the centraliser $C(g)$ of $g$ has to preserve the union of all the axes of $g$, which is reduced to $\alpha$ here. Therefore, $C(g)$ acts freely on a line, which implies that $C(g)$ has to be infinite cyclic, as desired. In particular, we conclude that $A(\Gamma)$ cannot decompose as a product of two non-trivial groups. $^\ast$There is a natural equivalence between median graphs and CAT(0) cube complexes, since the one-skeleton of every CAT(0) cube complex is median and that the cube completion of every median graph is CAT(0). However, I milit to replace the terminology "CAT(0) cube complex" with "median graph". The reason is that nobody uses the CAT(0) geometry anymore in this context, but only the graph metric of the one-skeleton (aka the combinatorial or $\ell^1$ metric). In fact, I am not aware of a single statement that can be proved using CAT(0) geometry but that cannot be proved naturally using only median geometry.