What causes discharge just before ovulation?

Cervical mucous. The cervix is an opening to the internal body organs. It is usually tightly closed to protect against infection but opens just before ovulation to admit sperm. The cells that surround the egg as it develops produce estrogen. Estrogen stimulates growth of the uterine lining and cervical mucous. This cervical mucous is the discharge that is detected just before ovulation.
Estrogen. Estrogen is produced by the growing follicle in the ovary. Estrogen moves through the bloodstream and causes the cells of the uterine lining to grow and cervical mucus to be produced. The mucus helps sperm to find the way into the uterus from the vagina. After ovulation Progesterone is produced by the ovary that makes the mucus thicker and sperm can no longer get in.