Class: GraphQL::SchemaComparator::Changes::FieldArgumentAdded

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, argument) ⇒ FieldArgumentAdded

Returns a new instance of FieldArgumentAdded.



471
472
473
474
475
476
477
478
479
480
481
# File 'lib/graphql/schema_comparator/changes.rb', line 471

def initialize(type, field, argument)
  @criticality = if argument.type.non_null?
    Changes::Criticality.breaking
  else
    Changes::Criticality.non_breaking
  end

  @type = type
  @field = field
  @argument = argument
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



469
470
471
# File 'lib/graphql/schema_comparator/changes.rb', line 469

def argument
  @argument
end

#criticalityObject (readonly)

Returns the value of attribute criticality.



469
470
471
# File 'lib/graphql/schema_comparator/changes.rb', line 469

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field.



469
470
471
# File 'lib/graphql/schema_comparator/changes.rb', line 469

def field
  @field
end

#typeObject (readonly)

Returns the value of attribute type.



469
470
471
# File 'lib/graphql/schema_comparator/changes.rb', line 469

def type
  @type
end

Instance Method Details

#messageObject



483
484
485
# File 'lib/graphql/schema_comparator/changes.rb', line 483

def message
  "Argument `#{argument.name}: #{argument.type}` added to field `#{type.name}.#{field.name}`"
end