Class: GraphQL::SchemaComparator::Changes::TypeKindChanged
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::TypeKindChanged
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#new_type ⇒ Object
readonly
Returns the value of attribute new_type.
-
#old_type ⇒ Object
readonly
Returns the value of attribute old_type.
Instance Method Summary collapse
-
#initialize(old_type, new_type) ⇒ TypeKindChanged
constructor
A new instance of TypeKindChanged.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(old_type, new_type) ⇒ TypeKindChanged
Returns a new instance of TypeKindChanged.
82 83 84 85 86 87 88 |
# File 'lib/graphql/schema_comparator/changes.rb', line 82 def initialize(old_type, new_type) @old_type = old_type @new_type = new_type @criticality = Changes::Criticality.breaking( reason: "Changing the kind of a type is a breaking change because it can cause existing queries to error. For example, turning an object type to a scalar type would break queries that define a selection set for this type." ) end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
80 81 82 |
# File 'lib/graphql/schema_comparator/changes.rb', line 80 def criticality @criticality end |
#new_type ⇒ Object (readonly)
Returns the value of attribute new_type.
80 81 82 |
# File 'lib/graphql/schema_comparator/changes.rb', line 80 def new_type @new_type end |
#old_type ⇒ Object (readonly)
Returns the value of attribute old_type.
80 81 82 |
# File 'lib/graphql/schema_comparator/changes.rb', line 80 def old_type @old_type end |
Instance Method Details
#message ⇒ Object
90 91 92 |
# File 'lib/graphql/schema_comparator/changes.rb', line 90 def "`#{old_type.graphql_name}` kind changed from `#{old_type.kind}` to `#{new_type.kind}`" end |
#path ⇒ Object
94 95 96 |
# File 'lib/graphql/schema_comparator/changes.rb', line 94 def path old_type.path end |