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

Methods inherited from AbstractChange

#breaking?, #dangerous?, #non_breaking?

Constructor Details

#initialize(type, old_field, new_field) ⇒ FieldDeprecationChanged

Returns a new instance of FieldDeprecationChanged.


825
826
827
828
829
830
# File 'lib/graphql/schema_comparator/changes.rb', line 825

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


823
824
825
# File 'lib/graphql/schema_comparator/changes.rb', line 823

def criticality
  @criticality
end

#new_fieldObject (readonly)

Returns the value of attribute new_field


823
824
825
# File 'lib/graphql/schema_comparator/changes.rb', line 823

def new_field
  @new_field
end

#old_fieldObject (readonly)

Returns the value of attribute old_field


823
824
825
# File 'lib/graphql/schema_comparator/changes.rb', line 823

def old_field
  @old_field
end

#typeObject (readonly)

Returns the value of attribute type


823
824
825
# File 'lib/graphql/schema_comparator/changes.rb', line 823

def type
  @type
end

Instance Method Details

#messageObject


832
833
834
835
# File 'lib/graphql/schema_comparator/changes.rb', line 832

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

#pathObject


837
838
839
# File 'lib/graphql/schema_comparator/changes.rb', line 837

def path
  [type.graphql_definition, old_field.graphql_name].join(".")
end