Class: GraphQL::SchemaComparator::Changes::EnumValueRemoved
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::EnumValueRemoved
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#enum_type ⇒ Object
readonly
Returns the value of attribute enum_type.
-
#enum_value ⇒ Object
readonly
Returns the value of attribute enum_value.
Instance Method Summary collapse
-
#initialize(enum_type, enum_value, usage) ⇒ EnumValueRemoved
constructor
A new instance of EnumValueRemoved.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(enum_type, enum_value, usage) ⇒ EnumValueRemoved
Returns a new instance of EnumValueRemoved.
102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/graphql/schema_comparator/changes.rb', line 102 def initialize(enum_type, enum_value, usage) @enum_value = enum_value @enum_type = enum_type @criticality = if usage.input? Changes::Criticality.breaking( reason: "Removing an enum value will cause existing queries that use this enum value to error." ) else Changes::Criticality.non_breaking( reason: "Removing an enum value for enums used only in outputs is non-breaking." ) end end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
100 101 102 |
# File 'lib/graphql/schema_comparator/changes.rb', line 100 def criticality @criticality end |
#enum_type ⇒ Object (readonly)
Returns the value of attribute enum_type.
100 101 102 |
# File 'lib/graphql/schema_comparator/changes.rb', line 100 def enum_type @enum_type end |
#enum_value ⇒ Object (readonly)
Returns the value of attribute enum_value.
100 101 102 |
# File 'lib/graphql/schema_comparator/changes.rb', line 100 def enum_value @enum_value end |
Instance Method Details
#message ⇒ Object
116 117 118 |
# File 'lib/graphql/schema_comparator/changes.rb', line 116 def "Enum value `#{enum_value.graphql_name}` was removed from enum `#{enum_type.graphql_name}`" end |
#path ⇒ Object
120 121 122 |
# File 'lib/graphql/schema_comparator/changes.rb', line 120 def path enum_value.path end |