Three children were among eight killed when a school being used to house displaced people in Gaza City came under attack.