Taking melatonin while pregnant

Sbrow

Ever since my son was born 2 years ago I have not been able to sleep well. I started taking melatonin and it helped greatly. I became pregnant so I stopped taking it and haven’t been able to sleep properly since. At my first prenatal appointment I asked my midwife if I could take melatonin and she said yes but when I look it up online it says not to take while pregnant. Do any other pregnant women take melatonin or have taken it while pregnant? I just need sleep but am to scared to take it.