In this paper, with any weakly factorial domain R that admits at least two maximal ideals, we associate an undirected graph denoted by \(\mathbb {MGP}(R)\) with vertex set \(\mathcal{S}\mathcal{Q}(R) = \{Rq\mid q\in \mathcal {P}(R)\backslash J(R)\}\) , where \(\mathcal {P}(R)\) is the set of all primary elements of R, J(R) is the Jacobson radical of R, and distinct vertices \(Rq_{1}\) and \(Rq_{2}\) are adjacent if and only if \(Rq_{1} +Rq_{2}\subseteq \mathfrak {m}\) for some maximal ideal \(\mathfrak {m}\) of R. We call \(\mathbb {MGP}(R)\) the maximal graph of R. This paper aims to study the interplay between the graph-theortic properties of \(\mathbb {MGP}(R)\) and the ring-theoretic properties of R. Some necessary (resp., sufficient) conditions on the set of all maximal ideals of R are provided such that \(\mathbb {MGP}(R)\) is connected. In some cases, a necessary and sufficient condition is determined such that \(\mathbb {MGP}(R)\) is connected. We provide several examples of weakly factorial domains R such that \(\mathbb {MGP}(R)\) is connected. We also discuss some results on a subgraph of \(\mathbb {MGP}(R)\) denoted by \(\mathbb {SGMGP}(R)\) with vertex set \(\mathcal{S}\mathcal{Q}(R)\) and distinct vertices \(Rq_{1}\) and \(Rq_{2}\) are adjacent if and only if \(Rq_{1}\cap Rq_{2}\ne Rq_{1}q_{2}\) .