Check - WunderGraph

Usage

Check schema changes

npx wgc monograph check <name> --schema <path-to-schema>

Use this command whenever you make modifications to your monograph schema. It will report any GraphQL or composition errors before they land on production. The report will be made visible under Schema Checks.

Description

The npx wgc monograph check command checks for breaking changes and composition errors in the proposed schema. This validation process ensures that the new schema you intend to use does not introduce any issues that could negatively impact the monograph.

Parameters

Options

Example

Check for breaking changes and composition errors for the monograph “production” in the default namespace with the new schema file located at ”./schemas/new_schema.graphql”:

npx wgc monograph check production -n default --schema ./schemas/new_schema.graphql

Output the check result as JSON for automation:

npx wgc monograph check production -n default --schema ./schemas/new_schema.graphql --json

Write the JSON check result to a file:

npx wgc monograph check production -n default --schema ./schemas/new_schema.graphql --out ./check-result.json

Sample output with changes and errors

Changes

CHANGE TYPE DESCRIPTION
BREAKING FIELD_REMOVED Field ‘email’ was removed from object type ‘User’
NON-BREAKING FIELD_ADDED Field ‘emailID’ was added to object type ‘User’

Usage in CI and GitHub Integration

Checkout the tutorial here on how to use the check command in CI with GitHub.

Notes