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

Add GraphQL ESLint plugin to the codebase

上级 721c7bbb
No related branches found
No related tags found
无相关合并请求
显示
41 个添加18 个删除
...@@ -7,3 +7,5 @@ ...@@ -7,3 +7,5 @@
/tmp/ /tmp/
/vendor/ /vendor/
/sitespeed-result/ /sitespeed-result/
/fixtures/**/*.graphql
spec/fixtures/**/*.graphql
...@@ -113,3 +113,24 @@ overrides: ...@@ -113,3 +113,24 @@ overrides:
- '*.stories.js' - '*.stories.js'
rules: rules:
filenames/match-regex: off filenames/match-regex: off
- files:
- '*.graphql'
plugins:
- '@graphql-eslint'
parserOptions:
parser: '@graphql-eslint/eslint-plugin'
operations:
- '{,ee/,jh/}app/**/*.graphql'
# You can run `bundle exec rake gitlab:graphql:schema:dump` and then uncomment this line
# schema: './tmp/tests/graphql/gitlab_schema.graphql'
rules:
filenames/match-regex: 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
#'@graphql-eslint/fragments-on-composite-type': error
#'@graphql-eslint/known-argument-names': error
#'@graphql-eslint/known-type-names': error
'@graphql-eslint/no-anonymous-operations': error
'@graphql-eslint/unique-operation-name': error
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql" #import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
query getProjects( query accessTokensGetProjects(
$search: String = "" $search: String = ""
$after: String = "" $after: String = ""
$first: Int = null $first: Int = null
......
query getGroupProjects( query analyticsGetGroupProjects(
$groupFullPath: ID! $groupFullPath: ID!
$search: String! $search: String!
$first: Int! $first: Int!
......
#import "./board_list.fragment.graphql" #import "./board_list.fragment.graphql"
mutation CreateBoardList($boardId: BoardID!, $backlog: Boolean, $labelId: LabelID) { mutation createBoardList($boardId: BoardID!, $backlog: Boolean, $labelId: LabelID) {
boardListCreate(input: { boardId: $boardId, backlog: $backlog, labelId: $labelId }) { boardListCreate(input: { boardId: $boardId, backlog: $backlog, labelId: $labelId }) {
list { list {
...BoardListFragment ...BoardListFragment
......
#import "ee_else_ce/boards/graphql/board_list.fragment.graphql" #import "ee_else_ce/boards/graphql/board_list.fragment.graphql"
query ListIssues( query BoardLists(
$fullPath: ID! $fullPath: ID!
$boardId: ID! $boardId: ID!
$filters: BoardIssueInput $filters: BoardIssueInput
......
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql" #import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
query getGroupProjects($fullPath: ID!, $search: String, $after: String) { query boardsGetGroupProjects($fullPath: ID!, $search: String, $after: String) {
group(fullPath: $fullPath) { group(fullPath: $fullPath) {
projects(search: $search, after: $after, first: 100, includeSubgroups: true) { projects(search: $search, after: $after, first: 100, includeSubgroups: true) {
nodes { nodes {
......
#import "ee_else_ce/boards/graphql/issue.fragment.graphql" #import "ee_else_ce/boards/graphql/issue.fragment.graphql"
mutation IssueMoveList( mutation issueMoveList(
$projectPath: ID! $projectPath: ID!
$iid: String! $iid: String!
$boardId: ID! $boardId: ID!
......
#import "ee_else_ce/boards/graphql/issue.fragment.graphql" #import "ee_else_ce/boards/graphql/issue.fragment.graphql"
query ListIssues( query BoardListEE(
$fullPath: ID! $fullPath: ID!
$boardId: ID! $boardId: ID!
$id: ID $id: ID
......
query projectMilestones( query boardProjectMilestones(
$fullPath: ID! $fullPath: ID!
$state: MilestoneStateEnum $state: MilestoneStateEnum
$includeAncestors: Boolean $includeAncestors: Boolean
......
mutation($environment: Environment) { mutation cancelAutoStop($environment: Environment) {
cancelAutoStop(environment: $environment) @client { cancelAutoStop(environment: $environment) @client {
errors errors
} }
......
mutation($environment: Environment) { mutation deleteEnvironment($environment: Environment) {
deleteEnvironment(environment: $environment) @client { deleteEnvironment(environment: $environment) @client {
errors errors
} }
......
mutation($environment: Environment) { mutation rollbackEnvironment($environment: Environment) {
rollbackEnvironment(environment: $environment) @client { rollbackEnvironment(environment: $environment) @client {
errors errors
} }
......
mutation($environment: Environment) { mutation stopEnvironment($environment: Environment) {
stopEnvironment(environment: $environment) @client { stopEnvironment(environment: $environment) @client {
errors errors
} }
......
mutation($input: EnvironmentsCanaryIngressUpdateInput!) { mutation updateCanaryIngress($input: EnvironmentsCanaryIngressUpdateInput!) {
environmentsCanaryIngressUpdate(input: $input) { environmentsCanaryIngressUpdate(input: $input) {
errors errors
} }
......
#import "../fragments/user.fragment.graphql" #import "../fragments/user.fragment.graphql"
#import "~/graphql_shared/fragments/user_availability.fragment.graphql" #import "~/graphql_shared/fragments/user_availability.fragment.graphql"
query usersSearch($search: String!, $fullPath: ID!) { query groupUsersSearch($search: String!, $fullPath: ID!) {
workspace: group(fullPath: $fullPath) { workspace: group(fullPath: $fullPath) {
id id
users: groupMembers(search: $search, relations: [DIRECT, INHERITED]) { users: groupMembers(search: $search, relations: [DIRECT, INHERITED]) {
......
#import "../fragments/user.fragment.graphql" #import "../fragments/user.fragment.graphql"
#import "~/graphql_shared/fragments/user_availability.fragment.graphql" #import "~/graphql_shared/fragments/user_availability.fragment.graphql"
query usersSearch($search: String!, $fullPath: ID!) { query projectUsersSearch($search: String!, $fullPath: ID!) {
workspace: project(fullPath: $fullPath) { workspace: project(fullPath: $fullPath) {
users: projectMembers(search: $search, relations: [DIRECT, INHERITED, INVITED_GROUPS]) { users: projectMembers(search: $search, relations: [DIRECT, INHERITED, INVITED_GROUPS]) {
nodes { nodes {
......
query($fullPath: ID!) { query getIssuesListDetails($fullPath: ID!) {
project(fullPath: $fullPath) { project(fullPath: $fullPath) {
issues { issues {
nodes { nodes {
......
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql" #import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
query getProjects( query jiraGetProjects(
$search: String! $search: String!
$after: String = "" $after: String = ""
$first: Int! $first: Int!
......
#import "./jira_import.fragment.graphql" #import "./jira_import.fragment.graphql"
query($fullPath: ID!) { query getJiraImportDetails($fullPath: ID!) {
project(fullPath: $fullPath) { project(fullPath: $fullPath) {
jiraImportStatus jiraImportStatus
jiraImports { jiraImports {
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册