class GraphQL::SchemaComparator::Changes::FieldRemoved

Attributes

criticality[R]
field[R]
object_type[R]

Public Class Methods

new(object_type, field) click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 219
def initialize(object_type, field)
  @object_type = object_type
  @field = field

  if field.deprecation_reason
    @criticality = Changes::Criticality.breaking(
      reason: "Removing a deprecated field is a breaking change. Before removing it, you may want" \
        "to look at the field's usage to see the impact of removing the field."
    )
  else
    @criticality = Changes::Criticality.breaking(
      reason: "Removing a field is a breaking change. It is preferable to deprecate the field before removing it."
    )
  end
end

Public Instance Methods

message() click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 235
def message
  "Field `#{field.graphql_name}` was removed from object type `#{object_type.graphql_definition}`"
end
path() click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 239
def path
  [object_type.graphql_definition, field.graphql_name].join('.')
end