Class: GraphQL::SchemaComparator::Changes::FieldRemoved
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::FieldRemoved
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#object_type ⇒ Object
readonly
Returns the value of attribute object_type.
Instance Method Summary collapse
-
#initialize(object_type, field) ⇒ FieldRemoved
constructor
A new instance of FieldRemoved.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(object_type, field) ⇒ FieldRemoved
Returns a new instance of FieldRemoved.
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/graphql/schema_comparator/changes.rb', line 297 def initialize(object_type, field) @object_type = object_type @field = field if field.deprecation_reason @criticality = Changes::Criticality.breaking( reason: "Removing a deprecated field is a breaking change. Before removing it, you may want" \ "to look at the field's usage to see the impact of removing the field." ) else @criticality = Changes::Criticality.breaking( reason: "Removing a field is a breaking change. It is preferable to deprecate the field before removing it." ) end end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
295 296 297 |
# File 'lib/graphql/schema_comparator/changes.rb', line 295 def criticality @criticality end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
295 296 297 |
# File 'lib/graphql/schema_comparator/changes.rb', line 295 def field @field end |
#object_type ⇒ Object (readonly)
Returns the value of attribute object_type.
295 296 297 |
# File 'lib/graphql/schema_comparator/changes.rb', line 295 def object_type @object_type end |
Instance Method Details
#message ⇒ Object
313 314 315 |
# File 'lib/graphql/schema_comparator/changes.rb', line 313 def "Field `#{field.graphql_name}` was removed from object type `#{object_type.graphql_name}`" end |
#path ⇒ Object
317 318 319 |
# File 'lib/graphql/schema_comparator/changes.rb', line 317 def path [object_type.graphql_name, field.graphql_name].join(".") end |