Class: GraphQL::SchemaComparator::Changes::TypeRemoved

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

Overview

Mostly breaking changes

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractChange

#breaking?, #dangerous?, #non_breaking?

Constructor Details

#initialize(removed_type) ⇒ TypeRemoved

Returns a new instance of TypeRemoved.



46
47
48
49
50
51
# File 'lib/graphql/schema_comparator/changes.rb', line 46

def initialize(removed_type)
  @removed_type = removed_type
  @criticality = Changes::Criticality.breaking(
    reason: "Removing a type is a breaking change. It is preferable to deprecate and remove all references to this type first."
  )
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



44
45
46
# File 'lib/graphql/schema_comparator/changes.rb', line 44

def criticality
  @criticality
end

#removed_typeObject (readonly)

Returns the value of attribute removed_type.



44
45
46
# File 'lib/graphql/schema_comparator/changes.rb', line 44

def removed_type
  @removed_type
end

Instance Method Details

#messageObject



53
54
55
# File 'lib/graphql/schema_comparator/changes.rb', line 53

def message
  "Type `#{removed_type.graphql_name}` was removed"
end

#pathObject



57
58
59
# File 'lib/graphql/schema_comparator/changes.rb', line 57

def path
  removed_type.path
end