showing results for - "clean facebook graphql response"
Alan
09 Aug 2016
1 cleanGraphQl(body) {
2        // Response contains two json objects, we want the first one only
3        const pos = body.lastIndexOf('{');
4        body = body.slice(0, pos - 1);
5
6        try {
7            return JSON.parse(body);
8        } catch (e) {
9            return {};
10        }
11    }