Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Equiem/gql-compat

Repository files navigation

GraphQL Compatibility Checker

A CLI tool for checking whether one GraphQL schema is backwards compatible with another.

Installation

Global

npm install -g @equiem/gql-compat
gql-compat --help

Local

npm install --save-dev @equiem/gql-compat

Then in package.json add:

{
  "scripts": {
    "script-name": "gql-compat [options]"
  }
}

Examples

Compare schema in master against schema in current working copy.

$ gql-compat check 'origin/master:path/to/*/*.graphql' 'path/to/*/*.graphql'

Append all current breaking changes to the ignore file: .gql-compat-ignore.

$ gql-compat ignore 'origin/master:path/to/*/*.graphql' 'path/to/*/*.graphql'

Now all current breaking changes will be ignored for a period of time (the --ignore-tolerance period, which defaults to 7 days).

Known Issues

Pattern Matching

There is a difference between glob matching for the working copy vs. the contents of a committish. The former uses a glob match, whereas the latter uses the pattern matching of git ls-files.