Class: GraphQL::SchemaComparator::Changes::FieldDeprecationChanged

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, old_field, new_field) ⇒ FieldDeprecationChanged



432
433
434
435
436
437
# File 'lib/graphql/schema_comparator/changes.rb', line 432

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

Instance Attribute Details

#new_fieldObject (readonly)

Returns the value of attribute new_field.



430
431
432
# File 'lib/graphql/schema_comparator/changes.rb', line 430

def new_field
  @new_field
end

#old_fieldObject (readonly)

Returns the value of attribute old_field.



430
431
432
# File 'lib/graphql/schema_comparator/changes.rb', line 430

def old_field
  @old_field
end

#typeObject (readonly)

Returns the value of attribute type.



430
431
432
# File 'lib/graphql/schema_comparator/changes.rb', line 430

def type
  @type
end

Instance Method Details

#breaking?Boolean



444
445
446
# File 'lib/graphql/schema_comparator/changes.rb', line 444

def breaking?
  !!@breaking
end

#messageObject



439
440
441
442
# File 'lib/graphql/schema_comparator/changes.rb', line 439

def message
  "Deprecation reason on field `#{type.name}.#{new_field.name}` has changed "\
    "from `#{old_field.deprecation_reason}` to `#{new_field.deprecation_reason}`"
end