Commit 3231c413 authored by Miguel Rincon's avatar Miguel Rincon

Check for missing reference in job.only.refs

This change adds a check in case job.only is missing in the resolver,
so that axios does not fail with an exception.
parent 9c99875c
...@@ -13,23 +13,24 @@ const resolvers = { ...@@ -13,23 +13,24 @@ const resolvers = {
valid: data.valid, valid: data.valid,
errors: data.errors, errors: data.errors,
warnings: data.warnings, warnings: data.warnings,
jobs: data.jobs.map(job => ({ jobs: data.jobs.map(job => {
name: job.name, const only = job.only ? { refs: job.only.refs, __typename: 'CiLintJobOnlyPolicy' } : null;
stage: job.stage,
beforeScript: job.before_script, return {
script: job.script, name: job.name,
afterScript: job.after_script, stage: job.stage,
tagList: job.tag_list, beforeScript: job.before_script,
environment: job.environment, script: job.script,
when: job.when, afterScript: job.after_script,
allowFailure: job.allow_failure, tagList: job.tag_list,
only: { environment: job.environment,
refs: job.only.refs, when: job.when,
__typename: 'CiLintJobOnlyPolicy', allowFailure: job.allow_failure,
}, only,
except: job.except, except: job.except,
__typename: 'CiLintJob', __typename: 'CiLintJob',
})), };
}),
__typename: 'CiLintContent', __typename: 'CiLintContent',
})); }));
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment