  We show that if $(X,d,m)$ is an RCD(K,N) space and $u \in W^{1,1}_{loc}(X)$
is a solution of the minimal surface equation, then $u$ is harmonic on its
graph (which has a natural metric measure space structure). If K=0 this allows
to obtain an Harnack inequality for $u$, which in turn implies the Bernstein
property, meaning that any positive solution to the minimal surface equation
must be constant. As an application, we obtain oscillation estimates and a
Bernstein Theorem for minimal graphs in products $M \times \mathbb{R}$, where
$M$ is a smooth manifold (possibly weighted and with boundary) with
non-negative Ricci curvature
