class GraphQL::SchemaComparator::Changes::InputFieldDefaultChanged

Attributes

criticality[R]
input_type[R]
new_field[R]
old_field[R]

Public Class Methods

new(input_type, old_field, new_field) click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 470
def initialize(input_type, old_field, new_field)
  @criticality = Changes::Criticality.dangerous(
    reason: "Changing the default value for an argument may change the runtime " \
      "behaviour of a field if it was never provided."
  )
  @input_type = input_type
  @old_field = old_field
  @new_field = new_field
end

Public Instance Methods

message() click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 480
def message
  "Input field `#{input_type.graphql_definition}.#{old_field.graphql_name}` default changed"\
    " from `#{old_field.default_value}` to `#{new_field.default_value}`"
end
path() click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 485
def path
  [input_type.graphql_definition, old_field.graphql_name].join(".")
end