3 releases

0.1.3 Apr 26, 2024
0.1.2 Apr 26, 2024
0.1.1 Apr 26, 2024
0.1.0 Apr 26, 2024

#2779 in HTTP server

Download history 53/week @ 2025-10-18 72/week @ 2025-10-25 64/week @ 2025-11-01 59/week @ 2025-11-08 46/week @ 2025-11-15 60/week @ 2025-11-22 82/week @ 2025-11-29 24/week @ 2025-12-06 18/week @ 2025-12-13 12/week @ 2025-12-20 9/week @ 2025-12-27 31/week @ 2026-01-03 58/week @ 2026-01-10 216/week @ 2026-01-17 165/week @ 2026-01-24 65/week @ 2026-01-31

516 downloads per month
Used in gqlint

Apache-2.0

30KB
609 lines

graphql-lint

A Rust based linter for GraphQL SDL schemas.

graphql-lint is used in the Grafbase Platform and CLI.

Currently Supported Lints

  • Naming conventions
    • Types: PascalCase
      • Forbidden prefixes: "Type"
      • Forbidden suffixes: "Type"
    • Fields: camelCase
    • Input values: camelCase
    • Arguments: camelCase
    • Directives: camelCase
    • Enums: PascalCase
      • Forbidden prefixes: "Enum"
      • Forbidden suffixes: "Enum"
    • Unions
      • Forbidden prefixes: "Union"
      • Forbidden suffixes: "Union"
    • Enum values: SCREAMING_SNAKE_CASE
    • Interfaces
      • Forbidden prefixes: "Interface"
      • Forbidden suffixes: "Interface"
    • Query fields
      • Forbidden prefixes: ["query", "get", "list"]
      • Forbidden suffixes: "Query"
    • Mutation fields
      • Forbidden prefixes: ["mutation", "put", "post", "patch"]
      • Forbidden suffixes: "Mutation"
    • Subscription fields
      • Forbidden prefixes: "subscription"
      • Forbidden suffixes: "Subscription"
  • Usage of the @deprecated directive requires specifying the reason argument

Usage

[dependencies]
graphql-lint = "0.1.3"
use graphql_lint::lint;

fn main () {
    let schema = r#"
        type Query {
          hello: String!
        }
    "#;

    let violations = lint(schema).unwrap();
}

Dependencies

~3MB
~65K SLoC