Class: GraphQL::SchemaComparator::Changes::UnionMemberRemoved

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) ⇒ UnionMemberRemoved

Returns a new instance of UnionMemberRemoved.



128
129
130
131
132
133
134
# File 'lib/graphql/schema_comparator/changes.rb', line 128

def initialize(union_type, union_member)
  @union_member = union_member
  @union_type = union_type
  @criticality = Changes::Criticality.breaking(
    reason: "Removing a union member from a union can cause existing queries that use this union member in a fragment spread to error."
  )
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



126
127
128
# File 'lib/graphql/schema_comparator/changes.rb', line 126

def criticality
  @criticality
end

#union_memberObject (readonly)

Returns the value of attribute union_member.



126
127
128
# File 'lib/graphql/schema_comparator/changes.rb', line 126

def union_member
  @union_member
end

#union_typeObject (readonly)

Returns the value of attribute union_type.



126
127
128
# File 'lib/graphql/schema_comparator/changes.rb', line 126

def union_type
  @union_type
end

Instance Method Details

#messageObject



136
137
138
# File 'lib/graphql/schema_comparator/changes.rb', line 136

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

#pathObject



140
141
142
# File 'lib/graphql/schema_comparator/changes.rb', line 140

def path
  union_type.path
end