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 = {
valid: data.valid,
errors: data.errors,
warnings: data.warnings,
jobs: data.jobs.map(job => ({
name: job.name,
stage: job.stage,
beforeScript: job.before_script,
script: job.script,
afterScript: job.after_script,
tagList: job.tag_list,
environment: job.environment,
when: job.when,
allowFailure: job.allow_failure,
only: {
refs: job.only.refs,
__typename: 'CiLintJobOnlyPolicy',
},
except: job.except,
__typename: 'CiLintJob',
})),
jobs: data.jobs.map(job => {
const only = job.only ? { refs: job.only.refs, __typename: 'CiLintJobOnlyPolicy' } : null;
return {
name: job.name,
stage: job.stage,
beforeScript: job.before_script,
script: job.script,
afterScript: job.after_script,
tagList: job.tag_list,
environment: job.environment,
when: job.when,
allowFailure: job.allow_failure,
only,
except: job.except,
__typename: 'CiLintJob',
};
}),
__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