@graphql-tools/utils 10.5.0 → 10.5.1
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.
|
@@ -352,39 +352,27 @@ function makeDeprecatedDirective(deprecationReason) {
|
|
|
352
352
|
exports.makeDeprecatedDirective = makeDeprecatedDirective;
|
|
353
353
|
function makeDirectiveNode(name, args, directive) {
|
|
354
354
|
const directiveArguments = [];
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
directiveArguments.push({
|
|
363
|
-
kind: graphql_1.Kind.ARGUMENT,
|
|
364
|
-
name: {
|
|
365
|
-
kind: graphql_1.Kind.NAME,
|
|
366
|
-
value: argName,
|
|
367
|
-
},
|
|
368
|
-
value,
|
|
369
|
-
});
|
|
370
|
-
}
|
|
355
|
+
for (const argName in args) {
|
|
356
|
+
const argValue = args[argName];
|
|
357
|
+
let value;
|
|
358
|
+
if (directive != null) {
|
|
359
|
+
const arg = directive.args.find(arg => arg.name === argName);
|
|
360
|
+
if (arg) {
|
|
361
|
+
value = (0, astFromValue_js_1.astFromValue)(argValue, arg.type);
|
|
371
362
|
}
|
|
372
363
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
kind: graphql_1.Kind.
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
value,
|
|
386
|
-
});
|
|
387
|
-
}
|
|
364
|
+
if (value == null) {
|
|
365
|
+
value = (0, astFromValueUntyped_js_1.astFromValueUntyped)(argValue);
|
|
366
|
+
}
|
|
367
|
+
if (value != null) {
|
|
368
|
+
directiveArguments.push({
|
|
369
|
+
kind: graphql_1.Kind.ARGUMENT,
|
|
370
|
+
name: {
|
|
371
|
+
kind: graphql_1.Kind.NAME,
|
|
372
|
+
value: argName,
|
|
373
|
+
},
|
|
374
|
+
value,
|
|
375
|
+
});
|
|
388
376
|
}
|
|
389
377
|
}
|
|
390
378
|
return {
|
|
@@ -332,39 +332,27 @@ export function makeDeprecatedDirective(deprecationReason) {
|
|
|
332
332
|
}
|
|
333
333
|
export function makeDirectiveNode(name, args, directive) {
|
|
334
334
|
const directiveArguments = [];
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
directiveArguments.push({
|
|
343
|
-
kind: Kind.ARGUMENT,
|
|
344
|
-
name: {
|
|
345
|
-
kind: Kind.NAME,
|
|
346
|
-
value: argName,
|
|
347
|
-
},
|
|
348
|
-
value,
|
|
349
|
-
});
|
|
350
|
-
}
|
|
335
|
+
for (const argName in args) {
|
|
336
|
+
const argValue = args[argName];
|
|
337
|
+
let value;
|
|
338
|
+
if (directive != null) {
|
|
339
|
+
const arg = directive.args.find(arg => arg.name === argName);
|
|
340
|
+
if (arg) {
|
|
341
|
+
value = astFromValue(argValue, arg.type);
|
|
351
342
|
}
|
|
352
343
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
kind: Kind.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
value,
|
|
366
|
-
});
|
|
367
|
-
}
|
|
344
|
+
if (value == null) {
|
|
345
|
+
value = astFromValueUntyped(argValue);
|
|
346
|
+
}
|
|
347
|
+
if (value != null) {
|
|
348
|
+
directiveArguments.push({
|
|
349
|
+
kind: Kind.ARGUMENT,
|
|
350
|
+
name: {
|
|
351
|
+
kind: Kind.NAME,
|
|
352
|
+
value: argName,
|
|
353
|
+
},
|
|
354
|
+
value,
|
|
355
|
+
});
|
|
368
356
|
}
|
|
369
357
|
}
|
|
370
358
|
return {
|