Class: GraphQL::SchemaComparator::Changes::FieldArgumentTypeChanged
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::FieldArgumentTypeChanged
- Includes:
- SafeTypeChange
- Defined in:
- lib/graphql/schema_comparator/changes.rb
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) ⇒ FieldArgumentTypeChanged
constructor
A new instance of FieldArgumentTypeChanged.
- #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(type, field, old_argument, new_argument) ⇒ FieldArgumentTypeChanged
Returns a new instance of FieldArgumentTypeChanged.
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/graphql/schema_comparator/changes.rb', line 423 def initialize(type, field, 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( reason: "Changing the type of a field's argument can cause existing queries that use this argument to error." ) end @type = type @field = field @old_argument = old_argument @new_argument = new_argument end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
421 422 423 |
# File 'lib/graphql/schema_comparator/changes.rb', line 421 def criticality @criticality end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
421 422 423 |
# File 'lib/graphql/schema_comparator/changes.rb', line 421 def field @field end |
#new_argument ⇒ Object (readonly)
Returns the value of attribute new_argument.
421 422 423 |
# File 'lib/graphql/schema_comparator/changes.rb', line 421 def new_argument @new_argument end |
#old_argument ⇒ Object (readonly)
Returns the value of attribute old_argument.
421 422 423 |
# File 'lib/graphql/schema_comparator/changes.rb', line 421 def old_argument @old_argument end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
421 422 423 |
# File 'lib/graphql/schema_comparator/changes.rb', line 421 def type @type end |
Instance Method Details
#message ⇒ Object
440 441 442 443 |
# File 'lib/graphql/schema_comparator/changes.rb', line 440 def "Type for argument `#{new_argument.graphql_name}` on field `#{field.path}` changed"\ " from `#{old_argument.type.to_type_signature}` to `#{new_argument.type.to_type_signature}`" end |
#path ⇒ Object
445 446 447 |
# File 'lib/graphql/schema_comparator/changes.rb', line 445 def path old_argument.path end |