Class: GraphQL::SchemaComparator::Changes::InputFieldAdded

Inherits:
AbstractChange
  • Object
show all
Defined in:
lib/graphql/schema_comparator/changes.rb

Overview

Mostly Non-Breaking Changes

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractChange

#breaking?, #dangerous?, #non_breaking?

Constructor Details

#initialize(input_object_type, field) ⇒ InputFieldAdded

Returns a new instance of InputFieldAdded.



452
453
454
455
456
457
458
459
460
461
# File 'lib/graphql/schema_comparator/changes.rb', line 452

def initialize(input_object_type, field)
  @criticality = if field.type.non_null?
    Changes::Criticality.breaking
  else
    Changes::Criticality.non_breaking
  end

  @input_object_type = input_object_type
  @field = field
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



450
451
452
# File 'lib/graphql/schema_comparator/changes.rb', line 450

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field.



450
451
452
# File 'lib/graphql/schema_comparator/changes.rb', line 450

def field
  @field
end

#input_object_typeObject (readonly)

Returns the value of attribute input_object_type.



450
451
452
# File 'lib/graphql/schema_comparator/changes.rb', line 450

def input_object_type
  @input_object_type
end

Instance Method Details

#messageObject



463
464
465
# File 'lib/graphql/schema_comparator/changes.rb', line 463

def message
  "Input field `#{field.name}` was added to input object type `#{input_object_type.name}`"
end