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.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/graphql/parse_error.rb', line 6 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.
5 6 7 |
# File 'lib/graphql/parse_error.rb', line 5 def col @col end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
5 6 7 |
# File 'lib/graphql/parse_error.rb', line 5 def line @line end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
5 6 7 |
# File 'lib/graphql/parse_error.rb', line 5 def query @query end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/graphql/parse_error.rb', line 17 def to_h locations = line ? [{ "line" => line, "column" => col }] : [] { "message" => , "locations" => locations, } end |