China's foreign trade unexpectedly shrank in October, the first drop since May 2020, as COVID-19 curbs, record-high inflation, and rise in interest rates have adversely affected global consumption.