graphql-jit 0.8.9 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/README.md +25 -0
  2. package/dist/cjs/ast.d.ts +89 -0
  3. package/dist/cjs/ast.js +766 -0
  4. package/dist/cjs/ast.js.map +1 -0
  5. package/dist/cjs/compat.d.ts +70 -0
  6. package/dist/cjs/compat.js +144 -0
  7. package/dist/cjs/compat.js.map +1 -0
  8. package/dist/cjs/debug.d.ts +29 -0
  9. package/dist/cjs/debug.js +46 -0
  10. package/dist/cjs/debug.js.map +1 -0
  11. package/dist/cjs/error.d.ts +7 -0
  12. package/dist/cjs/error.js +58 -0
  13. package/dist/cjs/error.js.map +1 -0
  14. package/dist/cjs/execution.d.ts +154 -0
  15. package/dist/cjs/execution.js +1240 -0
  16. package/dist/cjs/execution.js.map +1 -0
  17. package/dist/cjs/generate.d.ts +4 -0
  18. package/dist/cjs/generate.js +13 -0
  19. package/dist/cjs/generate.js.map +1 -0
  20. package/dist/cjs/index.d.ts +3 -0
  21. package/dist/cjs/index.js +10 -0
  22. package/dist/cjs/index.js.map +1 -0
  23. package/dist/cjs/inspect.d.ts +5 -0
  24. package/dist/cjs/inspect.js +110 -0
  25. package/dist/cjs/inspect.js.map +1 -0
  26. package/dist/cjs/json.d.ts +9 -0
  27. package/dist/cjs/json.js +144 -0
  28. package/dist/cjs/json.js.map +1 -0
  29. package/dist/cjs/memoize.d.ts +5 -0
  30. package/dist/cjs/memoize.js +28 -0
  31. package/dist/cjs/memoize.js.map +1 -0
  32. package/dist/cjs/non-null.d.ts +9 -0
  33. package/dist/cjs/non-null.js +205 -0
  34. package/dist/cjs/non-null.js.map +1 -0
  35. package/dist/cjs/package.json +3 -0
  36. package/dist/{resolve-info.d.ts → cjs/resolve-info.d.ts} +10 -12
  37. package/dist/cjs/resolve-info.js +232 -0
  38. package/dist/cjs/resolve-info.js.map +1 -0
  39. package/dist/cjs/runtime.d.ts +14 -0
  40. package/dist/cjs/runtime.js +92 -0
  41. package/dist/cjs/runtime.js.map +1 -0
  42. package/dist/cjs/types.d.ts +1 -0
  43. package/dist/cjs/types.js +3 -0
  44. package/dist/cjs/types.js.map +1 -0
  45. package/dist/cjs/variables.d.ts +20 -0
  46. package/dist/cjs/variables.js +357 -0
  47. package/dist/cjs/variables.js.map +1 -0
  48. package/dist/esm/ast.d.ts +89 -0
  49. package/dist/esm/ast.js +751 -0
  50. package/dist/esm/ast.js.map +1 -0
  51. package/dist/esm/compat.d.ts +70 -0
  52. package/dist/esm/compat.js +102 -0
  53. package/dist/esm/compat.js.map +1 -0
  54. package/dist/esm/debug.d.ts +29 -0
  55. package/dist/esm/debug.js +40 -0
  56. package/dist/esm/debug.js.map +1 -0
  57. package/dist/esm/error.d.ts +7 -0
  58. package/dist/esm/error.js +55 -0
  59. package/dist/esm/error.js.map +1 -0
  60. package/dist/esm/execution.d.ts +154 -0
  61. package/dist/esm/execution.js +1227 -0
  62. package/dist/esm/execution.js.map +1 -0
  63. package/dist/esm/generate.d.ts +4 -0
  64. package/dist/esm/generate.js +10 -0
  65. package/dist/esm/generate.js.map +1 -0
  66. package/dist/esm/index.d.ts +3 -0
  67. package/dist/esm/index.js +3 -0
  68. package/dist/esm/index.js.map +1 -0
  69. package/dist/esm/inspect.d.ts +5 -0
  70. package/dist/esm/inspect.js +106 -0
  71. package/dist/esm/inspect.js.map +1 -0
  72. package/dist/esm/json.d.ts +9 -0
  73. package/dist/esm/json.js +141 -0
  74. package/dist/esm/json.js.map +1 -0
  75. package/dist/esm/memoize.d.ts +5 -0
  76. package/dist/esm/memoize.js +20 -0
  77. package/dist/esm/memoize.js.map +1 -0
  78. package/dist/esm/non-null.d.ts +9 -0
  79. package/dist/esm/non-null.js +199 -0
  80. package/dist/esm/non-null.js.map +1 -0
  81. package/dist/esm/package.json +3 -0
  82. package/dist/{resolve-info.d.mts → esm/resolve-info.d.ts} +10 -12
  83. package/dist/esm/resolve-info.js +224 -0
  84. package/dist/esm/resolve-info.js.map +1 -0
  85. package/dist/esm/runtime.d.ts +14 -0
  86. package/dist/esm/runtime.js +89 -0
  87. package/dist/esm/runtime.js.map +1 -0
  88. package/dist/esm/types.d.ts +1 -0
  89. package/dist/esm/types.js +2 -0
  90. package/dist/esm/types.js.map +1 -0
  91. package/dist/esm/variables.d.ts +20 -0
  92. package/dist/esm/variables.js +350 -0
  93. package/dist/esm/variables.js.map +1 -0
  94. package/package.json +39 -35
  95. package/dist/ast.d.mts +0 -7
  96. package/dist/ast.d.ts +0 -7
  97. package/dist/ast.js +0 -635
  98. package/dist/ast.js.map +0 -1
  99. package/dist/ast.mjs +0 -612
  100. package/dist/ast.mjs.map +0 -1
  101. package/dist/compat.d.mts +0 -7
  102. package/dist/compat.d.ts +0 -7
  103. package/dist/compat.js +0 -113
  104. package/dist/compat.js.map +0 -1
  105. package/dist/compat.mjs +0 -75
  106. package/dist/compat.mjs.map +0 -1
  107. package/dist/error.d.mts +0 -11
  108. package/dist/error.d.ts +0 -11
  109. package/dist/error.js +0 -79
  110. package/dist/error.js.map +0 -1
  111. package/dist/error.mjs +0 -57
  112. package/dist/error.mjs.map +0 -1
  113. package/dist/execution.d.mts +0 -7
  114. package/dist/execution.d.ts +0 -7
  115. package/dist/execution.js +0 -1262
  116. package/dist/execution.js.map +0 -1
  117. package/dist/execution.mjs +0 -1248
  118. package/dist/execution.mjs.map +0 -1
  119. package/dist/generate.d.mts +0 -6
  120. package/dist/generate.d.ts +0 -6
  121. package/dist/generate.js +0 -37
  122. package/dist/generate.js.map +0 -1
  123. package/dist/generate.mjs +0 -13
  124. package/dist/generate.mjs.map +0 -1
  125. package/dist/index-CeluTkd4.d.mts +0 -329
  126. package/dist/index-mKv2zpdA.d.ts +0 -329
  127. package/dist/index.d.mts +0 -7
  128. package/dist/index.d.ts +0 -7
  129. package/dist/index.js +0 -36
  130. package/dist/index.js.map +0 -1
  131. package/dist/index.mjs +0 -15
  132. package/dist/index.mjs.map +0 -1
  133. package/dist/inspect.d.mts +0 -7
  134. package/dist/inspect.d.ts +0 -7
  135. package/dist/inspect.js +0 -121
  136. package/dist/inspect.js.map +0 -1
  137. package/dist/inspect.mjs +0 -97
  138. package/dist/inspect.mjs.map +0 -1
  139. package/dist/json.d.mts +0 -18
  140. package/dist/json.d.ts +0 -18
  141. package/dist/json.js +0 -181
  142. package/dist/json.js.map +0 -1
  143. package/dist/json.mjs +0 -164
  144. package/dist/json.mjs.map +0 -1
  145. package/dist/memoize.d.mts +0 -6
  146. package/dist/memoize.d.ts +0 -6
  147. package/dist/memoize.js +0 -67
  148. package/dist/memoize.js.map +0 -1
  149. package/dist/memoize.mjs +0 -31
  150. package/dist/memoize.mjs.map +0 -1
  151. package/dist/non-null.d.mts +0 -7
  152. package/dist/non-null.d.ts +0 -7
  153. package/dist/non-null.js +0 -196
  154. package/dist/non-null.js.map +0 -1
  155. package/dist/non-null.mjs +0 -167
  156. package/dist/non-null.mjs.map +0 -1
  157. package/dist/resolve-info.js +0 -245
  158. package/dist/resolve-info.js.map +0 -1
  159. package/dist/resolve-info.mjs +0 -219
  160. package/dist/resolve-info.mjs.map +0 -1
  161. package/dist/runtime.d.mts +0 -7
  162. package/dist/runtime.d.ts +0 -7
  163. package/dist/runtime.js +0 -115
  164. package/dist/runtime.js.map +0 -1
  165. package/dist/runtime.mjs +0 -91
  166. package/dist/runtime.mjs.map +0 -1
  167. package/dist/types.d.mts +0 -3
  168. package/dist/types.d.ts +0 -3
  169. package/dist/types.js +0 -17
  170. package/dist/types.js.map +0 -1
  171. package/dist/types.mjs +0 -1
  172. package/dist/types.mjs.map +0 -1
  173. package/dist/variables.d.mts +0 -17
  174. package/dist/variables.d.ts +0 -17
  175. package/dist/variables.js +0 -412
  176. package/dist/variables.js.map +0 -1
  177. package/dist/variables.mjs +0 -391
  178. package/dist/variables.mjs.map +0 -1
