Skip to content

Commit 501f2c0

Browse files
author
Daniel Woelfel
committed
cleanup
1 parent 250e6f0 commit 501f2c0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/error/syntaxError.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export function syntaxError(
2626
const column = location.column + source.locationOffset.column - 1;
2727
const error = new GraphQLError(
2828
`Syntax Error ${source.name} (${line}:${column}) ${description}` +
29-
'\n\n' +
30-
highlightSourceAtLocation(source, location),
29+
'\n\n' + highlightSourceAtLocation(source, location),
3130
undefined,
3231
source,
3332
[ position ]
@@ -54,7 +53,7 @@ function highlightSourceAtLocation(source, location) {
5453
(line >= 2 ?
5554
lpad(padLen, prevLineNum) + ': ' + lines[line - 2] + '\n' : '') +
5655
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' +
5857
(line < lines.length ?
5958
lpad(padLen, nextLineNum) + ': ' + lines[line] + '\n' : '')
6059
);

src/language/source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type Location = {
2121
* store GraphQL documents in source files; for example, if the GraphQL input
2222
* starts at line 40 in a file named Foo.graphql, it might be useful for name to
2323
* 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
2525
*/
2626
export class Source {
2727
body: string;

0 commit comments

Comments
 (0)