Class: GraphQL::SchemaComparator::Changes::DirectiveArgumentDefaultChanged
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::DirectiveArgumentDefaultChanged
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#directive ⇒ Object
readonly
Returns the value of attribute directive.
-
#new_argument ⇒ Object
readonly
Returns the value of attribute new_argument.
-
#old_argument ⇒ Object
readonly
Returns the value of attribute old_argument.
Instance Method Summary collapse
-
#initialize(directive, old_argument, new_argument) ⇒ DirectiveArgumentDefaultChanged
constructor
A new instance of DirectiveArgumentDefaultChanged.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(directive, old_argument, new_argument) ⇒ DirectiveArgumentDefaultChanged
Returns a new instance of DirectiveArgumentDefaultChanged.
465 466 467 468 469 470 471 472 473 |
# File 'lib/graphql/schema_comparator/changes.rb', line 465 def initialize(directive, old_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." ) @directive = directive @old_argument = old_argument @new_argument = new_argument end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
463 464 465 |
# File 'lib/graphql/schema_comparator/changes.rb', line 463 def criticality @criticality end |
#directive ⇒ Object (readonly)
Returns the value of attribute directive.
463 464 465 |
# File 'lib/graphql/schema_comparator/changes.rb', line 463 def directive @directive end |
#new_argument ⇒ Object (readonly)
Returns the value of attribute new_argument.
463 464 465 |
# File 'lib/graphql/schema_comparator/changes.rb', line 463 def new_argument @new_argument end |
#old_argument ⇒ Object (readonly)
Returns the value of attribute old_argument.
463 464 465 |
# File 'lib/graphql/schema_comparator/changes.rb', line 463 def old_argument @old_argument end |
Instance Method Details
#message ⇒ Object
475 476 477 478 |
# File 'lib/graphql/schema_comparator/changes.rb', line 475 def "Default value for argument `#{new_argument.name}` on directive `#{directive.name}` changed"\ " from `#{old_argument.default_value}` to `#{new_argument.default_value}`" end |
#path ⇒ Object
480 481 482 |
# File 'lib/graphql/schema_comparator/changes.rb', line 480 def path ["@#{directive.name}", new_argument.name].join(".") end |