While major surgeries like gastric bypass can affect your immune system and increase your risk for infections, research is mixed about how the surgery might alter your immune system in the long term and cause autoimmune disorders.