Class: GraphQL::SchemaComparator::Changes::DirectiveArgumentAdded

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(directive, argument) ⇒ DirectiveArgumentAdded

Returns a new instance of DirectiveArgumentAdded


833
834
835
836
837
838
839
840
841
# File 'lib/graphql/schema_comparator/changes.rb', line 833

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

Instance Attribute Details

#argumentObject (readonly)

Returns the value of attribute argument


831
832
833
# File 'lib/graphql/schema_comparator/changes.rb', line 831

def argument
  @argument
end

#criticalityObject (readonly)

Returns the value of attribute criticality


831
832
833
# File 'lib/graphql/schema_comparator/changes.rb', line 831

def criticality
  @criticality
end

#directiveObject (readonly)

Returns the value of attribute directive


831
832
833
# File 'lib/graphql/schema_comparator/changes.rb', line 831

def directive
  @directive
end

Instance Method Details

#messageObject


843
844
845
# File 'lib/graphql/schema_comparator/changes.rb', line 843

def message
  "Argument `#{argument.name}` was added to directive `#{directive.name}`"
end