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


412
413
414
415
416
417
418
419
# File 'lib/graphql/schema_comparator/changes.rb', line 412

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


410
411
412
# File 'lib/graphql/schema_comparator/changes.rb', line 410

def criticality
  @criticality
end

#union_memberObject (readonly)

Returns the value of attribute union_member


410
411
412
# File 'lib/graphql/schema_comparator/changes.rb', line 410

def union_member
  @union_member
end

#union_typeObject (readonly)

Returns the value of attribute union_type


410
411
412
# File 'lib/graphql/schema_comparator/changes.rb', line 410

def union_type
  @union_type
end

Instance Method Details

#messageObject


421
422
423
# File 'lib/graphql/schema_comparator/changes.rb', line 421

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