Class: GraphQL::SchemaComparator::Changes::FieldDescriptionChanged

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractChange

#breaking?, #dangerous?, #non_breaking?

Constructor Details

#initialize(type, old_field, new_field) ⇒ FieldDescriptionChanged

Returns a new instance of FieldDescriptionChanged.



599
600
601
602
603
604
# File 'lib/graphql/schema_comparator/changes.rb', line 599

def initialize(type, old_field, new_field)
  @criticality = Changes::Criticality.non_breaking
  @type = type
  @old_field = old_field
  @new_field = new_field
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



597
598
599
# File 'lib/graphql/schema_comparator/changes.rb', line 597

def criticality
  @criticality
end

#new_fieldObject (readonly)

Returns the value of attribute new_field.



597
598
599
# File 'lib/graphql/schema_comparator/changes.rb', line 597

def new_field
  @new_field
end

#old_fieldObject (readonly)

Returns the value of attribute old_field.



597
598
599
# File 'lib/graphql/schema_comparator/changes.rb', line 597

def old_field
  @old_field
end

#typeObject (readonly)

Returns the value of attribute type.



597
598
599
# File 'lib/graphql/schema_comparator/changes.rb', line 597

def type
  @type
end

Instance Method Details

#messageObject



606
607
608
609
# File 'lib/graphql/schema_comparator/changes.rb', line 606

def message
  "Field `#{type.name}.#{old_field.name}` description changed"\
    " from `#{old_field.description}` to `#{new_field.description}`"
end