The United Nations General Assembly has called for a "humanitarian truce" between Hamas and Israel in a non-binding resolution.