Two quries with some common objects causing infinite api calls

I can see this topic was opened with the same issue, i tired everything from the docs, but I didn’t find any solution. Any luck if anyone founds solution for this?