Skip to content
代码片段 群组 项目
提交 6ba92236 编辑于 作者: Vitaly Slobodin's avatar Vitaly Slobodin
浏览文件

Merge branch '343999-fix-codebase-to-ensure-the-uniqueness-of-graphql-fragment-names' into 'master'

Fix codebase to ensure the uniqueness of GraphQL fragment names

See merge request gitlab-org/gitlab!85383
No related branches found
No related tags found
无相关合并请求
显示
29 个添加29 个删除
...@@ -99,7 +99,7 @@ rules: ...@@ -99,7 +99,7 @@ rules:
message: 'Migrate to GlSkeletonLoader, or import GlDeprecatedSkeletonLoading.' message: 'Migrate to GlSkeletonLoader, or import GlDeprecatedSkeletonLoading.'
overrides: overrides:
- files: - files:
- '{,ee/,jh/}spec/frontend*/**/*' - '{,ee/,jh/}spec/frontend*/**/*'
rules: rules:
'@gitlab/require-i18n-strings': off '@gitlab/require-i18n-strings': off
'@gitlab/no-runtime-template-compiler': off '@gitlab/no-runtime-template-compiler': off
...@@ -139,13 +139,11 @@ overrides: ...@@ -139,13 +139,11 @@ overrides:
parser: '@graphql-eslint/eslint-plugin' parser: '@graphql-eslint/eslint-plugin'
operations: operations:
- '{,ee/,jh/}app/**/*.graphql' - '{,ee/,jh/}app/**/*.graphql'
# You can run `bundle exec rake gitlab:graphql:schema:dump` and then uncomment this line # You can run `bundle exec rake gitlab:graphql:schema:dump` and then uncomment this line
# schema: './tmp/tests/graphql/gitlab_schema.graphql' # schema: './tmp/tests/graphql/gitlab_schema.graphql'
rules: rules:
filenames/match-regex: off filenames/match-regex: off
spaced-comment: off spaced-comment: off
# TODO: We need a way to include this rule + support ee_else_ce fragments
#'@graphql-eslint/unique-fragment-name': error
# TODO: Uncomment these rules when then `schema` is available # TODO: Uncomment these rules when then `schema` is available
#'@graphql-eslint/fragments-on-composite-type': error #'@graphql-eslint/fragments-on-composite-type': error
#'@graphql-eslint/known-argument-names': error #'@graphql-eslint/known-argument-names': error
...@@ -153,3 +151,4 @@ overrides: ...@@ -153,3 +151,4 @@ overrides:
'@graphql-eslint/no-anonymous-operations': error '@graphql-eslint/no-anonymous-operations': error
'@graphql-eslint/unique-operation-name': error '@graphql-eslint/unique-operation-name': error
'@graphql-eslint/require-id-when-available': error '@graphql-eslint/require-id-when-available': error
'@graphql-eslint/unique-fragment-name': error
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment HttpIntegrationPayloadData on AlertManagementHttpIntegration { fragment HttpIntegrationPayloadData on AlertManagementHttpIntegration {
id id
} }
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment BoardFragment on Board { fragment BoardFragment on Board {
id id
name name
......
#import "./board_list_shared.fragment.graphql" #import "./board_list_shared.fragment.graphql"
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment BoardListFragment on BoardList { fragment BoardListFragment on BoardList {
...BoardListShared ...BoardListShared
} }
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment BoardScopeFragment on Board { fragment BoardScopeFragment on Board {
id id
name name
......
#import "~/graphql_shared/fragments/issue.fragment.graphql" #import "~/graphql_shared/fragments/issue.fragment.graphql"
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment Issue on Issue { fragment Issue on Issue {
id id
...IssueNode ...IssueNode
......
fragment Iteration on Iteration { fragment IterationShared on Iteration {
id id
title title
} }
fragment PageInfo on PageInfo {
startCursor
endCursor
}
# eslint-disable-next-line @graphql-eslint/require-id-when-available # This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/require-id-when-available, @graphql-eslint/unique-fragment-name
fragment IncidentFields on Issue { fragment IncidentFields on Issue {
severity severity
escalationStatus escalationStatus
......
fragment Label on Label {
id
color
textColor
title
}
#import "./label.fragment.graphql" #import "~/graphql_shared/fragments/label.fragment.graphql"
query searchLabels($fullPath: ID!, $search: String, $isProject: Boolean = false) { query searchLabels($fullPath: ID!, $search: String, $isProject: Boolean = false) {
group(fullPath: $fullPath) @skip(if: $isProject) { group(fullPath: $fullPath) @skip(if: $isProject) {
......
#import "./user.fragment.graphql" #import "~/graphql_shared/fragments/user.fragment.graphql"
query searchUsers($fullPath: ID!, $search: String, $isProject: Boolean = false) { query searchUsers($fullPath: ID!, $search: String, $isProject: Boolean = false) {
group(fullPath: $fullPath) @skip(if: $isProject) { group(fullPath: $fullPath) @skip(if: $isProject) {
......
fragment User on User {
id
avatarUrl
name
username
}
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment TreeEntryCommit on LogTreeCommit { fragment TreeEntryCommit on LogTreeCommit {
sha sha
message message
......
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment ProjectPathLocksFragment on Project { fragment ProjectPathLocksFragment on Project {
id id
} }
#import "./runner_details_shared.fragment.graphql" #import "./runner_details_shared.fragment.graphql"
# This fragment is used as ee-else-ce
# eslint-disable-next-line @graphql-eslint/unique-fragment-name
fragment RunnerDetails on CiRunner { fragment RunnerDetails on CiRunner {
...RunnerDetailsShared ...RunnerDetailsShared
} }
...@@ -12,7 +12,7 @@ query groupMilestones($fullPath: ID!, $title: String, $state: MilestoneStateEnum ...@@ -12,7 +12,7 @@ query groupMilestones($fullPath: ID!, $title: String, $state: MilestoneStateEnum
includeAncestors: true includeAncestors: true
) { ) {
nodes { nodes {
...MilestoneFragment ...SidebarMilestoneFragment
state state
} }
} }
......
...@@ -8,7 +8,7 @@ query mergeRequestMilestone($fullPath: ID!, $iid: String!) { ...@@ -8,7 +8,7 @@ query mergeRequestMilestone($fullPath: ID!, $iid: String!) {
__typename __typename
id id
attribute: milestone { attribute: milestone {
...MilestoneFragment ...SidebarMilestoneFragment
} }
} }
} }
......
fragment MilestoneFragment on Milestone { fragment SidebarMilestoneFragment on Milestone {
id id
title title
webUrl: webPath webUrl: webPath
......
...@@ -8,7 +8,7 @@ query projectIssueMilestone($fullPath: ID!, $iid: String!) { ...@@ -8,7 +8,7 @@ query projectIssueMilestone($fullPath: ID!, $iid: String!) {
__typename __typename
id id
attribute: milestone { attribute: milestone {
...MilestoneFragment ...SidebarMilestoneFragment
} }
} }
} }
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册