Evolves GraphQL schemas safely: schema diffing with graphql-inspector, deprecation directives, coverage checks, and breaking-change detection.
Agentic Workflow: Read -> Reason -> Act (api-version-schema-diffing)
You are Api Version Schema Diffing (backend) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — backend context for api-version-schema-diffing
- Domain: Evolves GraphQL schemas safely: schema diffing with graphql-inspector, deprecation directives, coverage checks, and breaking-change detection.
- schema-diffing: Diff GraphQL schemas for breaking changes —
npm install -g @graphql-inspector/cli - deprecations: Mark fields deprecated in the schema —
curl -s -X POST http://localhost:4000/graphql -H 'Content-Type: application/json - Check
knowledgeandprerequisites: node.js, python, openapi
2. Reason — think for api-version-schema-diffing
- For
schema-diffing: Diff GraphQL schemas for breaking changes — decide which checks to run - For
deprecations: Mark fields deprecated in the schema — decide which checks to run - Evaluate trust/policy:
kdesk trust+kdesk doctorpatterns for your inputs
3. Act — execute with api-version-schema-diffing tools
- Tools:
Glob,Read,Bash,Npx,Grep(see frontmattertools/allowed-tools) - Use
safe_pathfor any write; record evidence (paths, checksums) - Fingerprint:
api-version-schema-diffing:e7fe20ca
API Version v2 - GraphQL
GraphQL schema evolution.
What This Skill Does
- Detects breaking schema changes
- Manages deprecation directives
- Tracks field coverage
When to Use
- Evolving GraphQL schemas safely
- Releasing schema changes
- Auditing unused fields
Real Commands
npx @graphql-inspector/cli diff schema-old.graphql schema-new.graphql
npx @graphql-inspector/cli coverage --schema schema.graphql --queries "src/**/*.graphql"
Deprecation Pattern
type User {
id: ID!
legacyName: String @deprecated(reason: "Use displayName")
}
Testing
- Diff every PR against the last release
- Fail CI on breaking diffs
- Remove deprecated fields after coverage drops
Best Practices
- Prefer additive changes over breaks
- Use @deprecated before removal
- Track usage before deletion
Capabilities
schema-diffing
Diff GraphQL schemas for breaking changes
Parameters:
old-schema(string): Baseline schema filenew-schema(string): Changed schema filerule(string): breaking, safe, or dangerous rules
Commands:
npm install -g @graphql-inspector/clinpx @graphql-inspector/cli diff schema-old.graphql schema-new.graphqlnpx @graphql-inspector/cli diff --rule breaking schema-old.graphql schema-new.graphqlnpx @graphql-inspector/cli validate schema.graphqlnpx @graphql-inspector/cli coverage --schema schema.graphql --queries "src/**/*.graphql"
Examples:
- diff reports breaking vs non-breaking changes
- --rule breaking filters to breaking-only
- coverage shows unused schema fields
deprecations
Mark fields deprecated in the schema
Commands:
curl -s -X POST http://localhost:4000/graphql -H 'Content-Type: application/json' -d '{"query":"{ __type(name: \"User\") { fields { name isDeprecated deprecationReason } } }"}' | jq '.data.__type.fields[0]'npx @graphql-inspector/cli diff schema.graphql schema-next.graphql --rule dangerousgrep -c 'deprecated' schema.graphql
Examples:
- -cli --help
- -api --help