GraphQL Diff
Compare two GraphQL schemas and classify breaking, dangerous and safe changes.
Install
irm https://raw.githubusercontent.com/chayprabs/localtools/main/graphql-diff/install.ps1 | iexlocaltools-graphql-diff updatelocaltools-graphql-diff uninstall
curl -fsSL https://raw.githubusercontent.com/chayprabs/localtools/main/graphql-diff/install.sh | bashlocaltools-graphql-diff updatelocaltools-graphql-diff uninstall
brew install chayprabs/localtools/localtools-graphql-diffbrew upgrade localtools-graphql-diffbrew uninstall localtools-graphql-diff
scoop bucket add localtools https://github.com/chayprabs/homebrew-localtools; scoop install localtools-graphql-diffscoop update localtools-graphql-diffscoop uninstall localtools-graphql-diff
winget install localtools.GraphqlDiffwinget upgrade localtools.GraphqlDiffwinget uninstall localtools.GraphqlDiff
npm i -g localtools-graphql-diffnpm i -g localtools-graphql-diff@latestnpm rm -g localtools-graphql-diff
Opens at http://127.0.0.1:47112 in your browser. Run localtools-graphql-diff --help for the command line. Set LOCALTOOLS_NO_OPEN=1 to install without opening it.
Direct download
| Platform | File | Size |
|---|---|---|
| Windows x64 | graphql-diff-1.0.2-windows-x64.zip | 43.7 MB |
| macOS Apple Silicon | graphql-diff-1.0.2-macos-arm64.zip | 30.6 MB |
| macOS Intel | graphql-diff-1.0.2-macos-x64.zip | 32.4 MB |
| Linux x64 | graphql-diff-1.0.2-linux-x64.zip | 41.0 MB |
| Linux ARM64 | graphql-diff-1.0.2-linux-arm64.zip | 41.3 MB |
SHA-256 checksums are in the release notes; the install scripts verify them for you.
See it
How to use
- Run localtools-graphql-diff; the page opens at http://127.0.0.1:47112.
- Paste or drop the old and new schema (SDL .graphql files or introspection JSON; several files per side are merged).
- Optionally drop your client operation files to see which queries the change breaks.
- Press Compare, filter by breaking / dangerous / safe, copy the Markdown for your PR or download JSON.
- In CI: localtools-graphql-diff old.graphql new.graphql --fail-on breaking (exit 2 on breaking changes).
FAQ
Are the results the same as graphql-inspector?
Yes. It runs @graphql-inspector/core 8 and loads schemas and applies rules in the same order as the graphql-inspector CLI. On GitHub, GitLab, Saleor, Shopify and SWAPI schema histories, with every option combination, the lists are identical.
What is the difference between breaking and dangerous?
Breaking changes make existing valid operations fail (removed fields, changed types, new required arguments). Dangerous changes keep operations valid but can change behaviour (new enum values, changed default values, new union members).
Can it use an introspection result instead of SDL?
Yes: a JSON file with __schema or data.__schema works on either side, and can be compared with an SDL file.
How big can schemas be?
Up to 32 MB per side and 200,000 types; 150,000 types with 50,000 breaking changes compare in about 15 seconds. Each comparison runs in its own worker with a 60 s limit.
Does anything get uploaded?
No. Everything runs in the local program on 127.0.0.1 with no network requests.