Skip to content

WIP: Add eslint-plugin-graphql to lint .graphql files

Tom Quirk requested to merge tq/eslint-plugin-graphql-experiment into master

What does this MR do?

Proof of concept for adding eslint-plugin-graphql to our eslint ruleset (issue raised: #219337 (closed))

Issues

  • @client directive isn't handled

ESLint output (as of creation of this MR)

The errors here aren't really errors as they mostly pertain to use of @client directive. Type definitions for these typically exist "in-code" (i.e. not in our GitLab GraphQL schema) and hence, these errors.


/gitlab-development-kit/gitlab/app/assets/javascripts/design_management/graphql/mutations/update_active_discussion.mutation.graphql
  2:3  error  Cannot query field "updateActiveDiscussion" on type "Mutation"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/design_management/graphql/queries/active_discussion.query.graphql
  2:3  error  Cannot query field "activeDiscussion" on type "Query"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/design_management/graphql/queries/appData.query.graphql
  2:3  error  Cannot query field "projectPath" on type "Query". Did you mean "project" or "projects"?  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/design_management/graphql/typedefs.graphql
  1:1  error  The ActiveDiscussion definition is not executable  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/commit.fragment.graphql
  1:29  error  Unknown type "LogTreeCommit"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/getCommit.query.graphql
  4:3  error  Cannot query field "commit" on type "Query"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/getCommits.query.graphql
  4:3  error  Cannot query field "commits" on type "Query"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/getProjectPath.query.graphql
  2:3  error  Cannot query field "projectPath" on type "Query". Did you mean "project" or "projects"?  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/getProjectShortPath.query.graphql
  2:3  error  Cannot query field "projectShortPath" on type "Query". Did you mean "projects"?  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/getReadme.query.graphql
  2:3  error  Cannot query field "readme" on type "Query"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/getRef.query.graphql
  2:3  error  Cannot query field "ref" on type "Query"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/repository/queries/getVueFileListLfsBadge.query.graphql
  2:3  error  Cannot query field "vueFileListLfsBadge" on type "Query"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/static_site_editor/graphql/mutations/submit_content_changes.mutation.graphql
  1:39  error  Unknown type "SubmitContentChangesInput"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/static_site_editor/graphql/queries/app_data.query.graphql
  2:3  error  Cannot query field "appData" on type "Query". Did you mean "metadata"?  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/static_site_editor/graphql/queries/saved_content_meta.query.graphql
  2:3  error  Cannot query field "savedContentMeta" on type "Query"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/static_site_editor/graphql/queries/source_content.query.graphql
  4:5  error  Cannot query field "file" on type "Project"  graphql/template-strings

/gitlab-development-kit/gitlab/app/assets/javascripts/static_site_editor/graphql/typedefs.graphql
  1:1  error  The File definition is not executable  graphql/template-strings

/gitlab-development-kit/gitlab/doc/api/graphql/reference/gitlab_schema.graphql
  1:1  error  The AddAwardEmojiInput definition is not executable  graphql/template-strings

/gitlab-development-kit/gitlab/ee/app/assets/javascripts/repository/queries/commit.fragment.graphql
  1:29  error  Unknown type "LogTreeCommit"  graphql/template-strings

/gitlab-development-kit/gitlab/ee/app/assets/javascripts/security_dashboard/graphql/pipeline_security_report_summary.query.graphql
  3:15  error  Unknown argument "id" on field "pipelines" of type "Project"  graphql/template-strings
Edited by Tom Quirk

Merge request reports