Exception: GraphQL::ParseError
- Defined in:
- lib/graphql/parse_error.rb
Instance Attribute Summary collapse
- 
  
    
      #col  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute col. 
- 
  
    
      #line  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute line. 
- 
  
    
      #query  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute query. 
Instance Method Summary collapse
- 
  
    
      #initialize(message, line, col, query, filename: nil)  ⇒ ParseError 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of ParseError. 
- 
  
    
      #to_h  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Constructor Details
#initialize(message, line, col, query, filename: nil) ⇒ ParseError
Returns a new instance of ParseError.
| 5 6 7 8 9 10 11 12 13 14 | # File 'lib/graphql/parse_error.rb', line 5 def initialize(, line, col, query, filename: nil) if filename += " (#{filename})" end super() @line = line @col = col @query = query end | 
Instance Attribute Details
#col ⇒ Object (readonly)
Returns the value of attribute col.
| 4 5 6 | # File 'lib/graphql/parse_error.rb', line 4 def col @col end | 
#line ⇒ Object (readonly)
Returns the value of attribute line.
| 4 5 6 | # File 'lib/graphql/parse_error.rb', line 4 def line @line end | 
#query ⇒ Object (readonly)
Returns the value of attribute query.
| 4 5 6 | # File 'lib/graphql/parse_error.rb', line 4 def query @query end | 
Instance Method Details
#to_h ⇒ Object
| 16 17 18 19 20 21 22 | # File 'lib/graphql/parse_error.rb', line 16 def to_h locations = line ? [{ "line" => line, "column" => col }] : [] { "message" => , "locations" => locations, } end |