Class: GraphQL::SchemaComparator::Diff::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/schema_comparator/diff/interface.rb

Instance Method Summary collapse

Constructor Details

#initialize(old_interface, new_interface) ⇒ Interface

Returns a new instance of Interface.



5
6
7
8
9
10
11
# File 'lib/graphql/schema_comparator/diff/interface.rb', line 5

def initialize(old_interface, new_interface)
  @old_interface = old_interface
  @new_interface = new_interface

  @old_fields = old_interface.fields
  @new_fields = new_interface.fields
end

Instance Method Details

#diffObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/graphql/schema_comparator/diff/interface.rb', line 13

def diff
  changes = []
  changes += field_removals
  changes += field_additions

  each_common_field do |old_field, new_field|
    changes += Diff::Field.new(old_interface, new_interface, old_field, new_field).diff
  end

  changes
end