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_iface, new_iface) ⇒ Interface


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

def initialize(old_iface, new_iface)
  @old_iface = old_iface
  @new_iface = new_iface

  @old_fields = old_iface.fields
  @new_fields = new_iface.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_iface, new_iface, old_field, new_field).diff
  end

  changes
end