graphql-schema-regression
БесплатноБез исполняемых скриптовНе проверенUse for any question about whether a GraphQL schema change is safe, including one pasted diff and a field change that broke a client: diffs schemas with…
от testland★ 18 звёзд на GitHubОб этом скилле
graphql-schema-regression
Overview
GraphQL Inspector is a schema-management CLI from The Guild that validates GraphQL schemas and detects changes between two versions (gqi-overview). It classifies every change into one of three tiers (gqi-diff):
| Classification | Meaning |
|---|---|
| Breaking | Will disrupt existing clients (removed fields, narrowed types). |
| Dangerous | Won't immediately break clients but may cause issues (e.g. union member added). |
| Non-breaking | Safe additions (new fields on existing types, new types). |
The tool exits non-zero when breaking changes exist, exits zero otherwise - the gate is the exit code.
This is the GraphQL-specific counterpart to
openapi-contract-diff. Use it
when the API surface is GraphQL (single schema or Apollo Federation
supergraph) instead of REST.
When to use
- The repo defines a GraphQL schema (
schema.graphql, an SDL string in code, or a Federation subgraph). - The team wants a CI gate on schema regressions between the PR and the deployed schema.
- The team uses deprecated field tracking (
@deprecated) and wantssuppressRemovalOfDeprecatedFieldsemantics - i.e. removing a field that has been marked@deprecatedlong enough is acceptable, removing a non-deprecated field is not. - The schema is part of a Federation supergraph and you need to gate per-subgraph regressions.
Install
npm install --global @graphql-inspector/cli
(Per gqi-overview.)
For ad-hoc CI use, prefer running it via npx @graphql-inspector/cli
without a global install.
Running
Local diff between two schema files
graphql-inspector diff schema.old.graphql schema.new.graphql
(Per gqi-diff.)
The command supports SDL files, introspection result JSON, GitHub
URLs, and live endpoints - when passing an endpoint use the --header
flag to attach an auth token.
Comparing against the deployed schema
# Pull the production schema first
graphql-inspector introspect https://api.example.com/graphql > schema.prod.graphql
# Diff against the local SDL
graphql-inspector diff schema.prod.graphql schema.graphql
Output
The default output is human-readable, grouped by classification. Find breaking changes, dangerous changes, and non-breaking changes printed under separate headings.
For machine consumption, the JSON-output GitHub Action
(kamilkisiela/graphql-inspector or
@graphql-inspector/github-action) produces a structured report; for
arbitrary CI, parse the human-readable output via grep on the
classification headings.
Rules
graphql-inspector diff accepts --rule flags to customize the gate
(gqi-diff):
| Rule | Effect |
|---|---|
dangerousBreaking |
Treat dangerous changes as breaking (stricter). |
suppressRemovalOfDeprecatedField |
Removing a @deprecated field is non-breaking. |
ignoreDescriptionChanges |
Don't flag pure description / docstring edits. |
safeUnreachable |
Treat changes to unreachable parts of the graph as safe. |
considerUsage |
Use real-client usage data (Apollo Studio, etc.) to grade severity. |
Custom rules live as JS modules:
graphql-inspector diff old.graphql new.graphql --rule './rules/our-custom.js'
A custom rule exports a function ({ changes }) => filteredChanges -
useful when the team has a project-specific severity policy
(e.g. "removing any field under internalAdmin* is non-breaking").
CI integration
GitHub Actions - minimal
# .github/workflows/graphql-diff.yml
name: graphql-schema-diff
on:
pull_request:
paths:
- 'schema.graphql'
- '**/*.graphql'
jobs:
inspector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Extract base schema
run: |
BASE_SHA=$(git merge-base origin/main HEAD)
git show $BASE_SHA:schema.graphql > /tmp/schema-base.graphql
- name: Diff
run: |
npx @graphql-inspector/cli diff \
/tmp/schema-base.graphql \
schema.graphql \
--rule suppressRemovalOfDeprecatedField \
--rule ignoreDescriptionChanges
The --rule suppressRemovalOfDeprecatedField is the canonical pattern
for projects that take deprecation seriously: removing a field with
@deprecated is allowed; removing a live field blocks the PR.
Federation sup
Установить graphql-schema-regression в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл graphql-schema-regression?
Use for any question about whether a GraphQL schema change is safe, including one pasted diff and a field change that broke a client: diffs schemas with graphql-inspector, classifies changes as breaking, dangerous or safe (removed fields, narrowed types, deprecated-field removal with usage checks), checks Federation supergraph drift and gates CI.
Как установить скилл graphql-schema-regression?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл graphql-schema-regression запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub