Class: GraphQL::SchemaComparator::Changes::FieldArgumentAdded
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::FieldArgumentAdded
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Instance Attribute Summary collapse
-
#argument ⇒ Object
readonly
Returns the value of attribute argument.
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, field, argument) ⇒ FieldArgumentAdded
constructor
A new instance of FieldArgumentAdded.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(type, field, argument) ⇒ FieldArgumentAdded
Returns a new instance of FieldArgumentAdded.
656 657 658 659 660 661 662 663 664 665 666 |
# File 'lib/graphql/schema_comparator/changes.rb', line 656 def initialize(type, field, argument) @criticality = if argument.type.non_null? && !argument.default_value? Changes::Criticality.breaking(reason: "Adding a required argument without a default value to an existing field is a breaking change because it will cause existing uses of this field to error.") else Changes::Criticality.non_breaking end @type = type @field = field @argument = argument end |
Instance Attribute Details
#argument ⇒ Object (readonly)
Returns the value of attribute argument.
654 655 656 |
# File 'lib/graphql/schema_comparator/changes.rb', line 654 def argument @argument end |
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
654 655 656 |
# File 'lib/graphql/schema_comparator/changes.rb', line 654 def criticality @criticality end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
654 655 656 |
# File 'lib/graphql/schema_comparator/changes.rb', line 654 def field @field end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
654 655 656 |
# File 'lib/graphql/schema_comparator/changes.rb', line 654 def type @type end |
Instance Method Details
#message ⇒ Object
668 669 670 |
# File 'lib/graphql/schema_comparator/changes.rb', line 668 def "Argument `#{argument.graphql_name}: #{argument.type.graphql_name}` added to field `#{field.path}`" end |
#path ⇒ Object
672 673 674 |
# File 'lib/graphql/schema_comparator/changes.rb', line 672 def path argument.path end |