Page MenuHomePhabricator

[8h] Look into GraphQL linting tools
Closed, ResolvedPublic

Description

Check what tooling is there for linting GraphQL SDLs and see how they could be beneficial for Wikibase GraphQL SDL

An example could be checking that list fields are not nullable.

The task will be timeboxed to 8 work hours to check the existing tooling, and build the good-enough linting into our software.

Event Timeline

WMDE-leszek renamed this task from Look into GraphQL linting tools to [8h] Look into GraphQL linting tools.Oct 9 2025, 10:10 AM
WMDE-leszek updated the task description. (Show Details)
WMDE-leszek moved this task from Polished to Ready for planning on the Wikibase Reuse Team board.

Change #1207157 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] GQL: Lint schema

https://gerrit.wikimedia.org/r/1207157

Change #1207158 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] GQL: Enable GraphQL type naming convention linting

https://gerrit.wikimedia.org/r/1207158

I found three linting tools that are often recommended:

  1. GraphQL-ESLint. This is the one I think we should choose. We already use ESLint in various places of the code base, it's actively maintained and works well.
  2. graphql-schema-linter is recommended in the Production Ready GraphQL book, but it doesn't seem to be actively maintained anymore and has >10x fewer npm downloads.
  3. GraphOS/rover schema linting appears to be the standard in the Apollo GraphQL ecosystem, but we're not using any other Apollo tooling at the moment and it all looked a bit too integrated into the whole "GraphOS platform" and too complicated for what we need.

Great, thank you for looking into it! Yeah, ESLint seems like the obvious choice.

Change #1207157 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] GQL: Lint schema

https://gerrit.wikimedia.org/r/1207157

Change #1207158 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] GQL: Use UPPER_CASE names for enum type values

https://gerrit.wikimedia.org/r/1207158