Biariatric surgery doesn't necessarily change what you eat, it mainly changes how much you eat.
The basic goal of surgery is to control the volume that you consume. You will need to make good food choice. If you are eating poor quality food, eventhough you're eating less, you can still gain weight. Surgery is a tool, not a cure. It still requires work to change your lifestyle and eating habits.