Skip to content

Lint GraphQL queries with `eslint-plugin-graphql`

GraphQL queries written on the client-side are currently not validated in our build process. This can lead to bugs e.g.:

  • querying for something that doesn't exist
  • duplicate query definitions

We should be able to leverage eslint-plugin-graphql to lint our .graphql files against our schema.

Why?

The addition of such a set of tooling would:

  • boost productivity of anyone writing GraphQL queries in gitlab-org/gitlab
  • reduce code review duration when .graphql files are involved
  • reduce occurrence of bugs

How?

@tomquirk briefly explored this in !33242 (closed), however came across some issues listed in the section below

Issues that need to be resolved

Edited by Tom Quirk