Class: GraphQL::SchemaComparator::Changes::EnumValueAdded
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::EnumValueAdded
- 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) ⇒ EnumValueAdded
constructor
A new instance of EnumValueAdded.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(enum_type, enum_value) ⇒ EnumValueAdded
Returns a new instance of EnumValueAdded.
488 489 490 491 492 493 494 495 |
# File 'lib/graphql/schema_comparator/changes.rb', line 488 def initialize(enum_type, enum_value) @enum_type = enum_type @enum_value = enum_value @criticality = Changes::Criticality.dangerous( reason: "Adding an enum value may break existing clients that were not " \ "programming defensively against an added case when querying an enum." ) end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
486 487 488 |
# File 'lib/graphql/schema_comparator/changes.rb', line 486 def criticality @criticality end |
#enum_type ⇒ Object (readonly)
Returns the value of attribute enum_type.
486 487 488 |
# File 'lib/graphql/schema_comparator/changes.rb', line 486 def enum_type @enum_type end |
#enum_value ⇒ Object (readonly)
Returns the value of attribute enum_value.
486 487 488 |
# File 'lib/graphql/schema_comparator/changes.rb', line 486 def enum_value @enum_value end |
Instance Method Details
#message ⇒ Object
497 498 499 |
# File 'lib/graphql/schema_comparator/changes.rb', line 497 def "Enum value `#{enum_value.name}` was added to enum `#{enum_type.name}`" end |
#path ⇒ Object
501 502 503 |
# File 'lib/graphql/schema_comparator/changes.rb', line 501 def path [enum_type.name, enum_value.name].join(".") end |