@graphql-tools/delegate 7.0.8-alpha-f9bebbe6.0 → 7.0.8

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.esm.js CHANGED
@@ -617,8 +617,13 @@ function resolveExternalValue(result, unpathedErrors, subschema, context, info,
617
617
  }
618
618
  function resolveExternalObject(type, object, unpathedErrors, subschema, context, info, skipTypeMerging) {
619
619
  var _a;
620
- const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
620
+ // if we have already resolved this object, for example, when the identical object appears twice
621
+ // in a list, see https://github.com/ardatan/graphql-tools/issues/2304
622
+ if (isExternalObject(object)) {
623
+ return object;
624
+ }
621
625
  annotateExternalObject(object, unpathedErrors, subschema);
626
+ const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
622
627
  if (skipTypeMerging || !stitchingInfo) {
623
628
  return object;
624
629
  }
@@ -1523,7 +1528,7 @@ function defaultDelegationBinding(delegationContext) {
1523
1528
  if (stitchingInfo != null) {
1524
1529
  delegationTransforms = delegationTransforms.concat([
1525
1530
  new ExpandAbstractTypes(),
1526
- new AddSelectionSets({}, stitchingInfo.selectionSetsByField, stitchingInfo.dynamicSelectionSetsByField),
1531
+ new AddSelectionSets(stitchingInfo.selectionSetsByType, stitchingInfo.selectionSetsByField, stitchingInfo.dynamicSelectionSetsByField),
1527
1532
  new WrapConcreteTypes(),
1528
1533
  ]);
1529
1534
  }