At Inigo, we understand the importance of keeping your GraphQL schemas clean, efficient, and standardized. That's why we're excited to announce that we've added GraphQL schema linting checks to our dev tools.
Our customers, many of whom manage multiple subgraphs, have expressed the need for a tool that can help maintain uniformity and prevent potential issues before they arise. The introduction of schema linting in Inigo addresses this need head-on. By automatically analyzing and validating the structure and syntax of your GraphQL schemas, our linting checks ensure that all your subgraphs adhere to the same set of standards, regardless of the number of development teams involved.
What sets Inigo's linting feature apart is its seamless integration into the GraphQL developer workflow and CI/CD pipelines. This means that you can catch and fix errors early in the development process, reducing the risk of introducing breaking changes and ensuring a smooth and consistent experience for your end users.
GraphQL schema linting is the process of analyzing and validating the structure and syntax of a GraphQL schema to ensure it adheres to best practices and standards. Like code linting in programming languages, schema linting helps identify potential issues, inconsistencies, or deviations from conventions before they cause problems in a GraphQL API.
Linting can check for various aspects of a schema, such as:
Using a schema linter allows developers to maintain a clean, efficient, and error-free GraphQL schema, which is crucial for building robust and scalable GraphQL APIs.
Schema Linting Rules Inigo includes a standard set of schema linting rules out of the box. These rules cover the most common schema standardization scenarios that GraphQL teams face. The following rules are listed in our Checks doc:
If there are additional linting rules that your team needs, please reach out to us in Slack to discuss!
Schema linting rules are defined in a Checks
YAML file (doc) that is applied using inigo apply
. Here is an example Checks
that defines FIELD_NAMES_CAMEL_CASE
and REST_FIELD_NAMES
linting rules:
In the Checks
YAML, you can set the linting rules with the level
of debug
, info
, warning
, or error
. For the error
level, any schema changes will not be applied unless overridden.
For more granularity with applying linting rules (doc), the @lint
directive can be used for types, fields, and enums. Here is an example of using @lint
on a type
:
Inversely, you can also ignore all linting rules except
for a subset of the rules, as shown below:
In conclusion, integrating GraphQL schema linting into Inigo marks a significant step forward in our commitment to delivering top-notch API development tools. The seamless integration of linting into the developer workflow and CI/CD pipelines further enhances the efficiency and reliability of your API development, allowing you to catch potential issues early and avoid costly errors down the line. With Inigo's GraphQL schema linting, you can foster collaboration among different development teams, reduce the risk of breaking changes, and ultimately deliver a better experience to your GraphQL API consumers.
Ready to take the next steps with Inigo? You can: