Class: GraphQL::SchemaComparator::Changes::InputFieldDescriptionChanged

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(input_type, old_field, new_field) ⇒ InputFieldDescriptionChanged

Returns a new instance of InputFieldDescriptionChanged.



697
698
699
700
701
702
# File 'lib/graphql/schema_comparator/changes.rb', line 697

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

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



695
696
697
# File 'lib/graphql/schema_comparator/changes.rb', line 695

def criticality
  @criticality
end

#input_typeObject (readonly)

Returns the value of attribute input_type.



695
696
697
# File 'lib/graphql/schema_comparator/changes.rb', line 695

def input_type
  @input_type
end

#new_fieldObject (readonly)

Returns the value of attribute new_field.



695
696
697
# File 'lib/graphql/schema_comparator/changes.rb', line 695

def new_field
  @new_field
end

#old_fieldObject (readonly)

Returns the value of attribute old_field.



695
696
697
# File 'lib/graphql/schema_comparator/changes.rb', line 695

def old_field
  @old_field
end

Instance Method Details

#messageObject



704
705
706
707
# File 'lib/graphql/schema_comparator/changes.rb', line 704

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

#pathObject



709
710
711
# File 'lib/graphql/schema_comparator/changes.rb', line 709

def path
  [input_type.name, old_field.name].join(".")
end