If a baby's eye discharge occurs alongside symptoms of an infection, it is important to contact a doctor. It may be an eye infection if the baby also experiences swollen eyelids. green or yellow discharge, or puffy eyes.