Class: GraphQL::SchemaComparator::Changes::DirectiveArgumentTypeChanged
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::DirectiveArgumentTypeChanged
- Includes:
- SafeTypeChange
- 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) ⇒ DirectiveArgumentTypeChanged
constructor
A new instance of DirectiveArgumentTypeChanged.
- #message ⇒ Object
- #path ⇒ Object
Methods included from SafeTypeChange
#safe_change_for_field?, #safe_change_for_input_value?
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(directive, old_argument, new_argument) ⇒ DirectiveArgumentTypeChanged
Returns a new instance of DirectiveArgumentTypeChanged.
455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/graphql/schema_comparator/changes.rb', line 455 def initialize(directive, old_argument, new_argument) if safe_change_for_input_value?(old_argument.type, new_argument.type) @criticality = Changes::Criticality.non_breaking( reason: "Changing an input field from non-null to null is considered non-breaking" ) else @criticality = Changes::Criticality.breaking end @directive = directive @old_argument = old_argument @new_argument = new_argument end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
453 454 455 |
# File 'lib/graphql/schema_comparator/changes.rb', line 453 def criticality @criticality end |
#directive ⇒ Object (readonly)
Returns the value of attribute directive.
453 454 455 |
# File 'lib/graphql/schema_comparator/changes.rb', line 453 def directive @directive end |
#new_argument ⇒ Object (readonly)
Returns the value of attribute new_argument.
453 454 455 |
# File 'lib/graphql/schema_comparator/changes.rb', line 453 def new_argument @new_argument end |
#old_argument ⇒ Object (readonly)
Returns the value of attribute old_argument.
453 454 455 |
# File 'lib/graphql/schema_comparator/changes.rb', line 453 def old_argument @old_argument end |
Instance Method Details
#message ⇒ Object
469 470 471 472 |
# File 'lib/graphql/schema_comparator/changes.rb', line 469 def "Type for argument `#{new_argument.graphql_name}` on directive `#{directive.graphql_name}` changed"\ " from `#{old_argument.type.to_type_signature}` to `#{new_argument.type.to_type_signature}`" end |
#path ⇒ Object
474 475 476 |
# File 'lib/graphql/schema_comparator/changes.rb', line 474 def path ["@#{directive.graphql_name}", old_argument.graphql_name].join('.') end |