When we started implementing our platform linter for GraphQL schemas, we noticed that in contrast to the JavaScript and TypeScript ecosystems (where m

Introducing graphql-lint and gqlint

submited by
Style Pass
2024-05-02 12:00:07

When we started implementing our platform linter for GraphQL schemas, we noticed that in contrast to the JavaScript and TypeScript ecosystems (where many new tools are now written in Rust and greatly accelerate the developer feedback loop and CI runtimes), there currently doesn't exist a widely adopted Rust-native linter for GraphQL.

To this end we've decided to open-source and offer as a separate crate our GraphQL linting solution, graphql-lint and its CLI - gqlint.

graphql-lint can lint an SDL schema in a few microseconds (25.953µs for example, for our test schema benchmark) and would fit perfectly into scenarios like a language server in the future for instant in-editor feedback. For a rough comparison, in our tests running a JS based linter (with a comparable configuration) in a relatively fast JS runtime and reading the response took around 559.7ms. That means you could lint an SDL schema 21,565 times in the time it took to invoke the JS based linter from Rust, or in other words, a 21,565X performance improvement.

Leave a Comment