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


448
449
450
451
452
453
454
455
456
457
# File 'lib/graphql/schema_comparator/changes.rb', line 448

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


446
447
448
# File 'lib/graphql/schema_comparator/changes.rb', line 446

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field


446
447
448
# File 'lib/graphql/schema_comparator/changes.rb', line 446

def field
  @field
end

#input_object_typeObject (readonly)

Returns the value of attribute input_object_type


446
447
448
# File 'lib/graphql/schema_comparator/changes.rb', line 446

def input_object_type
  @input_object_type
end

Instance Method Details

#messageObject


459
460
461
# File 'lib/graphql/schema_comparator/changes.rb', line 459

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