All Projects → fabsrc → graphql-schema-diff

fabsrc / graphql-schema-diff

Licence: MIT license
📄🔄📄 Returns the diff of two GraphQL schemas. Detects dangerous and breaking changes.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to graphql-schema-diff

schemaglue
Naturally breaks down your monolithic graphql schema into bits and pieces and then glue them back together.
Stars: ✭ 117 (+116.67%)
Mutual labels:  schema, graphql-schema
Type Graphql
Create GraphQL schema and resolvers with TypeScript, using classes and decorators!
Stars: ✭ 6,864 (+12611.11%)
Mutual labels:  schema, graphql-schema
graphql-directive-sql
Unify your SQL schema and your GraphQL Schema. Use GraphQL SDL as the lingua franca to define your data requirements.
Stars: ✭ 28 (-48.15%)
Mutual labels:  schema, graphql-schema
Graphql Code Generator
A tool for generating code based on a GraphQL schema and GraphQL operations (query/mutation/subscription), with flexible support for custom plugins.
Stars: ✭ 7,993 (+14701.85%)
Mutual labels:  schema, graphql-schema
Typegql
Create GraphQL schema with TypeScript classes.
Stars: ✭ 415 (+668.52%)
Mutual labels:  schema, graphql-schema
Pgquarrel
pgquarrel compares PostgreSQL database schemas (DDL)
Stars: ✭ 274 (+407.41%)
Mutual labels:  diff, schema
Difference.rs
Rust text diffing and assertion library
Stars: ✭ 206 (+281.48%)
Mutual labels:  diff
Awesome Website Change Monitoring
A curated list of awesome tools for website diffing and change monitoring.
Stars: ✭ 224 (+314.81%)
Mutual labels:  diff
Split Diff
Side-by-side file compare for the Atom text editor.
Stars: ✭ 188 (+248.15%)
Mutual labels:  diff
Dtl
diff template library written by C++
Stars: ✭ 180 (+233.33%)
Mutual labels:  diff
mobivoc
A vocabulary for future-oriented mobility solutions and value-added services supporting them.
Stars: ✭ 27 (-50%)
Mutual labels:  schema
Rxdatasources
UITableView and UICollectionView Data Sources for RxSwift (sections, animated updates, editing ...)
Stars: ✭ 2,784 (+5055.56%)
Mutual labels:  diff
Deck
decK: Configuration management and drift detection for Kong
Stars: ✭ 211 (+290.74%)
Mutual labels:  diff
Swiftlcs
Swift implementation of the longest common subsequence (LCS) algorithm.
Stars: ✭ 207 (+283.33%)
Mutual labels:  diff
Listdiff
Swift port of IGListKit's IGListDiff
Stars: ✭ 225 (+316.67%)
Mutual labels:  diff
Htmlsimilarity
网页相似度判断:根据网页结构判断页面相似性 ,可用于相似度计算、越权检测等(Determine page similarity based on HTML page structure)
Stars: ✭ 189 (+250%)
Mutual labels:  diff
git-tui
Collection of human friendly terminal interface for git.
Stars: ✭ 95 (+75.93%)
Mutual labels:  diff
Diffobj
Compare R Objects with a Diff
Stars: ✭ 188 (+248.15%)
Mutual labels:  diff
Elm Package
Command line tool to share Elm libraries
Stars: ✭ 214 (+296.3%)
Mutual labels:  diff
Dsladapter
🔥 Kotlin时代的Adapter, Dsl 的形式使用 RecyclerView.Adapter, 支持折叠展开, 树结构,悬停,情感图状态切换, 加载更多, 多类型Item,侧滑菜单等
Stars: ✭ 231 (+327.78%)
Mutual labels:  diff

GraphQL Schema Diff

Build Status npm

Returns the diff of two GraphQL schemas. Detects dangerous and breaking changes.

Install

$ npm install -g graphql-schema-diff

Usage

$ 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

  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:

  • An URL to a GraphQL endpoint (e.g. https://swapi.graph.cool/)
  • A path to a single file (e.g. schemas/schema.graphql)
  • A glob pattern to merge multiple files (e.g. 'schemas/**/*.graphql')

API

Example

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);
  });

Related Packages

  • GraphQL Inspector ouputs a list of changes between two GraphQL schemas.
  • GraphQL Tools provides a set of utils for faster development of GraphQL tools.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].