Class: GraphQL::SchemaComparator::Changes::InputFieldDefaultChanged

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_type, old_field, new_field) ⇒ InputFieldDefaultChanged

Returns a new instance of InputFieldDefaultChanged.



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

def initialize(input_type, old_field, new_field)
  @input_type = input_type
  @old_field = old_field
  @new_field = new_field
  @breaking = false
end

Instance Attribute Details

#input_typeObject (readonly)

Returns the value of attribute input_type.



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

def input_type
  @input_type
end

#new_fieldObject (readonly)

Returns the value of attribute new_field.



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

def new_field
  @new_field
end

#old_fieldObject (readonly)

Returns the value of attribute old_field.



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

def old_field
  @old_field
end

Instance Method Details

#breaking?Boolean

Returns:

  • (Boolean)


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

def breaking?
  !!@breaking
end

#messageObject



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

def message
  "Input field `#{input_type.name}.#{old_field.name}` default changed"\
    " from `#{old_field.default_value}` to `#{new_field.default_value}`"
end