class GraphQL::SchemaComparator::Changes::DirectiveArgumentTypeChanged

Attributes

criticality[R]
directive[R]
new_argument[R]
old_argument[R]

Public Class Methods

new(directive, old_argument, new_argument) click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 377
def initialize(directive, old_argument, new_argument)
  if safe_change_for_input_value?(old_argument.type, new_argument.type)
    @criticality = Changes::Criticality.non_breaking(
      reason: "Changing an input field from non-null to null is considered non-breaking"
    )
  else
    @criticality = Changes::Criticality.breaking
  end

  @directive = directive
  @old_argument = old_argument
  @new_argument = new_argument
end

Public Instance Methods

message() click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 391
def message
  "Type for argument `#{new_argument.graphql_name}` on directive `#{directive.graphql_name}` changed"\
    " from `#{old_argument.type.graphql_definition}` to `#{new_argument.type.graphql_definition}`"
end
path() click to toggle source
# File lib/graphql/schema_comparator/changes.rb, line 396
def path
  ["@#{directive.graphql_name}", old_argument.graphql_name].join('.')
end