The country narrowly avoids recession as it struggles with trade conflicts around the world.