{"id":13726742,"url":"https://github.com/xuorig/graphql-schema_comparator","last_synced_at":"2025-04-08T12:10:12.592Z","repository":{"id":23099324,"uuid":"98058558","full_name":"xuorig/graphql-schema_comparator","owner":"xuorig","description":"Get changes between two GraphQL schemas 🤖","archived":false,"fork":false,"pushed_at":"2023-10-27T15:54:29.000Z","size":189,"stargazers_count":266,"open_issues_count":9,"forks_count":27,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-01T11:02:56.493Z","etag":null,"topics":["cli","graphql","graphql-ruby","schema-idl"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuorig.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-22T21:22:42.000Z","updated_at":"2024-09-10T10:10:44.000Z","dependencies_parsed_at":"2024-01-06T07:45:07.183Z","dependency_job_id":"e785bb8e-378a-4ce1-94b0-bd3e73978685","html_url":"https://github.com/xuorig/graphql-schema_comparator","commit_stats":{"total_commits":117,"total_committers":16,"mean_commits":7.3125,"dds":0.6752136752136753,"last_synced_commit":"55336f07af0c4591416105308cd00e17e911f482"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuorig%2Fgraphql-schema_comparator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuorig%2Fgraphql-schema_comparator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuorig%2Fgraphql-schema_comparator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuorig%2Fgraphql-schema_comparator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuorig","download_url":"https://codeload.github.com/xuorig/graphql-schema_comparator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838444,"owners_count":21004580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","graphql","graphql-ruby","schema-idl"],"created_at":"2024-08-03T01:03:18.650Z","updated_at":"2025-04-08T12:10:12.571Z","avatar_url":"https://github.com/xuorig.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# GraphQL::SchemaComparator\n\n![Build status](https://github.com/xuorig/graphql-schema_comparator/actions/workflows/ci.yml/badge.svg)\n\n`GraphQL::SchemaComparator` is a GraphQL Schema comparator. What does that mean? `GraphQL::SchemaComparator` takes\ntwo GraphQL schemas and outputs a list of changes between versions. This is useful for many things:\n\n  - Breaking Change detection\n  - Applying custom rules to schema changes\n  - Building automated tools like linters\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'graphql-schema_comparator'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install graphql-schema_comparator\n\n## CLI\n\n`GraphQL::SchemaComparator` comes with a handy CLI to help compare two schemas using\nthe command line.\n\nAfter a `gem install graphql-schema_comparator`, use the CLI this way:\n\n```\nCommands:\n  schema_comparator compare OLD_SCHEMA NEW_SCHEMA  # Compares OLD_SCHEMA with NEW_SCHEMA and returns a list of changes\n  schema_comparator help [COMMAND]                 # Describe available commands or one specific command\n```\n\nWhere OLD_SCHEMA and NEW_SCHEMA can be a string containing a schema IDL or a filename where that IDL is located.\n\n### Example\n\n```\n$ ./bin/schema_comparator compare \"type Query { a: A } type A { a: String } enum B { A_VALUE }\" \"type Query { a: A } type A { b: String } enum B { A_VALUE ANOTHER_VALUE }\"\n⏳  Checking for changes...\n🎉  Done! Result:\n\nDetected the following changes between schemas:\n\n🛑  Field `a` was removed from object type `A`\n⚠️  Enum value `ANOTHER_VALUE` was added to enum `B`\n✅  Field `b` was added to object type `A`\n```\n\n## Usage\n\n`GraphQL::SchemaComparator`, provides a simple api for Ruby applications to use.\n\n## Docs\n\nhttp://www.rubydoc.info/github/xuorig/graphql-schema_comparator/master/GraphQL/SchemaComparator\n\n### GraphQL::SchemaComparator.compare\n\nThe compare method takes two arguments, `old_schema` and `new_schema`, the two schemas to compare.\n\nYou may provide schema IDL as strings, or provide instances of `GraphQL::Schema`.\n\nThe result of `compare` returns a `SchemaComparator::Result` object, from which you can\naccess information on the changes between the two schemas.\n\n - `result.breaking?` returns true if any breaking changes were found between the two schemas\n - `result.identical?` returns true if the two schemas were identical\n - `result.breaking_changes` returns the list of breaking changes found between schemas.\n - `result.non_breaking_changes` returns the list of non-breaking changes found between schemas.\n - `result.dangerous_changes` returns the list of dangerous changes found between schemas.\n- `result.changes` returns the full list of change objects.\n\n### Change Objects\n\n`GraphQL::SchemaComparator` returns a list of change objects. These change objects\nall inherit from `Changes::AbstractChange`\n\nPossible changes are all found in [changes.rb](lib/graphql/schema_comparator/changes.rb).\n\n### Change Criticality\n\nEach change object has a `#criticality` method which returns a `Changes::Criticality` object.\nThis objects defines how dangerous a change is to a schema.\n\nThe different levels of criticality (non_breaking, dangerous, breaking) are explained here:\nhttps://github.com/xuorig/graphql-schema_comparator/blob/master/lib/graphql/schema_comparator/changes/criticality.rb#L6-L19\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuorig%2Fgraphql-schema_comparator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuorig%2Fgraphql-schema_comparator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuorig%2Fgraphql-schema_comparator/lists"}