package/dist/variables.js DELETED
@@ -1,412 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var variables_exports = {};
30
- __export(variables_exports, {
31
- compileVariableParsing: () => compileVariableParsing,
32
- failToParseVariables: () => failToParseVariables
33
- });
34
- module.exports = __toCommonJS(variables_exports);
35
- var import_generate = require("./generate");
36
- var import_graphql = require("graphql");
37
- var import_ast = require("./ast.js");
38
- var import_error = require("./error.js");
39
- var import_compat = require("./compat.js");
40
- var import_inspect = __toESM(require("./inspect.js"));
41
- const inspect = (0, import_inspect.default)();
42
- function failToParseVariables(x) {
43
- return x.errors;
44
- }
45
- function createSubCompilationContext(context) {
46
- return { ...context };
47
- }
48
- function compileVariableParsing(schema, varDefNodes) {
49
- const errors = [];
50
- const coercedValues = /* @__PURE__ */ Object.create(null);
51
- let mainBody = "";
52
- const dependencies = /* @__PURE__ */ new Map();
53
- for (const varDefNode of varDefNodes) {
54
- const context = {
55
- varDefNode,
56
- depth: 0,
57
- inputPath: (0, import_ast.addPath)(void 0, "input"),
58
- responsePath: (0, import_ast.addPath)(void 0, "coerced"),
59
- dependencies
60
- };
61
- const varName = varDefNode.variable.name.value;
62
- const varType = (0, import_graphql.typeFromAST)(schema, varDefNode.type);
63
- if (!varType || !(0, import_graphql.isInputType)(varType)) {
64
- errors.push(
65
- new import_error.GraphQLError(
66
- `Variable "$${varName}" expected value of type "${varType || (0, import_graphql.print)(varDefNode.type)}" which cannot be used as an input type.`,
67
- (0, import_ast.computeLocations)([varDefNode.type])
68
- )
69
- );
70
- continue;
71
- }
72
- coercedValues[varName] = void 0;
73
- const hasValueName = hasValue((0, import_ast.addPath)(context.inputPath, varName));
74
- mainBody += `const ${hasValueName} = Object.prototype.hasOwnProperty.call(${getObjectPath(
75
- context.inputPath
76
- )}, "${varName}");
77
- `;
78
- context.inputPath = (0, import_ast.addPath)(context.inputPath, varName);
79
- context.responsePath = (0, import_ast.addPath)(context.responsePath, varName);
80
- mainBody += generateInput(
81
- context,
82
- varType,
83
- varName,
84
- hasValueName,
85
- (0, import_graphql.valueFromAST)(varDefNode.defaultValue, varType),
86
- false
87
- );
88
- }
89
- if (errors.length > 0) {
90
- throw errors;
91
- }
92
- const gen = (0, import_generate.genFn)();
93
- gen(`
94
- return function getVariables(input) {
95
- const errors = [];
96
- const coerced = ${JSON.stringify(coercedValues)}
97
- ${mainBody}
98
- if (errors.length > 0) {
99
- return {errors, coerced: undefined};
100
- }
101
- return {errors: undefined, coerced};
102
- }
103
- `);
104
- return Function.apply(
105
- null,
106
- ["GraphQLJITError", "inspect"].concat(Array.from(dependencies.keys())).concat(gen.toString())
107
- ).apply(
108
- null,
109
- [import_error.GraphQLError, inspect].concat(Array.from(dependencies.values()))
110
- );
111
- }
112
- const MAX_32BIT_INT = 2147483647;
113
- const MIN_32BIT_INT = -2147483648;
114
- function generateInput(context, varType, varName, hasValueName, defaultValue, wrapInList) {
115
- const currentOutput = getObjectPath(context.responsePath);
116
- const currentInput = getObjectPath(context.inputPath);
117
- const errorLocation = printErrorLocation(
118
- (0, import_ast.computeLocations)([context.varDefNode])
119
- );
120
- const gen = (0, import_generate.genFn)();
121
- gen(`if (${currentInput} == null) {`);
122
- if ((0, import_graphql.isNonNullType)(varType)) {
123
- let nonNullMessage;
124
- let omittedMessage;
125
- if (context.errorMessage) {
126
- const objectPath = printObjectPath(context.responsePath);
127
- nonNullMessage = `${context.errorMessage} + \`Expected non-nullable type ${varType} not to be null at ${objectPath}.\``;
128
- omittedMessage = `${context.errorMessage} + \`Field ${objectPath} of required type ${varType} was not provided.\``;
129
- } else {
130
- nonNullMessage = `'Variable "$${varName}" of non-null type "${varType}" must not be null.'`;
131
- omittedMessage = `'Variable "$${varName}" of required type "${varType}" was not provided.'`;
132
- }
133
- varType = varType.ofType;
134
- gen(`
135
- if (${currentOutput} == null) {
136
- errors.push(new GraphQLJITError(${hasValueName} ? ${nonNullMessage} : ${omittedMessage}, ${errorLocation}));
137
- }
138
- `);
139
- } else {
140
- gen(`
141
- if (${hasValueName}) { ${currentOutput} = null; }
142
- `);
143
- if (defaultValue !== void 0) {
144
- gen(`else { ${currentOutput} = ${JSON.stringify(defaultValue)} }`);
145
- }
146
- }
147
- gen(`} else {`);
148
- if ((0, import_graphql.isScalarType)(varType)) {
149
- switch (varType.name) {
150
- case import_graphql.GraphQLID.name:
151
- gen(`
152
- if (typeof ${currentInput} === "string") {
153
- ${currentOutput} = ${currentInput};
154
- } else if (Number.isInteger(${currentInput})) {
155
- ${currentOutput} = ${currentInput}.toString();
156
- } else {
157
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
158
- inspect(${currentInput}) + "; " +
159
- 'Expected type ${varType.name}; ' +
160
- '${varType.name} cannot represent value: ' +
161
- inspect(${currentInput}), ${errorLocation})
162
- );
163
- }
164
- `);
165
- break;
166
- case import_graphql.GraphQLString.name:
167
- gen(`
168
- if (typeof ${currentInput} === "string") {
169
- ${currentOutput} = ${currentInput};
170
- } else {
171
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
172
- inspect(${currentInput}) + "; " +
173
- 'Expected type ${varType.name}; ' +
174
- '${varType.name} cannot represent a non string value: ' +
175
- inspect(${currentInput}), ${errorLocation})
176
- );
177
- }
178
- `);
179
- break;
180
- case import_graphql.GraphQLBoolean.name:
181
- gen(`
182
- if (typeof ${currentInput} === "boolean") {
183
- ${currentOutput} = ${currentInput};
184
- } else {
185
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
186
- inspect(${currentInput}) + "; " +
187
- 'Expected type ${varType.name}; ' +
188
- '${varType.name} cannot represent a non boolean value: ' +
189
- inspect(${currentInput}), ${errorLocation}));
190
- }
191
- `);
192
- break;
193
- case import_graphql.GraphQLInt.name:
194
- gen(`
195
- if (Number.isInteger(${currentInput})) {
196
- if (${currentInput} > ${MAX_32BIT_INT} || ${currentInput} < ${MIN_32BIT_INT}) {
197
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
198
- inspect(${currentInput}) + "; " +
199
- 'Expected type ${varType.name}; ' +
200
- '${varType.name} cannot represent non 32-bit signed integer value: ' +
201
- inspect(${currentInput}), ${errorLocation}));
202
- } else {
203
- ${currentOutput} = ${currentInput};
204
- }
205
- } else {
206
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
207
- inspect(${currentInput}) + "; " +
208
- 'Expected type ${varType.name}; ' +
209
- '${varType.name} cannot represent non-integer value: ' +
210
- inspect(${currentInput}), ${errorLocation})
211
- );
212
- }
213
- `);
214
- break;
215
- case import_graphql.GraphQLFloat.name:
216
- gen(`
217
- if (Number.isFinite(${currentInput})) {
218
- ${currentOutput} = ${currentInput};
219
- } else {
220
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
221
- inspect(${currentInput}) + "; " +
222
- 'Expected type ${varType.name}; ' +
223
- '${varType.name} cannot represent non numeric value: ' +
224
- inspect(${currentInput}), ${errorLocation})
225
- );
226
- }
227
- `);
228
- break;
229
- default:
230
- context.dependencies.set(
231
- `${varType.name}parseValue`,
232
- varType.parseValue.bind(varType)
233
- );
234
- gen(`
235
- try {
236
- const parseResult = ${varType.name}parseValue(${currentInput});
237
- if (parseResult === undefined || parseResult !== parseResult) {
238
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
239
- inspect(${currentInput}) + "; " +
240
- 'Expected type ${varType.name}.', ${errorLocation}));
241
- }
242
- ${currentOutput} = parseResult;
243
- } catch (error) {
244
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
245
- inspect(${currentInput}) + "; " +
246
- 'Expected type ${varType.name}.', ${errorLocation}, undefined, error)
247
- );
248
- }
249
- `);
250
- }
251
- } else if ((0, import_graphql.isEnumType)(varType)) {
252
- context.dependencies.set(
253
- `${varType.name}getValue`,
254
- varType.getValue.bind(varType)
255
- );
256
- gen(`
257
- if (typeof ${currentInput} === "string") {
258
- const enumValue = ${varType.name}getValue(${currentInput});
259
- if (enumValue) {
260
- ${currentOutput} = enumValue.value;
261
- } else {
262
- errors.push(
263
- new GraphQLJITError('Variable "$${varName}" got invalid value ' +
264
- inspect(${currentInput}) + "; " +
265
- 'Expected type ${varType.name}.', ${errorLocation})
266
- );
267
- }
268
- } else {
269
- errors.push(
270
- new GraphQLJITError('Variable "$${varName}" got invalid value ' +
271
- inspect(${currentInput}) + "; " +
272
- 'Expected type ${varType.name}.', ${errorLocation})
273
- );
274
- }
275
- `);
276
- } else if ((0, import_graphql.isListType)(varType)) {
277
- context.errorMessage = `'Variable "$${varName}" got invalid value ' + inspect(${currentInput}) + '; '`;
278
- const hasValueName2 = hasValue(context.inputPath);
279
- const index = `idx${context.depth}`;
280
- const subContext = createSubCompilationContext(context);
281
- subContext.responsePath = (0, import_ast.addPath)(
282
- subContext.responsePath,
283
- index,
284
- "variable"
285
- );
286
- subContext.inputPath = (0, import_ast.addPath)(subContext.inputPath, index, "variable");
287
- subContext.depth++;
288
- gen(`
289
- if (Array.isArray(${currentInput})) {
290
- ${currentOutput} = [];
291
- for (let ${index} = 0; ${index} < ${currentInput}.length; ++${index}) {
292
- const ${hasValueName2} =
293
- ${getObjectPath(subContext.inputPath)} !== undefined;
294
- ${generateInput(
295
- subContext,
296
- varType.ofType,
297
- varName,
298
- hasValueName2,
299
- void 0,
300
- false
301
- )}
302
- }
303
- } else {
304
- ${generateInput(
305
- context,
306
- varType.ofType,
307
- varName,
308
- hasValueName2,
309
- void 0,
310
- true
311
- )}
312
- }
313
- `);
314
- } else if ((0, import_graphql.isInputType)(varType)) {
315
- gen(`
316
- if (typeof ${currentInput} !== 'object') {
317
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
318
- inspect(${currentInput}) + "; " +
319
- 'Expected type ${varType.name} to be an object.', ${errorLocation}));
320
- } else {
321
- ${currentOutput} = {};
322
- `);
323
- const fields = varType.getFields();
324
- const allowedFields = [];
325
- for (const field of Object.values(fields)) {
326
- const subContext = createSubCompilationContext(context);
327
- allowedFields.push(field.name);
328
- const hasValueName2 = hasValue((0, import_ast.addPath)(subContext.inputPath, field.name));
329
- gen(`
330
- const ${hasValueName2} = Object.prototype.hasOwnProperty.call(
331
- ${getObjectPath(subContext.inputPath)}, "${field.name}"
332
- );
333
- `);
334
- subContext.inputPath = (0, import_ast.addPath)(subContext.inputPath, field.name);
335
- subContext.responsePath = (0, import_ast.addPath)(subContext.responsePath, field.name);
336
- subContext.errorMessage = `'Variable "$${varName}" got invalid value ' + inspect(${currentInput}) + '; '`;
337
- gen(`
338
- ${generateInput(
339
- subContext,
340
- field.type,
341
- field.name,
342
- hasValueName2,
343
- (0, import_compat.hasDefaultValue)(field) ? (0, import_compat.getDefaultValue)(field) : void 0,
344
- false
345
- )}
346
- `);
347
- }
348
- gen(`
349
- const allowedFields = ${JSON.stringify(allowedFields)};
350
- for (const fieldName of Object.keys(${currentInput})) {
351
- if (!allowedFields.includes(fieldName)) {
352
- errors.push(new GraphQLJITError('Variable "$${varName}" got invalid value ' +
353
- inspect(${currentInput}) + "; " +
354
- 'Field "' + fieldName + '" is not defined by type ${varType.name}.', ${errorLocation}));
355
- break;
356
- }
357
- }
358
- }`);
359
- } else {
360
- throw new Error(`unknown type: ${varType}`);
361
- }
362
- if (wrapInList) {
363
- gen(`${currentOutput} = [${currentOutput}];`);
364
- }
365
- gen(`}`);
366
- return gen.toString();
367
- }
368
- function hasValue(path) {
369
- const flattened = [];
370
- let curr = path;
371
- while (curr) {
372
- flattened.push(curr.key);
373
- curr = curr.prev;
374
- }
375
- return `hasValue${flattened.join("_")}`;
376
- }
377
- function printErrorLocation(location) {
378
- return JSON.stringify(location);
379
- }
380
- function getObjectPath(path) {
381
- const flattened = [];
382
- let curr = path;
383
- while (curr) {
384
- flattened.unshift({ key: curr.key, type: curr.type });
385
- curr = curr.prev;
386
- }
387
- let name = flattened[0].key;
388
- for (let i = 1; i < flattened.length; ++i) {
389
- name += flattened[i].type === "literal" ? `["${flattened[i].key}"]` : `[${flattened[i].key}]`;
390
- }
391
- return name;
392
- }
393
- function printObjectPath(path) {
394
- const flattened = [];
395
- let curr = path;
396
- while (curr) {
397
- flattened.unshift({ key: curr.key, type: curr.type });
398
- curr = curr.prev;
399
- }
400
- const initialIndex = Math.min(flattened.length - 1, 1);
401
- let name = "value";
402
- for (let i = initialIndex + 1; i < flattened.length; ++i) {
403
- name += flattened[i].type === "literal" ? `.${flattened[i].key}` : `[\${${flattened[i].key}}]`;
404
- }
405
- return name;
406
- }
407
- // Annotate the CommonJS export names for ESM import in node:
408
- 0 && (module.exports = {
409
- compileVariableParsing,
410
- failToParseVariables
411
- });
412
- //# sourceMappingURL=variables.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/variables.ts"],"sourcesContent":["import { genFn } from \"./generate\";\nimport {\n GraphQLBoolean,\n GraphQLError,\n GraphQLFloat,\n GraphQLID,\n type GraphQLInputType,\n GraphQLInt,\n GraphQLSchema,\n GraphQLString,\n isEnumType,\n isInputType,\n isListType,\n isNonNullType,\n isScalarType,\n print,\n type SourceLocation,\n typeFromAST,\n valueFromAST,\n type VariableDefinitionNode\n} from \"graphql\";\nimport { addPath, computeLocations, type ObjectPath } from \"./ast.js\";\nimport { GraphQLError as GraphQLJITError } from \"./error.js\";\nimport { getDefaultValue, hasDefaultValue } from \"./compat.js\";\nimport createInspect from \"./inspect.js\";\n\nconst inspect = createInspect();\n\ninterface FailedVariableCoercion {\n errors: ReadonlyArray<GraphQLError>;\n}\n\ninterface VariableValues {\n coerced: { [key: string]: any };\n}\n\nexport type CoercedVariableValues = FailedVariableCoercion | VariableValues;\n\nexport function failToParseVariables(x: any): x is FailedVariableCoercion {\n return x.errors;\n}\n\ninterface CompilationContext {\n inputPath: ObjectPath;\n responsePath: ObjectPath;\n depth: number;\n varDefNode: VariableDefinitionNode;\n dependencies: Map<string, (...args: any[]) => any>;\n errorMessage?: string;\n}\n\nfunction createSubCompilationContext(\n context: CompilationContext\n): CompilationContext {\n return { ...context };\n}\nexport function compileVariableParsing(\n schema: GraphQLSchema,\n varDefNodes: ReadonlyArray<VariableDefinitionNode>\n): (inputs: { [key: string]: any }) => CoercedVariableValues {\n const errors = [];\n const coercedValues: { [key: string]: any } = Object.create(null);\n\n let mainBody = \"\";\n const dependencies = new Map();\n for (const varDefNode of varDefNodes) {\n const context: CompilationContext = {\n varDefNode,\n depth: 0,\n inputPath: addPath(undefined, \"input\"),\n responsePath: addPath(undefined, \"coerced\"),\n dependencies\n };\n const varName = varDefNode.variable.name.value;\n const varType = typeFromAST(schema, varDefNode.type as any);\n if (!varType || !isInputType(varType)) {\n // Must use input types for variables. This should be caught during\n // validation, however is checked again here for safety.\n errors.push(\n new (GraphQLJITError as any)(\n `Variable \"$${varName}\" expected value of type ` +\n `\"${\n varType || print(varDefNode.type)\n }\" which cannot be used as an input type.`,\n computeLocations([varDefNode.type])\n )\n );\n continue;\n }\n\n // Ensure a constant shape of the input map\n coercedValues[varName] = undefined;\n const hasValueName = hasValue(addPath(context.inputPath, varName));\n mainBody += `const ${hasValueName} = Object.prototype.hasOwnProperty.call(${getObjectPath(\n context.inputPath\n )}, \"${varName}\");\\n`;\n context.inputPath = addPath(context.inputPath, varName);\n context.responsePath = addPath(context.responsePath, varName);\n mainBody += generateInput(\n context,\n varType,\n varName,\n hasValueName,\n valueFromAST(varDefNode.defaultValue, varType),\n false\n );\n }\n\n if (errors.length > 0) {\n throw errors;\n }\n\n const gen = genFn();\n gen(`\n return function getVariables(input) {\n const errors = [];\n const coerced = ${JSON.stringify(coercedValues)}\n ${mainBody}\n if (errors.length > 0) {\n return {errors, coerced: undefined};\n }\n return {errors: undefined, coerced};\n }\n `);\n\n // eslint-disable-next-line\n return Function.apply(\n null,\n [\"GraphQLJITError\", \"inspect\"]\n .concat(Array.from(dependencies.keys()))\n .concat(gen.toString())\n ).apply(\n null,\n [GraphQLJITError, inspect].concat(Array.from(dependencies.values()))\n );\n}\n\n// Int Scalars represent 32 bits\n// https://graphql.github.io/graphql-spec/June2018/#sec-Int\nconst MAX_32BIT_INT = 2147483647;\nconst MIN_32BIT_INT = -2147483648;\n\nfunction generateInput(\n context: CompilationContext,\n varType: GraphQLInputType,\n varName: string,\n hasValueName: string,\n defaultValue: unknown | undefined,\n wrapInList: boolean\n) {\n const currentOutput = getObjectPath(context.responsePath);\n const currentInput = getObjectPath(context.inputPath);\n const errorLocation = printErrorLocation(\n computeLocations([context.varDefNode])\n );\n\n const gen = genFn();\n gen(`if (${currentInput} == null) {`);\n\n if (isNonNullType(varType)) {\n let nonNullMessage;\n let omittedMessage;\n if (context.errorMessage) {\n const objectPath = printObjectPath(context.responsePath);\n nonNullMessage = `${context.errorMessage} + \\`Expected non-nullable type ${varType} not to be null at ${objectPath}.\\``;\n omittedMessage = `${context.errorMessage} + \\`Field ${objectPath} of required type ${varType} was not provided.\\``;\n } else {\n nonNullMessage = `'Variable \"$${varName}\" of non-null type \"${varType}\" must not be null.'`;\n omittedMessage = `'Variable \"$${varName}\" of required type \"${varType}\" was not provided.'`;\n }\n varType = varType.ofType;\n gen(`\n if (${currentOutput} == null) {\n errors.push(new GraphQLJITError(${hasValueName} ? ${nonNullMessage} : ${omittedMessage}, ${errorLocation}));\n }\n `);\n } else {\n gen(`\n if (${hasValueName}) { ${currentOutput} = null; }\n `);\n if (defaultValue !== undefined) {\n gen(`else { ${currentOutput} = ${JSON.stringify(defaultValue)} }`);\n }\n }\n gen(`} else {`);\n if (isScalarType(varType)) {\n switch (varType.name) {\n case GraphQLID.name:\n gen(`\n if (typeof ${currentInput} === \"string\") {\n ${currentOutput} = ${currentInput};\n } else if (Number.isInteger(${currentInput})) {\n ${currentOutput} = ${currentInput}.toString();\n } else {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}; ' +\n '${varType.name} cannot represent value: ' +\n inspect(${currentInput}), ${errorLocation})\n );\n }\n `);\n break;\n case GraphQLString.name:\n gen(`\n if (typeof ${currentInput} === \"string\") {\n ${currentOutput} = ${currentInput};\n } else {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}; ' +\n '${varType.name} cannot represent a non string value: ' +\n inspect(${currentInput}), ${errorLocation})\n );\n }\n `);\n break;\n case GraphQLBoolean.name:\n gen(`\n if (typeof ${currentInput} === \"boolean\") {\n ${currentOutput} = ${currentInput};\n } else {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}; ' +\n '${varType.name} cannot represent a non boolean value: ' +\n inspect(${currentInput}), ${errorLocation}));\n }\n `);\n break;\n case GraphQLInt.name:\n gen(`\n if (Number.isInteger(${currentInput})) {\n if (${currentInput} > ${MAX_32BIT_INT} || ${currentInput} < ${MIN_32BIT_INT}) {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}; ' +\n '${varType.name} cannot represent non 32-bit signed integer value: ' +\n inspect(${currentInput}), ${errorLocation}));\n } else {\n ${currentOutput} = ${currentInput};\n }\n } else {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}; ' +\n '${varType.name} cannot represent non-integer value: ' +\n inspect(${currentInput}), ${errorLocation})\n );\n }\n `);\n break;\n case GraphQLFloat.name:\n gen(`\n if (Number.isFinite(${currentInput})) {\n ${currentOutput} = ${currentInput};\n } else {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}; ' +\n '${varType.name} cannot represent non numeric value: ' +\n inspect(${currentInput}), ${errorLocation})\n );\n }\n `);\n break;\n default:\n context.dependencies.set(\n `${varType.name}parseValue`,\n varType.parseValue.bind(varType)\n );\n gen(`\n try {\n const parseResult = ${varType.name}parseValue(${currentInput});\n if (parseResult === undefined || parseResult !== parseResult) {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}.', ${errorLocation}));\n }\n ${currentOutput} = parseResult;\n } catch (error) {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}.', ${errorLocation}, undefined, error)\n );\n }\n `);\n }\n } else if (isEnumType(varType)) {\n context.dependencies.set(\n `${varType.name}getValue`,\n varType.getValue.bind(varType)\n );\n gen(`\n if (typeof ${currentInput} === \"string\") {\n const enumValue = ${varType.name}getValue(${currentInput});\n if (enumValue) {\n ${currentOutput} = enumValue.value;\n } else {\n errors.push(\n new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}.', ${errorLocation})\n );\n }\n } else {\n errors.push(\n new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name}.', ${errorLocation})\n );\n }\n `);\n } else if (isListType(varType)) {\n context.errorMessage = `'Variable \"$${varName}\" got invalid value ' + inspect(${currentInput}) + '; '`;\n const hasValueName = hasValue(context.inputPath);\n const index = `idx${context.depth}`;\n\n const subContext = createSubCompilationContext(context);\n subContext.responsePath = addPath(\n subContext.responsePath,\n index,\n \"variable\"\n );\n subContext.inputPath = addPath(subContext.inputPath, index, \"variable\");\n subContext.depth++;\n gen(`\n if (Array.isArray(${currentInput})) {\n ${currentOutput} = [];\n for (let ${index} = 0; ${index} < ${currentInput}.length; ++${index}) {\n const ${hasValueName} =\n ${getObjectPath(subContext.inputPath)} !== undefined;\n ${generateInput(\n subContext,\n varType.ofType,\n varName,\n hasValueName,\n undefined,\n false\n )}\n }\n } else {\n ${generateInput(\n context,\n varType.ofType,\n varName,\n hasValueName,\n undefined,\n true\n )}\n }\n `);\n } else if (isInputType(varType)) {\n gen(`\n if (typeof ${currentInput} !== 'object') {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Expected type ${varType.name} to be an object.', ${errorLocation}));\n } else {\n ${currentOutput} = {};\n `);\n const fields = varType.getFields();\n const allowedFields = [];\n for (const field of Object.values(fields)) {\n const subContext = createSubCompilationContext(context);\n allowedFields.push(field.name);\n const hasValueName = hasValue(addPath(subContext.inputPath, field.name));\n gen(`\n const ${hasValueName} = Object.prototype.hasOwnProperty.call(\n ${getObjectPath(subContext.inputPath)}, \"${field.name}\"\n );\n `);\n subContext.inputPath = addPath(subContext.inputPath, field.name);\n subContext.responsePath = addPath(subContext.responsePath, field.name);\n subContext.errorMessage = `'Variable \"$${varName}\" got invalid value ' + inspect(${currentInput}) + '; '`;\n gen(`\n ${generateInput(\n subContext,\n field.type,\n field.name,\n hasValueName,\n hasDefaultValue(field) ? getDefaultValue(field) : undefined,\n false\n )}\n `);\n }\n\n gen(`\n const allowedFields = ${JSON.stringify(allowedFields)};\n for (const fieldName of Object.keys(${currentInput})) {\n if (!allowedFields.includes(fieldName)) {\n errors.push(new GraphQLJITError('Variable \"$${varName}\" got invalid value ' +\n inspect(${currentInput}) + \"; \" +\n 'Field \"' + fieldName + '\" is not defined by type ${\n varType.name\n }.', ${errorLocation}));\n break;\n }\n }\n }`);\n } else {\n /* istanbul ignore next line */\n throw new Error(`unknown type: ${varType}`);\n }\n if (wrapInList) {\n gen(`${currentOutput} = [${currentOutput}];`);\n }\n gen(`}`);\n return gen.toString();\n}\n\nfunction hasValue(path: ObjectPath) {\n const flattened = [];\n let curr: ObjectPath | undefined = path;\n while (curr) {\n flattened.push(curr.key);\n curr = curr.prev;\n }\n return `hasValue${flattened.join(\"_\")}`;\n}\n\nfunction printErrorLocation(location: SourceLocation[]) {\n return JSON.stringify(location);\n}\n\nfunction getObjectPath(path: ObjectPath): string {\n const flattened = [];\n let curr: ObjectPath | undefined = path;\n while (curr) {\n flattened.unshift({ key: curr.key, type: curr.type });\n curr = curr.prev;\n }\n let name = flattened[0].key;\n for (let i = 1; i < flattened.length; ++i) {\n name +=\n flattened[i].type === \"literal\"\n ? `[\"${flattened[i].key}\"]`\n : `[${flattened[i].key}]`;\n }\n return name;\n}\n\nfunction printObjectPath(path: ObjectPath) {\n const flattened = [];\n let curr: ObjectPath | undefined = path;\n while (curr) {\n flattened.unshift({ key: curr.key, type: curr.type });\n curr = curr.prev;\n }\n const initialIndex = Math.min(flattened.length - 1, 1);\n let name = \"value\";\n for (let i = initialIndex + 1; i < flattened.length; ++i) {\n name +=\n flattened[i].type === \"literal\"\n ? `.${flattened[i].key}`\n : `[$\\{${flattened[i].key}}]`;\n }\n return name;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsB;AACtB,qBAmBO;AACP,iBAA2D;AAC3D,mBAAgD;AA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