The World Trade Organization said that the drag on global trade from the war in the Middle East was more than offset by spending on A.I.-related goods.