Class: GraphQL::StaticValidation::OperationNamesAreValidError
- Defined in:
 - lib/graphql/static_validation/rules/operation_names_are_valid_error.rb
 
Instance Attribute Summary collapse
- 
  
    
      #operation_name  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
Returns the value of attribute operation_name.
 
Attributes inherited from Error
Instance Method Summary collapse
- 
  
    
      #code  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
 - 
  
    
      #initialize(message, path: nil, nodes: [], name: nil)  ⇒ OperationNamesAreValidError 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of OperationNamesAreValidError.
 - 
  
    
      #to_h  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
A hash representation of this Message.
 
Constructor Details
#initialize(message, path: nil, nodes: [], name: nil) ⇒ OperationNamesAreValidError
Returns a new instance of OperationNamesAreValidError.
      7 8 9 10  | 
    
      # File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 7 def initialize(, path: nil, nodes: [], name: nil) super(, path: path, nodes: nodes) @operation_name = name end  | 
  
Instance Attribute Details
#operation_name ⇒ Object (readonly)
Returns the value of attribute operation_name.
      5 6 7  | 
    
      # File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 5 def operation_name @operation_name end  | 
  
Instance Method Details
#code ⇒ Object
      23 24 25  | 
    
      # File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 23 def code "uniquelyNamedOperations" end  | 
  
#to_h ⇒ Object
A hash representation of this Message
      13 14 15 16 17 18 19 20 21  | 
    
      # File 'lib/graphql/static_validation/rules/operation_names_are_valid_error.rb', line 13 def to_h extensions = { "code" => code }.tap { |h| h["operationName"] = operation_name unless operation_name.nil? } super.merge({ "extensions" => extensions }) end  |