I'm trying to understand some principle behind deriving Feynman rules for QCD, i.e. avoid unnecessary calculations.
Setup
Assuming we have a gloun field $A_\mu^a$, fermion fields $\psi$ and ghosts $c^a$, consider the action $$\begin{aligned} S=&\int d^4x\Big[-\frac{1}{4}\left(F_{\mu \nu}^{a}\right)^{2}-\frac{1}{2 \xi}\left(\partial_{\mu} A_{\mu}^{a}\right)^{2}+\left(\partial_{\mu} \bar{c}^{a}\right)\left(\delta^{a c} \partial_{\mu}+g f^{a b c} A_{\mu}^{b}\right) c^{c} \\ &+\bar{\psi}_{i}\left(\delta_{i j} i \partial_\mu\gamma^\mu+g A^{a} T_{i j}^{a}-m \delta_{i j}\right) \psi_{j}\Big], \end{aligned}$$ where $T^a$ are elements of $su(N)$. This action can be split into a free and interaction part. The interaction part takes the form $$\begin{aligned} S_{\mathrm{int}}&=\int d^4x \Big[-g f^{a b c}\left(\partial_{\mu} A_{\nu}^{a}\right) A_{\mu}^{b} A_{\nu}^{c}-\frac{1}{4} g^{2}\left(f^{e a b} A_{\mu}^{a} A_{\nu}^{b}\right)\left(f^{e c d} A_{\mu}^{c} A_{\nu}^{d}\right)\\&+g f^{a b c}\left(\partial_{\mu} \bar{c}^{a}\right) A_{\mu}^{b} c^{c} +g A_{\mu}^{a} \bar{\psi}_{i} \gamma^{\mu} T_{i j}^{a} \psi_{j}\Big]\\ &=:S_{AAA} + S_{AAAA} +S_{Ac}+S_{A\bar\psi\psi}. \end{aligned}$$ The generating functional is then defined as $$W[J_\mu^a, \eta_i,\bar\eta_i,\xi^a,\bar\xi^a]= \exp\left(iS_{\mathrm{int}}\left[\frac{\delta}{i\delta J_\mu^a}, -\frac{\delta}{i\delta \eta_i},\dots\right]\right)W_0[J_\mu^a, \eta_i,\bar\eta_i,\xi^a,\bar\xi^a],\tag{1}$$ where we have introduced source functions for the different fields ($A^a_\mu \leftrightarrow J^a_\mu$, $\psi_i \leftrightarrow \bar\eta_i$ and $c^a \leftrightarrow \bar\xi^a$).
The three-gluon vertex is then given by $$\left\langle 0\left|A_{\mu}^{a}\left(x_{1}\right) A_{\nu}^{b}\left(x_{2}\right) A_{\rho}^{c}\left(x_{3}\right)\right| 0\right\rangle=\left.\frac{\delta}{i \delta J_{\mu}^{a}\left(x_{1}\right)} \frac{\delta}{i \delta J_{\nu}^{b}\left(x_{2}\right)} \frac{\delta}{i \delta J_{\rho}^{c}\left(x_{3}\right)} W\left[J_{\mu}^{a},\dots\right]\right|_{J=0}.\tag{2}$$ To calculate $(2)$ I think one would expand the exponential in $(1)$ and then apply all the operators in $S_{\mathrm{int}}$ to $W_0$, i.e. we calculate explicitly $iS_{\mathrm{int}}W_0$. Then we apply the three functional derivatives of $(2)$ and we are done.
Question
My question is about computing $iS_{\mathrm{int}}W_0$. Do we really need to compute the whole $$iS_{\mathrm{int}}W_0 = iS_{AAA}W_0 + iS_{AAAA}W_0 +iS_{Ac}W_0+iS_{A\bar\psi\psi}W_0$$ if I'm only interested in the three-gluon vertex? It seems that calculating $iS_{AAA}W_0$ should be enough, i.e. the other terms don't contribute anything. The thing is, I don't know if this is true, and if it is, what the general principle behind this is. If I'm interested in the four-gluon vertex, do I just need $iS_{AAAA}W_0$, etc?