@graphql-tools/delegate 7.1.3-alpha-3bf9d67c.0 → 7.1.3
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/es5/index.cjs.js +12 -5
- package/es5/index.cjs.js.map +1 -1
- package/es5/index.esm.js +13 -6
- package/es5/index.esm.js.map +1 -1
- package/es5/package.json +4 -4
- package/index.cjs.js +10 -3
- package/index.cjs.js.map +1 -1
- package/index.esm.js +11 -4
- package/index.esm.js.map +1 -1
- package/package.json +4 -4
package/es5/index.cjs.js
CHANGED
|
@@ -190,17 +190,24 @@ function mergeExternalObjects(schema, path, typeName, target, sources, selection
|
|
|
190
190
|
var results = [];
|
|
191
191
|
var errors = [];
|
|
192
192
|
sources.forEach(function (source, index) {
|
|
193
|
-
if (source instanceof
|
|
193
|
+
if (source instanceof Error || source === null) {
|
|
194
194
|
var selectionSet = selectionSets[index];
|
|
195
|
-
var
|
|
195
|
+
var fieldNodes_1 = utils.collectFields({
|
|
196
196
|
schema: schema,
|
|
197
197
|
variableValues: {},
|
|
198
198
|
fragments: {},
|
|
199
199
|
}, schema.getType(typeName), selectionSet, Object.create(null), Object.create(null));
|
|
200
200
|
var nullResult_1 = {};
|
|
201
|
-
Object.keys(
|
|
202
|
-
|
|
203
|
-
|
|
201
|
+
Object.keys(fieldNodes_1).forEach(function (responseKey) {
|
|
202
|
+
if (source instanceof graphql.GraphQLError) {
|
|
203
|
+
nullResult_1[responseKey] = utils.relocatedError(source, path.concat([responseKey]));
|
|
204
|
+
}
|
|
205
|
+
else if (source instanceof Error) {
|
|
206
|
+
nullResult_1[responseKey] = graphql.locatedError(source, fieldNodes_1[responseKey], path.concat([responseKey]));
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
nullResult_1[responseKey] = null;
|
|
210
|
+
}
|
|
204
211
|
});
|
|
205
212
|
results.push(nullResult_1);
|
|
206
213
|
}
|