Expression for Gibb's free energy change for a cell reaction According to Chemistry Libretexts, the Gibbs free energy change of a cell reaction is related to the cell voltage as
$$ \Delta G = -nFE,$$
where $n$ is the number of moles of electrons passed and $F$ is the charge on a mole of electrons.
But $E$ decreases in value through the course of the cell reaction, so  shouldn't
$$\Delta G = -\int_{q_\mathrm{i}}^{q_\mathrm{f}} E\,\mathrm dq,$$
where $q_\mathrm{f} - q_\mathrm{i} = nF?$
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$$