Expression for Gibb's free energy change for a cell reaction
According to Nernst's equation,
$$E = E^o - \frac{RT}{nF}\ln Q$$
As you can see, $E$ is independent of $q$, therefore your proposed integral becomes,
$$\Delta G = - \int_{q_i}^{q_f}{E\cdot dq} = -E\int_{q_i}^{q_f}{dq} = -E\Delta q = -nFE$$

Alternatively, you can prove the the relation between Gibbs energy and cell potential as,

Multiply Nernst's equation by $nF$, we get,

$$nFE = nFE^o - RT\ln Q$$

Swapping the sides, we get,

$$-nFE = -nFE^o + RT\ln Q$$

As we know,

$$\Delta G = \Delta G^o + RT\ln Q$$
$$\Rightarrow \Delta G = -nFE$$