Class: GraphQL::SchemaComparator::Changes::InputFieldDefaultChanged
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::InputFieldDefaultChanged
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#input_type ⇒ Object
readonly
Returns the value of attribute input_type.
-
#new_field ⇒ Object
readonly
Returns the value of attribute new_field.
-
#old_field ⇒ Object
readonly
Returns the value of attribute old_field.
Instance Method Summary collapse
-
#initialize(input_type, old_field, new_field) ⇒ InputFieldDefaultChanged
constructor
A new instance of InputFieldDefaultChanged.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(input_type, old_field, new_field) ⇒ InputFieldDefaultChanged
Returns a new instance of InputFieldDefaultChanged.
512 513 514 515 516 517 518 519 520 |
# File 'lib/graphql/schema_comparator/changes.rb', line 512 def initialize(input_type, old_field, new_field) @criticality = Changes::Criticality.dangerous( reason: "Changing the default value for an argument may change the runtime " \ "behaviour of a field if it was never provided." ) @input_type = input_type @old_field = old_field @new_field = new_field end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
510 511 512 |
# File 'lib/graphql/schema_comparator/changes.rb', line 510 def criticality @criticality end |
#input_type ⇒ Object (readonly)
Returns the value of attribute input_type.
510 511 512 |
# File 'lib/graphql/schema_comparator/changes.rb', line 510 def input_type @input_type end |
#new_field ⇒ Object (readonly)
Returns the value of attribute new_field.
510 511 512 |
# File 'lib/graphql/schema_comparator/changes.rb', line 510 def new_field @new_field end |
#old_field ⇒ Object (readonly)
Returns the value of attribute old_field.
510 511 512 |
# File 'lib/graphql/schema_comparator/changes.rb', line 510 def old_field @old_field end |
Instance Method Details
#message ⇒ Object
522 523 524 525 |
# File 'lib/graphql/schema_comparator/changes.rb', line 522 def "Input field `#{path}` default changed"\ " from `#{old_field.default_value}` to `#{new_field.default_value}`" end |
#path ⇒ Object
527 528 529 |
# File 'lib/graphql/schema_comparator/changes.rb', line 527 def path old_field.path end |