Class: GraphQL::SchemaComparator::Changes::FieldArgumentDefaultChanged
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::FieldArgumentDefaultChanged
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Overview
Dangerous Changes
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#new_argument ⇒ Object
readonly
Returns the value of attribute new_argument.
-
#old_argument ⇒ Object
readonly
Returns the value of attribute old_argument.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, field, old_argument, new_argument) ⇒ FieldArgumentDefaultChanged
constructor
A new instance of FieldArgumentDefaultChanged.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(type, field, old_argument, new_argument) ⇒ FieldArgumentDefaultChanged
Returns a new instance of FieldArgumentDefaultChanged.
484 485 486 487 488 489 490 491 492 493 |
# File 'lib/graphql/schema_comparator/changes.rb', line 484 def initialize(type, field, old_argument, new_argument) @type = type @field = field @old_argument = old_argument @new_argument = new_argument @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." ) end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
482 483 484 |
# File 'lib/graphql/schema_comparator/changes.rb', line 482 def criticality @criticality end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
482 483 484 |
# File 'lib/graphql/schema_comparator/changes.rb', line 482 def field @field end |
#new_argument ⇒ Object (readonly)
Returns the value of attribute new_argument.
482 483 484 |
# File 'lib/graphql/schema_comparator/changes.rb', line 482 def new_argument @new_argument end |
#old_argument ⇒ Object (readonly)
Returns the value of attribute old_argument.
482 483 484 |
# File 'lib/graphql/schema_comparator/changes.rb', line 482 def old_argument @old_argument end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
482 483 484 |
# File 'lib/graphql/schema_comparator/changes.rb', line 482 def type @type end |
Instance Method Details
#message ⇒ Object
495 496 497 498 499 500 501 502 |
# File 'lib/graphql/schema_comparator/changes.rb', line 495 def if old_argument.default_value? "Default value for argument `#{new_argument.graphql_name}` on field `#{field.path}` changed"\ " from `#{old_argument.default_value}` to `#{new_argument.default_value}`" else "Default value `#{new_argument.default_value}` was added to argument `#{new_argument.graphql_name}` on field `#{field.path}`" end end |
#path ⇒ Object
504 505 506 |
# File 'lib/graphql/schema_comparator/changes.rb', line 504 def path old_argument.path end |