
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
graphql-schema-diff
Advanced tools
Returns the diff of two GraphQL schemas. Detects dangerous and breaking changes.
Returns the diff of two GraphQL schemas. Detects dangerous and breaking changes.
$ npm install -g graphql-schema-diff
$ graphql-schema-diff --help
Returns the diff of two GraphQL schemas. Detects dangerous and breaking changes.
Usage
$ graphql-schema-diff <leftSchemaLocation> <rightSchemaLocation>
Options
--fail-on-dangerous-changes Exit with error on dangerous changes
--fail-on-breaking-changes Exit with error on breaking changes
--fail-on-all-changes Exit with error on all changes
--create-html-output Creates an HTML file containing the diff
--html-output-directory Directory where the HTML file should be stored (Default: './schemaDiff')
--header, -H Header to send to all remote schema sources
--left-schema-header Header to send to left remote schema source
--right-schema-header Header to send to right remote schema source
--sort-schema, -s Sort schemas prior to diffing
--input-value-deprecation Include deprecated input value fields when loading from URL
Examples
$ graphql-schema-diff https://example.com/graphql schema.graphql
$ graphql-schema-diff https://example.com/graphql schema.graphql -H 'Authorization: Bearer 123'
Schema locations can be:
https://swapi.graph.cool/)schemas/schema.graphql)'schemas/**/*.graphql')import { getDiff } from 'graphql-schema-diff';
const currentSchemaLocation = 'https://swapi-graphql.netlify.app/.netlify/functions/index';
const newSchemaLocation = './schema.graphql';
getDiff(currentSchemaLocation, newSchemaLocation)
.then((result) => {
if (!result) {
console.log('Schemas are identical!');
return;
}
console.log(result.diff);
console.log(result.diffNoColor);
console.log(result.dangerousChanges);
console.log(result.breakingChanges);
});
FAQs
Returns the diff of two GraphQL schemas. Detects dangerous and breaking changes.
We found that graphql-schema-diff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.