That being said, general relativity predicts that there is in fact a non-linear scaling when gravitational fields are extremely strong. The reason for this is that the there is some energy associated with the gravitational field, and any energy produces its own gravitational field. So the gravitational field itself exerts its own gravitational field, leading to the non-linearity.
https://arxiv.org/pdf/astro-ph/0001272.pdf
https://arxiv.org/pdf/astro-ph/9904401.pdf
When you see figures like "1E-7 to 1E-2 M⊙ mass range" (from the above paper's introduction), note that a Jupiter mass is about 1E-3 M⊙---one thousandth or 0.1% the mass of the Sun. Earth is 3E-6 M⊙, the Moon is 3.7E-8 M⊙, and Pluto is 6.6E-9 M⊙; or 0.00037%, 0.000004%, and 0.00000066% the mass of the Sun respectively. Compared to stars, planets comprise a tiny fraction of the mass of a galaxy.
TL;DR - No, that's not how gravity works, but you can still ignore the planets in between because they're tiny.
The reason for the question, I think, is because of an intuition built up around EM. In the system
A B C
B can block and otherwise interfere with C's EM radiation so that its effect on A is different depending on B's location.
Thanks. So, in the analogy between gravity and light, you have to change all "massive bodies" to "fully transparent light sources" to make the analogy complete.
A nontransparent light source would not translate as a (straightforward) massive body.
For a static 1/r^2 field, intervening matter has very little effect at all. (There are non-linearities in principle, but for all but the most extreme configurations they're negligible in practice.) Certainly when the Newtonian approximation holds you can just add up the separate 1/r^2 effects of all the separate sources to find the overall effect. (This, by the way, is very similar to the behavior of electromagnetic fields. The waves are attenuated or blocked by intervening matter fairly easily, but it takes a pretty special situation to actually block the 1/r^2 effects of a static electric or magnetic field: you'd need to surround your system in a conducting "cage" that would polarize in response to an external electric field to cancel out the effects of that field inside, for example. That isn't possible for gravity, since there doesn't exist negative mass to do the screening.)
Ultimately, the 1/r^2 rule really is intimately connected to the three dimensions of space in our universe. In theories with additional spatial dimensions, that rule changes. Many theories with extra dimensions follow the Kaluza-Klein model, where the extra dimensions are "curled up" very small (in the sense that if you were to travel a distance L in that extra dimension, you'd come back to where you started: like a little circle). In the case of one extra dimension like that, if you were to measure the behavior of gravity over distances much shorter than L, you'd find that the gravitational force fell off like 1/r^3, but if you measured its behavior over distances much longer than L you'd find the familiar 1/r^2. (And for that reason, we know that the L for any system like this must be very small: my memory is that direct gravity measurements can set a limit like L<1mm or maybe even L<1 micron, and indirect evidence from things like particle physics observations pushes the limit down to the nuclear scale or below: L<10^(-15) m or even much less. I probably ought to know the actual values of both of those limits off the top of my head, but it's been a while since I looked at it.)