@graphql-tools/utils 8.6.2-alpha-9e783a2c.0 → 8.6.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.
- package/index.js +18 -3
- package/index.mjs +18 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2369,10 +2369,24 @@ function transformInputValue(type, value, inputLeafValueTransformer = null, inpu
|
|
|
2369
2369
|
// unreachable, no other possible return value
|
|
2370
2370
|
}
|
|
2371
2371
|
function serializeInputValue(type, value) {
|
|
2372
|
-
return transformInputValue(type, value, (t, v) =>
|
|
2372
|
+
return transformInputValue(type, value, (t, v) => {
|
|
2373
|
+
try {
|
|
2374
|
+
return t.serialize(v);
|
|
2375
|
+
}
|
|
2376
|
+
catch (_a) {
|
|
2377
|
+
return v;
|
|
2378
|
+
}
|
|
2379
|
+
});
|
|
2373
2380
|
}
|
|
2374
2381
|
function parseInputValue(type, value) {
|
|
2375
|
-
return transformInputValue(type, value, (t, v) =>
|
|
2382
|
+
return transformInputValue(type, value, (t, v) => {
|
|
2383
|
+
try {
|
|
2384
|
+
return t.parseValue(v);
|
|
2385
|
+
}
|
|
2386
|
+
catch (_a) {
|
|
2387
|
+
return v;
|
|
2388
|
+
}
|
|
2389
|
+
});
|
|
2376
2390
|
}
|
|
2377
2391
|
function parseInputValueLiteral(type, value) {
|
|
2378
2392
|
return transformInputValue(type, value, (t, v) => t.parseLiteral(v, {}));
|
|
@@ -4041,6 +4055,7 @@ function visitRoot(root, operation, schema, fragments, variableValues, resultVis
|
|
|
4041
4055
|
return visitObjectValue(root, operationRootType, collectedFields, schema, fragments, variableValues, resultVisitorMap, 0, errors, errorInfo);
|
|
4042
4056
|
}
|
|
4043
4057
|
function visitObjectValue(object, type, fieldNodeMap, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo) {
|
|
4058
|
+
var _a;
|
|
4044
4059
|
const fieldMap = type.getFields();
|
|
4045
4060
|
const typeVisitorMap = resultVisitorMap === null || resultVisitorMap === void 0 ? void 0 : resultVisitorMap[type.name];
|
|
4046
4061
|
const enterObject = typeVisitorMap === null || typeVisitorMap === void 0 ? void 0 : typeVisitorMap.__enter;
|
|
@@ -4056,7 +4071,7 @@ function visitObjectValue(object, type, fieldNodeMap, schema, fragments, variabl
|
|
|
4056
4071
|
}
|
|
4057
4072
|
for (const [responseKey, subFieldNodes] of fieldNodeMap) {
|
|
4058
4073
|
const fieldName = subFieldNodes[0].name.value;
|
|
4059
|
-
const fieldType = fieldName === '__typename' ? graphql.TypeNameMetaFieldDef.type : fieldMap[fieldName].type;
|
|
4074
|
+
const fieldType = fieldName === '__typename' ? graphql.TypeNameMetaFieldDef.type : (_a = fieldMap[fieldName]) === null || _a === void 0 ? void 0 : _a.type;
|
|
4060
4075
|
const newPathIndex = pathIndex + 1;
|
|
4061
4076
|
let fieldErrors;
|
|
4062
4077
|
if (errorMap) {
|
package/index.mjs
CHANGED
|
@@ -2367,10 +2367,24 @@ function transformInputValue(type, value, inputLeafValueTransformer = null, inpu
|
|
|
2367
2367
|
// unreachable, no other possible return value
|
|
2368
2368
|
}
|
|
2369
2369
|
function serializeInputValue(type, value) {
|
|
2370
|
-
return transformInputValue(type, value, (t, v) =>
|
|
2370
|
+
return transformInputValue(type, value, (t, v) => {
|
|
2371
|
+
try {
|
|
2372
|
+
return t.serialize(v);
|
|
2373
|
+
}
|
|
2374
|
+
catch (_a) {
|
|
2375
|
+
return v;
|
|
2376
|
+
}
|
|
2377
|
+
});
|
|
2371
2378
|
}
|
|
2372
2379
|
function parseInputValue(type, value) {
|
|
2373
|
-
return transformInputValue(type, value, (t, v) =>
|
|
2380
|
+
return transformInputValue(type, value, (t, v) => {
|
|
2381
|
+
try {
|
|
2382
|
+
return t.parseValue(v);
|
|
2383
|
+
}
|
|
2384
|
+
catch (_a) {
|
|
2385
|
+
return v;
|
|
2386
|
+
}
|
|
2387
|
+
});
|
|
2374
2388
|
}
|
|
2375
2389
|
function parseInputValueLiteral(type, value) {
|
|
2376
2390
|
return transformInputValue(type, value, (t, v) => t.parseLiteral(v, {}));
|
|
@@ -4039,6 +4053,7 @@ function visitRoot(root, operation, schema, fragments, variableValues, resultVis
|
|
|
4039
4053
|
return visitObjectValue(root, operationRootType, collectedFields, schema, fragments, variableValues, resultVisitorMap, 0, errors, errorInfo);
|
|
4040
4054
|
}
|
|
4041
4055
|
function visitObjectValue(object, type, fieldNodeMap, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo) {
|
|
4056
|
+
var _a;
|
|
4042
4057
|
const fieldMap = type.getFields();
|
|
4043
4058
|
const typeVisitorMap = resultVisitorMap === null || resultVisitorMap === void 0 ? void 0 : resultVisitorMap[type.name];
|
|
4044
4059
|
const enterObject = typeVisitorMap === null || typeVisitorMap === void 0 ? void 0 : typeVisitorMap.__enter;
|
|
@@ -4054,7 +4069,7 @@ function visitObjectValue(object, type, fieldNodeMap, schema, fragments, variabl
|
|
|
4054
4069
|
}
|
|
4055
4070
|
for (const [responseKey, subFieldNodes] of fieldNodeMap) {
|
|
4056
4071
|
const fieldName = subFieldNodes[0].name.value;
|
|
4057
|
-
const fieldType = fieldName === '__typename' ? TypeNameMetaFieldDef.type : fieldMap[fieldName].type;
|
|
4072
|
+
const fieldType = fieldName === '__typename' ? TypeNameMetaFieldDef.type : (_a = fieldMap[fieldName]) === null || _a === void 0 ? void 0 : _a.type;
|
|
4058
4073
|
const newPathIndex = pathIndex + 1;
|
|
4059
4074
|
let fieldErrors;
|
|
4060
4075
|
if (errorMap) {
|