Answers for "clean facebook graphql response"

0

clean facebook graphql response

cleanGraphQl(body) {
        // Response contains two json objects, we want the first one only
        const pos = body.lastIndexOf('{');
        body = body.slice(0, pos - 1);

        try {
            return JSON.parse(body);
        } catch (e) {
            return {};
        }
    }
Posted by: Guest on June-10-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language