@graphql-tools/wrap 10.0.3 → 10.0.4

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.
@@ -96,7 +96,13 @@ class MapLeafValues {
96
96
  variableValues[argValue.name.value] = transformedValue;
97
97
  }
98
98
  else {
99
- const newValueNode = (0, graphql_1.astFromValue)(transformedValue, argType);
99
+ let newValueNode;
100
+ try {
101
+ newValueNode = (0, graphql_1.astFromValue)(transformedValue, argType);
102
+ }
103
+ catch (e) {
104
+ newValueNode = (0, utils_1.astFromValueUntyped)(transformedValue);
105
+ }
100
106
  if (newValueNode != null) {
101
107
  argumentNodeMap[argName] = {
102
108
  ...argumentNode,
@@ -1,5 +1,5 @@
1
1
  import { astFromValue, isLeafType, Kind, TypeInfo, valueFromAST, valueFromASTUntyped, visit, visitWithTypeInfo, } from 'graphql';
2
- import { transformInputValue, visitResult, } from '@graphql-tools/utils';
2
+ import { astFromValueUntyped, transformInputValue, visitResult, } from '@graphql-tools/utils';
3
3
  export default class MapLeafValues {
4
4
  constructor(inputValueTransformer, outputValueTransformer) {
5
5
  this.inputValueTransformer = inputValueTransformer;
@@ -94,7 +94,13 @@ export default class MapLeafValues {
94
94
  variableValues[argValue.name.value] = transformedValue;
95
95
  }
96
96
  else {
97
- const newValueNode = astFromValue(transformedValue, argType);
97
+ let newValueNode;
98
+ try {
99
+ newValueNode = astFromValue(transformedValue, argType);
100
+ }
101
+ catch (e) {
102
+ newValueNode = astFromValueUntyped(transformedValue);
103
+ }
98
104
  if (newValueNode != null) {
99
105
  argumentNodeMap[argName] = {
100
106
  ...argumentNode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/wrap",
3
- "version": "10.0.3",
3
+ "version": "10.0.4",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {