Class: GraphQL::SchemaComparator::Changes::UnionMemberAdded

Inherits:
AbstractChange
  • Object
show all
Defined in:
lib/graphql/schema_comparator/changes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractChange

#breaking?, #dangerous?, #non_breaking?

Constructor Details

#initialize(union_type, union_member) ⇒ UnionMemberAdded

Returns a new instance of UnionMemberAdded.



589
590
591
592
593
594
595
596
# File 'lib/graphql/schema_comparator/changes.rb', line 589

def initialize(union_type, union_member)
  @union_member = union_member
  @union_type = union_type
  @criticality = Changes::Criticality.dangerous(
    reason: "Adding a possible type to Unions may break existing clients " \
      "that were not programming defensively against a new possible type."
  )
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



587
588
589
# File 'lib/graphql/schema_comparator/changes.rb', line 587

def criticality
  @criticality
end

#union_memberObject (readonly)

Returns the value of attribute union_member.



587
588
589
# File 'lib/graphql/schema_comparator/changes.rb', line 587

def union_member
  @union_member
end

#union_typeObject (readonly)

Returns the value of attribute union_type.



587
588
589
# File 'lib/graphql/schema_comparator/changes.rb', line 587

def union_type
  @union_type
end

Instance Method Details

#messageObject



598
599
600
# File 'lib/graphql/schema_comparator/changes.rb', line 598

def message
  "Union member `#{union_member.graphql_name}` was added to Union type `#{union_type.graphql_name}`"
end

#pathObject



602
603
604
# File 'lib/graphql/schema_comparator/changes.rb', line 602

def path
  union_type.path
end