@graphql-tools/delegate 9.0.19 → 9.0.20

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.
@@ -122,21 +122,12 @@ function addVariablesToRootFields(targetSchema, operations, args) {
122
122
  };
123
123
  }
124
124
  function updateArguments(targetField, argumentNodeMap, variableDefinitionMap, variableValues, newArgs) {
125
- var _a;
126
125
  const generateVariableName = (0, utils_1.createVariableNameGenerator)(variableDefinitionMap);
127
126
  for (const argument of targetField.args) {
128
127
  const argName = argument.name;
129
128
  const argType = argument.type;
130
129
  if (argName in newArgs) {
131
- let value;
132
- const existingValueNode = (_a = argumentNodeMap[argName]) === null || _a === void 0 ? void 0 : _a.value;
133
- if (existingValueNode != null) {
134
- value = (0, graphql_1.valueFromASTUntyped)(existingValueNode, variableValues);
135
- }
136
- if (value == null) {
137
- value = (0, utils_1.serializeInputValue)(argType, newArgs[argName]);
138
- }
139
- (0, utils_1.updateArgument)(argumentNodeMap, variableDefinitionMap, variableValues, argName, generateVariableName(argName), argType, value);
130
+ (0, utils_1.updateArgument)(argumentNodeMap, variableDefinitionMap, variableValues, argName, generateVariableName(argName), argType, (0, utils_1.serializeInputValue)(argType, newArgs[argName]));
140
131
  }
141
132
  }
142
133
  }
@@ -1,4 +1,4 @@
1
- import { getNamedType, isAbstractType, isInterfaceType, isObjectType, Kind, TypeInfo, TypeNameMetaFieldDef, valueFromASTUntyped, versionInfo as graphqlVersionInfo, visit, visitWithTypeInfo, } from 'graphql';
1
+ import { getNamedType, isAbstractType, isInterfaceType, isObjectType, Kind, TypeInfo, TypeNameMetaFieldDef, versionInfo as graphqlVersionInfo, visit, visitWithTypeInfo, } from 'graphql';
2
2
  import { getDefinedRootType, serializeInputValue, updateArgument, createVariableNameGenerator, implementsAbstractType, inspect, } from '@graphql-tools/utils';
3
3
  import { getDocumentMetadata } from './getDocumentMetadata.js';
4
4
  function finalizeGatewayDocument(targetSchema, fragments, operations) {
@@ -118,21 +118,12 @@ function addVariablesToRootFields(targetSchema, operations, args) {
118
118
  };
119
119
  }
120
120
  function updateArguments(targetField, argumentNodeMap, variableDefinitionMap, variableValues, newArgs) {
121
- var _a;
122
121
  const generateVariableName = createVariableNameGenerator(variableDefinitionMap);
123
122
  for (const argument of targetField.args) {
124
123
  const argName = argument.name;
125
124
  const argType = argument.type;
126
125
  if (argName in newArgs) {
127
- let value;
128
- const existingValueNode = (_a = argumentNodeMap[argName]) === null || _a === void 0 ? void 0 : _a.value;
129
- if (existingValueNode != null) {
130
- value = valueFromASTUntyped(existingValueNode, variableValues);
131
- }
132
- if (value == null) {
133
- value = serializeInputValue(argType, newArgs[argName]);
134
- }
135
- updateArgument(argumentNodeMap, variableDefinitionMap, variableValues, argName, generateVariableName(argName), argType, value);
126
+ updateArgument(argumentNodeMap, variableDefinitionMap, variableValues, argName, generateVariableName(argName), argType, serializeInputValue(argType, newArgs[argName]));
136
127
  }
137
128
  }
138
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/delegate",
3
- "version": "9.0.19",
3
+ "version": "9.0.20",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {