Class: GraphQL::SchemaComparator::Changes::InputFieldAdded
- Inherits:
-
AbstractChange
- Object
- AbstractChange
- GraphQL::SchemaComparator::Changes::InputFieldAdded
- Defined in:
- lib/graphql/schema_comparator/changes.rb
Overview
Mostly Non-Breaking Changes
Instance Attribute Summary collapse
-
#criticality ⇒ Object
readonly
Returns the value of attribute criticality.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#input_object_type ⇒ Object
readonly
Returns the value of attribute input_object_type.
Instance Method Summary collapse
-
#initialize(input_object_type, field) ⇒ InputFieldAdded
constructor
A new instance of InputFieldAdded.
- #message ⇒ Object
- #path ⇒ Object
Methods inherited from AbstractChange
#breaking?, #dangerous?, #non_breaking?
Constructor Details
#initialize(input_object_type, field) ⇒ InputFieldAdded
Returns a new instance of InputFieldAdded.
633 634 635 636 637 638 639 640 641 642 |
# File 'lib/graphql/schema_comparator/changes.rb', line 633 def initialize(input_object_type, field) @criticality = if field.type.non_null? && !field.default_value? Changes::Criticality.breaking(reason: "Adding a non-null input field without a default value to an existing input type will cause existing queries that use this input type to error because they will not provide a value for this new field.") else Changes::Criticality.non_breaking end @input_object_type = input_object_type @field = field end |
Instance Attribute Details
#criticality ⇒ Object (readonly)
Returns the value of attribute criticality.
631 632 633 |
# File 'lib/graphql/schema_comparator/changes.rb', line 631 def criticality @criticality end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
631 632 633 |
# File 'lib/graphql/schema_comparator/changes.rb', line 631 def field @field end |
#input_object_type ⇒ Object (readonly)
Returns the value of attribute input_object_type.
631 632 633 |
# File 'lib/graphql/schema_comparator/changes.rb', line 631 def input_object_type @input_object_type end |
Instance Method Details
#message ⇒ Object
644 645 646 |
# File 'lib/graphql/schema_comparator/changes.rb', line 644 def "Input field `#{field.graphql_name}` was added to input object type `#{input_object_type.graphql_name}`" end |
#path ⇒ Object
648 649 650 |
# File 'lib/graphql/schema_comparator/changes.rb', line 648 def path field.path end |