Check Configurations

Customize schema checks to suit your use cases


PLAN REQUIRED
This feature is available on the following GraphOS plans: Free, Developer, Standard, Enterprise.

You can configure schema checks behavior to suit your use case using either GraphOS Studio or the Rover CLI. For example, you can:

  • Exclude past operations executed by a particular client, such as a client you only use for testing.

  • Exclude past operations that were executed relatively infrequently.

  • Check schema changes against multiple graph variants.

  • Ignore changes to default values.

  • Ignore potentially breaking changes when an operations check runs against zero operations.

  • Change the severity level of linter rules.

In GraphOS Studio, you can configure default rules that are applied to every executed schema check. You define these rules from the Configuration tab of your variant's Checks page:

Check configuration page in GraphOS Studio

Configuration options

You configure operations, linter, and proposals checks.

Operations check configurations

  • Whether operations checks are included in check runs. (On by default.)

  • Time range: Include all distinct operations executed within this range. The default value is 7 days ("Within the last week"). The maximum supported time range depends on your plan—refer to the Operation history for Checks and Insights row on the pricing page.

    • Operation count threshold: Exclude all operations executed fewer than this number of times within the specified time range.

  • Included Variants: Include all distinct operations executed against each selected variant of your graph. The default value is Base variant—whichever variant schema checks are being run against.

  • Excluded Clients: Exclude all operations executed by particular clients, such as clients used exclusively for development and testing.

  • Excluded Operations: Exclude specific named operations.

  • Ignored Conditions: Ignore certain kinds of schema changes. Learn more.

Linter check configurations

Linter check configurations include whether to include linting checks (on by default) and linter rules' severity levels. See Linter configuration for details.

Proposals check configurations

You can configure schema checks to include a Proposals task that verifies whether schema changes have matching and approved schema proposals. (Off by default.) Learn more.

Custom check configurations

Enable custom checks and register your validation webhook. Learn more.

Using the Rover CLI

You can customize a single schema check run by providing options to the Rover CLI. If you've also configured default rules for schema checks, any command-line options you provide take precedence over those rules.

For example, this command checks schema changes against the past two weeks of operations and only includes operations that have been executed at least five times and account for at least 3% of total operation volume:

Bash
rover subgraph check docs-example-graph@current \
  --name products \
  --schema ./schema.graphql \
  --validation-period="2w" \
  --query-count-threshold=5 \
  --query-percentage-threshold=3 

See the Rover CLI documentation for details on how to customize the validation period and threshold values for a single schema check run.

Checking against multiple environments

You might want to check schema changes against multiple environments, such as production, staging, and beta. Each of these environments might have a slightly different schema to support features that are experimental or in active development. In GraphOS, these schemas are represented as variants of a single graph.

You specify which variant you want to check against in the graph ref you provide to rover subgraph check:

Bash
rover subgraph check docs-example-graph@staging \
  --name products \
  --schema ./schema.graphql

The graph ref docs-example-graph@staging specifies the staging variant of the docs-example-graph graph.

To check your schema against multiple variants, call rover subgraph check once for each variant.