File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ export function syntaxError(
26
26
const column = location . column + source . locationOffset . column - 1 ;
27
27
const error = new GraphQLError (
28
28
`Syntax Error ${ source . name } (${ line } :${ column } ) ${ description } ` +
29
- '\n\n' +
30
- highlightSourceAtLocation ( source , location ) ,
29
+ '\n\n' + highlightSourceAtLocation ( source , location ) ,
31
30
undefined ,
32
31
source ,
33
32
[ position ]
@@ -54,7 +53,7 @@ function highlightSourceAtLocation(source, location) {
54
53
( line >= 2 ?
55
54
lpad ( padLen , prevLineNum ) + ': ' + lines [ line - 2 ] + '\n' : '' ) +
56
55
lpad ( padLen , lineNum ) + ': ' + lines [ line - 1 ] + '\n' +
57
- whitespace ( 2 + padLen + location . column + columnOffset - 1 ) + '^\n' +
56
+ whitespace ( 2 + padLen + location . column - 1 + columnOffset ) + '^\n' +
58
57
( line < lines . length ?
59
58
lpad ( padLen , nextLineNum ) + ': ' + lines [ line ] + '\n' : '' )
60
59
) ;
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ type Location = {
21
21
* store GraphQL documents in source files; for example, if the GraphQL input
22
22
* starts at line 40 in a file named Foo.graphql, it might be useful for name to
23
23
* be "Foo.graphql" and location to be `{ line: 40, column: 0 }`.
24
- * line and columns in locationOffset are 1-indexed
24
+ * line and column in locationOffset are 1-indexed
25
25
*/
26
26
export class Source {
27
27
body : string ;
You can’t perform that action at this time.
0 commit comments