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
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(type, field, old_argument, new_argument) ⇒ FieldArgumentDefaultChanged
337 338 339 340 341 342 343 344 345 346 |
# File 'lib/graphql/schema_comparator/changes.rb', line 337 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.
335 336 337 |
# File 'lib/graphql/schema_comparator/changes.rb', line 335 def criticality @criticality end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
335 336 337 |
# File 'lib/graphql/schema_comparator/changes.rb', line 335 def field @field end |
#new_argument ⇒ Object (readonly)
Returns the value of attribute new_argument.
335 336 337 |
# File 'lib/graphql/schema_comparator/changes.rb', line 335 def new_argument @new_argument end |
#old_argument ⇒ Object (readonly)
Returns the value of attribute old_argument.
335 336 337 |
# File 'lib/graphql/schema_comparator/changes.rb', line 335 def old_argument @old_argument end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
335 336 337 |
# File 'lib/graphql/schema_comparator/changes.rb', line 335 def type @type end |
Instance Method Details
#message ⇒ Object
348 349 350 351 352 353 354 355 |
# File 'lib/graphql/schema_comparator/changes.rb', line 348 def if old_argument.default_value.nil? "Default value `#{new_argument.default_value}` was added to argument `#{new_argument.name}` on field `#{type.name}.#{field.name}`" else "Default value for argument `#{new_argument.name}` on field `#{type.name}.#{field.name}` changed"\ " from `#{old_argument.default_value}` to `#{new_argument.default_value}`" end end |