@graphql-tools/utils
Advanced tools
Comparing version 10.5.0 to 10.5.1-rc-20240812111748-78798d8459089d8d926b87fe0610730d901f4103
@@ -355,36 +355,24 @@ "use strict"; | ||
const directiveArguments = []; | ||
if (directive != null) { | ||
for (const arg of directive.args) { | ||
const argName = arg.name; | ||
const argValue = args?.[argName]; | ||
if (argValue !== undefined) { | ||
const value = (0, astFromValue_js_1.astFromValue)(argValue, arg.type); | ||
if (value) { | ||
directiveArguments.push({ | ||
kind: graphql_1.Kind.ARGUMENT, | ||
name: { | ||
kind: graphql_1.Kind.NAME, | ||
value: argName, | ||
}, | ||
value, | ||
}); | ||
} | ||
for (const argName in args) { | ||
const argValue = args[argName]; | ||
let value; | ||
if (directive != null) { | ||
const arg = directive.args.find(arg => arg.name === argName); | ||
if (arg) { | ||
value = (0, astFromValue_js_1.astFromValue)(argValue, arg.type); | ||
} | ||
} | ||
} | ||
else { | ||
for (const argName in args) { | ||
const argValue = args[argName]; | ||
const value = (0, astFromValueUntyped_js_1.astFromValueUntyped)(argValue); | ||
if (value) { | ||
directiveArguments.push({ | ||
kind: graphql_1.Kind.ARGUMENT, | ||
name: { | ||
kind: graphql_1.Kind.NAME, | ||
value: argName, | ||
}, | ||
value, | ||
}); | ||
} | ||
if (value == null) { | ||
value = (0, astFromValueUntyped_js_1.astFromValueUntyped)(argValue); | ||
} | ||
if (value != null) { | ||
directiveArguments.push({ | ||
kind: graphql_1.Kind.ARGUMENT, | ||
name: { | ||
kind: graphql_1.Kind.NAME, | ||
value: argName, | ||
}, | ||
value, | ||
}); | ||
} | ||
} | ||
@@ -391,0 +379,0 @@ return { |
@@ -335,36 +335,24 @@ import { GraphQLDeprecatedDirective, isEnumType, isInputObjectType, isInterfaceType, isIntrospectionType, isObjectType, isScalarType, isSpecifiedDirective, isSpecifiedScalarType, isUnionType, Kind, print, } from 'graphql'; | ||
const directiveArguments = []; | ||
if (directive != null) { | ||
for (const arg of directive.args) { | ||
const argName = arg.name; | ||
const argValue = args?.[argName]; | ||
if (argValue !== undefined) { | ||
const value = astFromValue(argValue, arg.type); | ||
if (value) { | ||
directiveArguments.push({ | ||
kind: Kind.ARGUMENT, | ||
name: { | ||
kind: Kind.NAME, | ||
value: argName, | ||
}, | ||
value, | ||
}); | ||
} | ||
for (const argName in args) { | ||
const argValue = args[argName]; | ||
let value; | ||
if (directive != null) { | ||
const arg = directive.args.find(arg => arg.name === argName); | ||
if (arg) { | ||
value = astFromValue(argValue, arg.type); | ||
} | ||
} | ||
} | ||
else { | ||
for (const argName in args) { | ||
const argValue = args[argName]; | ||
const value = astFromValueUntyped(argValue); | ||
if (value) { | ||
directiveArguments.push({ | ||
kind: Kind.ARGUMENT, | ||
name: { | ||
kind: Kind.NAME, | ||
value: argName, | ||
}, | ||
value, | ||
}); | ||
} | ||
if (value == null) { | ||
value = astFromValueUntyped(argValue); | ||
} | ||
if (value != null) { | ||
directiveArguments.push({ | ||
kind: Kind.ARGUMENT, | ||
name: { | ||
kind: Kind.NAME, | ||
value: argName, | ||
}, | ||
value, | ||
}); | ||
} | ||
} | ||
@@ -371,0 +359,0 @@ return { |
{ | ||
"name": "@graphql-tools/utils", | ||
"version": "10.5.0", | ||
"version": "10.5.1-rc-20240812111748-78798d8459089d8d926b87fe0610730d901f4103", | ||
"description": "Common package containing utils and types for GraphQL tools", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
507605
10923
2