1 | function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
2 |
|
3 | function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
4 |
|
5 | import { SYMBOL_TO_STRING_TAG } from "../polyfills/symbols.mjs";
|
6 | import inspect from "../jsutils/inspect.mjs";
|
7 | import devAssert from "../jsutils/devAssert.mjs";
|
8 | import instanceOf from "../jsutils/instanceOf.mjs";
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | export var Source = function () {
|
18 | function Source(body) {
|
19 | var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';
|
20 | var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
21 | line: 1,
|
22 | column: 1
|
23 | };
|
24 | typeof body === 'string' || devAssert(0, "Body must be a string. Received: ".concat(inspect(body), "."));
|
25 | this.body = body;
|
26 | this.name = name;
|
27 | this.locationOffset = locationOffset;
|
28 | this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');
|
29 | this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');
|
30 | }
|
31 |
|
32 |
|
33 | _createClass(Source, [{
|
34 | key: SYMBOL_TO_STRING_TAG,
|
35 | get: function get() {
|
36 | return 'Source';
|
37 | }
|
38 | }]);
|
39 |
|
40 | return Source;
|
41 | }();
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 | export function isSource(source) {
|
50 | return instanceOf(source, Source);
|
51 | }
|