Beijing says the economy grew by 5.2% in the three months to the end of June, compared to the same time last year.