Skip to content
Snippets Groups Projects
Commit 9675bd6d authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(github): graphql parsing

parent d907bd4b
No related branches found
No related tags found
No related merge requests found
...@@ -80,13 +80,15 @@ async function get(path, options, retries = 5) { ...@@ -80,13 +80,15 @@ async function get(path, options, retries = 5) {
} }
// istanbul ignore if // istanbul ignore if
if (method === 'POST' && path === 'graphql') { if (method === 'POST' && path === 'graphql') {
if (res.errors && retries > 0) { const goodResult = '{"data":{';
if (res.body.startsWith(goodResult)) {
if (retries === 0) {
logger.info('Recovered graphql query');
}
} else if (retries > 0) {
logger.info('Retrying graphql query'); logger.info('Retrying graphql query');
return get(path, opts, 0); return get(path, opts, 0);
} }
if (res.data && retries === 0) {
logger.info('Recovered graphql query');
}
} }
return res; return res;
} catch (err) { } catch (err) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment