Schema

Validate all schema types in a workspace

Available commands

usage: sanity schema [--default] [-v|--version] [-d|--debug] [-h|--help] <command> [<args>]

Commands:
   validate  Validates all schema types specified in a workspace.

See 'sanity help schema <command>' for specific information on a subcommand.

Validate a schema

usage: sanity schema validate

  Validates all schema types specified in a workspace.

Options
  --workspace <name> The name of the workspace to use when validating all schema types.
  --format <pretty|ndjson|json> The output format used to print schema errors and warnings.
  --level <error|warning> The minimum level reported out. Defaults to warning.

Examples
  # Validates all schema types in a Sanity project with more than one workspace
  sanity schema validate --workspace default

  # Save the results of the report into a file
  sanity schema validate > report.txt

  # Report out only errors
  sanity schema validate --level error

Was this article helpful?