The first Gospels may have been written 40 or more years after Christ - how could they get the facts?

Some of the writers probably were eyewitnesses. Even if not, Pope Clement I, in his letter to Corinth of c 95 AD says Peter & Paul were of his own generation. They probably died c 67. So he must have heard them. Also we have Ignatius of Antioch who came from the see where Peter had worked not long before; and Quadratus, saying some in his day were still alive who had been cured by Christ or raised by Him. Even if not in 123, this covers easily 80-90 AD when many say Mt. & Lk were written.