Class: GraphQL::StaticValidation::ArgumentLiteralsAreCompatibleError
- Defined in:
- lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb
Instance Attribute Summary collapse
- 
  
    
      #argument  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute argument. 
- 
  
    
      #argument_name  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute argument_name. 
- 
  
    
      #type_name  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute type_name. 
- 
  
    
      #value  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute value. 
Attributes inherited from Error
Instance Method Summary collapse
- 
  
    
      #code  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
- 
  
    
      #initialize(message, path: nil, nodes: [], type:, argument_name: nil, extensions: nil, coerce_extensions: nil, argument: nil, value: nil)  ⇒ ArgumentLiteralsAreCompatibleError 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of ArgumentLiteralsAreCompatibleError. 
- 
  
    
      #to_h  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    A hash representation of this Message. 
Constructor Details
#initialize(message, path: nil, nodes: [], type:, argument_name: nil, extensions: nil, coerce_extensions: nil, argument: nil, value: nil) ⇒ ArgumentLiteralsAreCompatibleError
Returns a new instance of ArgumentLiteralsAreCompatibleError.
| 10 11 12 13 14 15 16 17 18 | # File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 10 def initialize(, path: nil, nodes: [], type:, argument_name: nil, extensions: nil, coerce_extensions: nil, argument: nil, value: nil) super(, path: path, nodes: nodes) @type_name = type @argument_name = argument_name @extensions = extensions @coerce_extensions = coerce_extensions @argument = argument @value = value end | 
Instance Attribute Details
#argument ⇒ Object (readonly)
Returns the value of attribute argument.
| 7 8 9 | # File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 7 def argument @argument end | 
#argument_name ⇒ Object (readonly)
Returns the value of attribute argument_name.
| 6 7 8 | # File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 6 def argument_name @argument_name end | 
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
| 5 6 7 | # File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 5 def type_name @type_name end | 
#value ⇒ Object (readonly)
Returns the value of attribute value.
| 8 9 10 | # File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 8 def value @value end | 
Instance Method Details
#code ⇒ Object
| 43 44 45 | # File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 43 def code "argumentLiteralsIncompatible" end | 
#to_h ⇒ Object
A hash representation of this Message
| 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # File 'lib/graphql/static_validation/rules/argument_literals_are_compatible_error.rb', line 21 def to_h if @coerce_extensions extensions = @coerce_extensions # This is for legacy compat -- but this key is supposed to be a GraphQL type name :confounded: extensions["typeName"] = "CoercionError" else extensions = { "code" => code, "typeName" => type_name } if argument_name extensions["argumentName"] = argument_name end end extensions.merge!(@extensions) unless @extensions.nil? super.merge({ "extensions" => extensions }) end |