Developer Experience · Lint Policies

Enforce GraphQL schema conventions on every check

Configurable rules run on every wgc subgraph check. Catch naming violations, missing descriptions, and undocumented deprecations before schemas are published.

Available onFreeProEnterprise

The problem

Schema quality decays without enforcement

Naming inconsistencies, missing descriptions, and incomplete deprecation directives accumulate over time. Code review catches some — and misses the rest.

Naming conventions drift across teams

Without enforcement, camelCase fields appear next to snake_case ones, PascalCase type names mix with lowercase variants, and enum values use inconsistent casing. Manual code review catches some violations but misses others.

Types ship without documentation

Descriptions are optional in GraphQL. Without a policy requiring them, types and fields go undocumented. API consumers have no context for what fields mean or when to use them.

Deprecated fields lack context

Fields marked @deprecated without a reason or removal date leave consumers without the information they need to migrate. The deprecation becomes noise rather than useful guidance.

Our solution

Automated schema quality checks

Lint policies run automatically on every schema check. Configure rules per namespace, set severity levels, and get violation reports before any schema is published.

From configuration to enforcement

  1. Lint policies are configured per namespace in Cosmo Studio.

  2. When the linter is enabled, rules are evaluated during every wgc subgraph check operation.

  3. Rules are set with a severity level: error (the check fails) or warning (the violation is flagged without failing).

  4. The linter parses the schema and evaluates it against the configured rules.

  5. Violations are reported with clear messages identifying which rule was broken and where.

  6. Rules run before schemas are published, catching issues in development rather than production.

Consistent schemas. Every check. Every namespace.

Lint Policies

Before & After

Before CosmoWith Cosmo
Inconsistent field naming caught in code review — or not at allFIELD_NAMES_SHOULD_BE_CAMEL_CASE fails the check automatically
Types published without descriptionsALL_TYPES_REQUIRE_DESCRIPTION blocks the check if descriptions are missing
Deprecated fields with no reason or dateREQUIRE_DEPRECATION_REASON and REQUIRE_DEPRECATION_DATE enforce context
Style enforcement depends on who reviews the PRRules run consistently on every wgc subgraph check

Rule categories

Available rule categories

Naming conventions
FIELD_NAMES_SHOULD_BE_CAMEL_CASETYPE_NAMES_SHOULD_BE_PASCAL_CASEENUM_VALUES_SHOULD_BE_UPPER_CASESHOULD_NOT_HAVE_TYPE_PREFIXSHOULD_NOT_HAVE_TYPE_SUFFIXSHOULD_NOT_HAVE_INPUT_PREFIXSHOULD_HAVE_INPUT_SUFFIX
Alphabetical order
ORDER_FIELDSORDER_ENUM_VALUESORDER_DEFINITIONS
Documentation
ALL_TYPES_REQUIRE_DESCRIPTION
Deprecation
REQUIRE_DEPRECATION_REASONREQUIRE_DEPRECATION_DATE
Other
DISALLOW_CASE_INSENSITIVE_ENUM_VALUESNO_TYPENAME_PREFIX_IN_TYPE_FIELDS

How lint policies work in Cosmo

01
Configured per namespace.

Configure

Enable lint policies in Cosmo Studio for the namespace. Select which rules to enable and set severity (error or warning) for each.

02
Runs on every check.

Check

Run wgc subgraph check. The linter evaluates the schema against the configured rules before the check completes.

03
Clear per-rule violation output.

Report

Violations appear in the check output with the rule name and location. Error-severity violations cause the check to fail.

04
Fix and re-check.

Fix

Correct the violations in the schema and re-run the check. Passing checks confirm the schema meets the configured policies.

Capabilities

What lint policies enforce

Consistent naming

Rules enforce camelCase fields, PascalCase types, and UPPER_CASE enum values across all subgraphs, automatically.

Documentation requirements

ALL_TYPES_REQUIRE_DESCRIPTION ensures every type has a description before it is published.

Deprecation standards

REQUIRE_DEPRECATION_REASON and REQUIRE_DEPRECATION_DATE mandate context for every @deprecated directive.

Configurable severity

Set rules as errors to block publishing or as warnings to flag violations without failing the check.

Enforce schema quality on every check

Configure lint rules once per namespace. Every schema check enforces them automatically.

FAQ

Lint Policies on Cosmo

More in the lint policy documentation.