Class: GraphQL::SchemaComparator::Changes::FieldArgumentDescriptionChanged

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, field, old_argument, new_argument) ⇒ FieldArgumentDescriptionChanged

Returns a new instance of FieldArgumentDescriptionChanged.



756
757
758
759
760
761
762
# File 'lib/graphql/schema_comparator/changes.rb', line 756

def initialize(type, field, old_argument, new_argument)
  @criticality = Changes::Criticality.non_breaking
  @type = type
  @field = field
  @old_argument = old_argument
  @new_argument = new_argument
end

Instance Attribute Details

#criticalityObject (readonly)

Returns the value of attribute criticality.



754
755
756
# File 'lib/graphql/schema_comparator/changes.rb', line 754

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field.



754
755
756
# File 'lib/graphql/schema_comparator/changes.rb', line 754

def field
  @field
end

#new_argumentObject (readonly)

Returns the value of attribute new_argument.



754
755
756
# File 'lib/graphql/schema_comparator/changes.rb', line 754

def new_argument
  @new_argument
end

#old_argumentObject (readonly)

Returns the value of attribute old_argument.



754
755
756
# File 'lib/graphql/schema_comparator/changes.rb', line 754

def old_argument
  @old_argument
end

#typeObject (readonly)

Returns the value of attribute type.



754
755
756
# File 'lib/graphql/schema_comparator/changes.rb', line 754

def type
  @type
end

Instance Method Details

#messageObject



764
765
766
767
# File 'lib/graphql/schema_comparator/changes.rb', line 764

def message
  "Description for argument `#{new_argument.name}` on field `#{type.name}.#{field.name}` changed"\
    " from `#{old_argument.description}` to `#{new_argument.description}`"
end

#pathObject



769
770
771
# File 'lib/graphql/schema_comparator/changes.rb', line 769

def path
  [type.name, field.name, old_argument.name].join(".")
end