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.



509
510
511
512
513
514
515
516
# File 'lib/graphql/schema_comparator/changes.rb', line 509

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.



507
508
509
# File 'lib/graphql/schema_comparator/changes.rb', line 507

def criticality
  @criticality
end

#union_memberObject (readonly)

Returns the value of attribute union_member.



507
508
509
# File 'lib/graphql/schema_comparator/changes.rb', line 507

def union_member
  @union_member
end

#union_typeObject (readonly)

Returns the value of attribute union_type.



507
508
509
# File 'lib/graphql/schema_comparator/changes.rb', line 507

def union_type
  @union_type
end

Instance Method Details

#messageObject



518
519
520
# File 'lib/graphql/schema_comparator/changes.rb', line 518

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

#pathObject



522
523
524
# File 'lib/graphql/schema_comparator/changes.rb', line 522

def path
  union_type.name
end