We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8da9203 commit 250e6f0Copy full SHA for 250e6f0
src/language/source.js
@@ -8,6 +8,8 @@
8
* of patent rights can be found in the PATENTS file in the same directory.
9
*/
10
11
+import invariant from '../jsutils/invariant';
12
+
13
type Location = {
14
line: number,
15
column: number,
@@ -30,5 +32,13 @@ export class Source {
30
32
this.body = body;
31
33
this.name = name || 'GraphQL request';
34
this.locationOffset = locationOffset || { line: 1, column: 1 };
35
+ invariant(
36
+ this.locationOffset.line > 0,
37
+ 'line in locationOffset is 1-indexed and must be positive'
38
+ );
39
40
+ this.locationOffset.column > 0,
41
+ 'column in locationOffset is 1-indexed and must be positive'
42
43
}
44
0 commit comments