Commit 3a957b1d authored by Sarah Groff Hennigh-Palermo's avatar Sarah Groff Hennigh-Palermo

Merge branch 'change-lint-query-to-use-connections' into 'master'

Update lint query with connections

See merge request gitlab-org/gitlab!49983
parents 5abcf4c6 21b5902d
#import "~/pipelines/graphql/queries/pipeline_stages.fragment.graphql"
#import "~/pipelines/graphql/queries/pipeline_stages_connection.fragment.graphql"
query getCiConfigData($content: String!) {
ciConfig(content: $content) {
errors
status
stages {
...PipelineStagesData
...PipelineStagesConnection
}
}
}
......@@ -10,6 +10,7 @@ import TextEditor from './components/text_editor.vue';
import commitCiFileMutation from './graphql/mutations/commit_ci_file.mutation.graphql';
import getBlobContent from './graphql/queries/blob_content.graphql';
import getCiConfigData from './graphql/queries/ci_config.graphql';
import { unwrapStagesWithNeeds } from '~/pipelines/components/unwrapping_utils';
const MR_SOURCE_BRANCH = 'merge_request[source_branch]';
const MR_TARGET_BRANCH = 'merge_request[target_branch]';
......@@ -99,7 +100,11 @@ export default {
};
},
update(data) {
return data?.ciConfig ?? {};
const { ciConfigData } = data || {};
const stageNodes = ciConfigData?.stages?.nodes || [];
const stages = unwrapStagesWithNeeds(stageNodes);
return { ...ciConfigData, stages };
},
error() {
this.reportFailure(LOAD_FAILURE_UNKNOWN);
......
fragment PipelineStagesData on CiConfigStage {
name
groups {
name
jobs {
name
needs {
name
}
}
}
}
fragment PipelineStagesConnection on CiConfigStageConnection {
nodes {
name
groups {
nodes {
name
jobs {
nodes {
name
needs {
nodes {
name
}
}
}
}
}
}
}
}
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