Class: NulogyGraphqlApi::Tasks::SchemaChangesChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/nulogy_graphql_api/tasks/schema_changes_checker.rb

Instance Method Summary collapse

Instance Method Details

#check_changes(old_schema, new_schema) ⇒ Object



7
8
9
10
11
12
# File 'lib/nulogy_graphql_api/tasks/schema_changes_checker.rb', line 7

def check_changes(old_schema, new_schema)
  compare_result = GraphQL::SchemaComparator.compare(old_schema, new_schema)

  abort "Task aborted!\n #{Rainbow('No schema changes found.').green}" if compare_result.identical?
  abort "Task aborted!" unless accept_breaking_changes?(compare_result)
end