Class: GraphQL::SchemaComparator::Changes::FieldDescriptionChanged

Inherits:
AbstractChange
  • Object
show all
Defined in:
lib/graphql/schema_comparator/changes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, old_field, new_field) ⇒ FieldDescriptionChanged

Returns a new instance of FieldDescriptionChanged.



371
372
373
374
375
376
# File 'lib/graphql/schema_comparator/changes.rb', line 371

def initialize(type, old_field, new_field)
  @type = type
  @old_field = old_field
  @new_field = new_field
  @breaking = false
end

Instance Attribute Details

#new_fieldObject (readonly)

Returns the value of attribute new_field.



369
370
371
# File 'lib/graphql/schema_comparator/changes.rb', line 369

def new_field
  @new_field
end

#old_fieldObject (readonly)

Returns the value of attribute old_field.



369
370
371
# File 'lib/graphql/schema_comparator/changes.rb', line 369

def old_field
  @old_field
end

#typeObject (readonly)

Returns the value of attribute type.



369
370
371
# File 'lib/graphql/schema_comparator/changes.rb', line 369

def type
  @type
end

Instance Method Details

#breaking?Boolean

Returns:

  • (Boolean)


383
384
385
# File 'lib/graphql/schema_comparator/changes.rb', line 383

def breaking?
  !!@breaking
end

#messageObject



378
379
380
381
# File 'lib/graphql/schema_comparator/changes.rb', line 378

def message
  "Field `#{type.name}.#{old_field.name}` description changed"\
    " from `#{old_field.description}` to `#{new_field.description}`"
end