Class: GraphQL::SchemaComparator::Changes::FieldArgumentRemoved

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(object_type, field, argument) ⇒ FieldArgumentRemoved

Returns a new instance of FieldArgumentRemoved.



152
153
154
155
156
157
# File 'lib/graphql/schema_comparator/changes.rb', line 152

def initialize(object_type, field, argument)
  @object_type = object_type
  @field = field
  @argument = argument
  @criticality = Changes::Criticality.breaking
end

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument.



150
151
152
# File 'lib/graphql/schema_comparator/changes.rb', line 150

def argument
  @argument
end

#criticalityObject (readonly)

Returns the value of attribute criticality.



150
151
152
# File 'lib/graphql/schema_comparator/changes.rb', line 150

def criticality
  @criticality
end

#fieldObject (readonly)

Returns the value of attribute field.



150
151
152
# File 'lib/graphql/schema_comparator/changes.rb', line 150

def field
  @field
end

#object_typeObject (readonly)

Returns the value of attribute object_type.



150
151
152
# File 'lib/graphql/schema_comparator/changes.rb', line 150

def object_type
  @object_type
end

Instance Method Details

#messageObject



159
160
161
# File 'lib/graphql/schema_comparator/changes.rb', line 159

def message
  "Argument `#{argument.name}: #{argument.type}` was removed from field `#{object_type.name}.#{field.name}`"
end

#pathObject



163
164
165
# File 'lib/graphql/schema_comparator/changes.rb', line 163

def path
  [object_type.name, field.name, argument.name].join('.')
end