Class: GraphQL::SchemaComparator::Diff::Union
- Inherits:
-
Object
- Object
- GraphQL::SchemaComparator::Diff::Union
- Defined in:
- lib/graphql/schema_comparator/diff/union.rb
Instance Method Summary collapse
- #diff ⇒ Object
-
#initialize(old_type, new_type) ⇒ Union
constructor
A new instance of Union.
Constructor Details
#initialize(old_type, new_type) ⇒ Union
Returns a new instance of Union.
5 6 7 8 9 10 11 |
# File 'lib/graphql/schema_comparator/diff/union.rb', line 5 def initialize(old_type, new_type) @old_type = old_type @new_type = new_type @old_possible_types = old_type.possible_types @new_possible_types = new_type.possible_types end |
Instance Method Details
#diff ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/graphql/schema_comparator/diff/union.rb', line 13 def diff changes = [] changes += removed_possible_types.map do |removed| Changes::UnionMemberRemoved.new(new_type, removed) end changes += added_possible_types.map do |added| Changes::UnionMemberAdded.new(new_type, added) end changes end |