@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/es5/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/delegate/es5",
3
- "version": "7.0.8-alpha-f9bebbe6.0",
3
+ "version": "7.0.8",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
@@ -8,14 +8,18 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@ardatan/aggregate-error": "0.0.6",
11
- "@graphql-tools/batch-execute": "7.0.1-alpha-f9bebbe6.0",
12
- "@graphql-tools/schema": "7.1.3-alpha-f9bebbe6.0",
13
- "@graphql-tools/utils": "7.1.4-alpha-f9bebbe6.0",
11
+ "@graphql-tools/batch-execute": "^7.0.0",
12
+ "@graphql-tools/schema": "^7.0.0",
13
+ "@graphql-tools/utils": "^7.1.6",
14
14
  "dataloader": "2.0.0",
15
15
  "is-promise": "4.0.0",
16
16
  "tslib": "~2.0.1"
17
17
  },
18
- "repository": "git@github.com:ardatan/graphql-tools.git",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "ardatan/graphql-tools",
21
+ "directory": "packages/delegate"
22
+ },
19
23
  "license": "MIT",
20
24
  "main": "index.cjs.js",
21
25
  "module": "index.esm.js",
package/es5/types.d.ts CHANGED
@@ -137,6 +137,7 @@ export interface MergedFieldConfig {
137
137
  export declare type MergedTypeResolver = (originalResult: any, context: Record<string, any>, info: GraphQLResolveInfo, subschema: GraphQLSchema | SubschemaConfig, selectionSet: SelectionSetNode, key?: any) => any;
138
138
  export interface StitchingInfo {
139
139
  subschemaMap: Map<GraphQLSchema | SubschemaConfig, Subschema>;
140
+ selectionSetsByType: Record<string, SelectionSetNode>;
140
141
  selectionSetsByField: Record<string, Record<string, SelectionSetNode>>;
141
142
  dynamicSelectionSetsByField: Record<string, Record<string, Array<(node: FieldNode) => SelectionSetNode>>>;
142
143
  mergedTypes: Record<string, MergedTypeInfo>;
package/index.cjs.js CHANGED
@@ -623,8 +623,13 @@ function resolveExternalValue(result, unpathedErrors, subschema, context, info,
623
623
  }
624
624
  function resolveExternalObject(type, object, unpathedErrors, subschema, context, info, skipTypeMerging) {
625
625
  var _a;
626
- const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
626
+ // if we have already resolved this object, for example, when the identical object appears twice
627
+ // in a list, see https://github.com/ardatan/graphql-tools/issues/2304
628
+ if (isExternalObject(object)) {
629
+ return object;
630
+ }
627
631
  annotateExternalObject(object, unpathedErrors, subschema);
632
+ const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
628
633
  if (skipTypeMerging || !stitchingInfo) {
629
634
  return object;
630
635
  }
@@ -1529,7 +1534,7 @@ function defaultDelegationBinding(delegationContext) {
1529
1534
  if (stitchingInfo != null) {
1530
1535
  delegationTransforms = delegationTransforms.concat([
1531
1536
  new ExpandAbstractTypes(),
1532
- new AddSelectionSets({}, stitchingInfo.selectionSetsByField, stitchingInfo.dynamicSelectionSetsByField),
1537
+ new AddSelectionSets(stitchingInfo.selectionSetsByType, stitchingInfo.selectionSetsByField, stitchingInfo.dynamicSelectionSetsByField),
1533
1538
  new WrapConcreteTypes(),
1534
1539
  ]);
1535
1540
  }