@graphql-tools/stitch 10.1.4-alpha-d559b168057533856ad4120c2f588a414115df86 → 10.1.4-alpha-b323a207564a3292807f99fe3e654b3482547755

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @graphql-tools/stitch
2
2
 
3
- ## 10.1.4-alpha-d559b168057533856ad4120c2f588a414115df86
3
+ ## 10.1.4-alpha-b323a207564a3292807f99fe3e654b3482547755
4
4
  ### Patch Changes
5
5
 
6
6
 
@@ -13,10 +13,10 @@
13
13
  hello
14
14
  }
15
15
  ```
16
- - Updated dependencies [[`1dbc653`](https://github.com/graphql-hive/gateway/commit/1dbc6536cb992a705cac7894acca6fe5431b72de)]:
17
- - @graphql-tools/delegate@11.1.4-alpha-d559b168057533856ad4120c2f588a414115df86
18
- - @graphql-tools/batch-delegate@10.0.6-alpha-d559b168057533856ad4120c2f588a414115df86
19
- - @graphql-tools/wrap@11.0.6-alpha-d559b168057533856ad4120c2f588a414115df86
16
+ - Updated dependencies [[`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9), [`1dbc653`](https://github.com/graphql-hive/gateway/commit/1dbc6536cb992a705cac7894acca6fe5431b72de), [`bc6cddd`](https://github.com/graphql-hive/gateway/commit/bc6cddd1c53a012dd02a1d8a7217a28e65cc6ae9)]:
17
+ - @graphql-tools/wrap@11.1.0-alpha-b323a207564a3292807f99fe3e654b3482547755
18
+ - @graphql-tools/delegate@12.0.0-alpha-b323a207564a3292807f99fe3e654b3482547755
19
+ - @graphql-tools/batch-delegate@10.0.6-alpha-b323a207564a3292807f99fe3e654b3482547755
20
20
 
21
21
  ## 10.1.3
22
22
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -3227,7 +3227,15 @@ function createStitchingExecutor(stitchedSchema) {
3227
3227
  );
3228
3228
  const data = {};
3229
3229
  for (const [fieldName, fieldNodes] of fields) {
3230
- const responseKey = fieldNodes[0]?.alias?.value ?? fieldName;
3230
+ const fieldNode = fieldNodes[0];
3231
+ if (!fieldNode) {
3232
+ continue;
3233
+ }
3234
+ const fieldInstance = rootType.getFields()[fieldName];
3235
+ if (!fieldInstance) {
3236
+ continue;
3237
+ }
3238
+ const responseKey = fieldNode.alias?.value ?? fieldName;
3231
3239
  const subschemaForField = subschemas.find((subschema) => {
3232
3240
  const subschemaSchema = delegate.isSubschemaConfig(subschema) ? subschema.schema : subschema;
3233
3241
  const rootType2 = utils.getDefinedRootType(
@@ -3236,9 +3244,15 @@ function createStitchingExecutor(stitchedSchema) {
3236
3244
  );
3237
3245
  return rootType2.getFields()[fieldName] != null;
3238
3246
  });
3247
+ const args = utils.getArgumentValues(
3248
+ fieldInstance,
3249
+ fieldNode,
3250
+ executorRequest.variables
3251
+ );
3239
3252
  let result = await delegate.delegateToSchema({
3240
3253
  schema: subschemaForField || stitchedSchema,
3241
3254
  rootValue: executorRequest.rootValue,
3255
+ args,
3242
3256
  context: executorRequest.context,
3243
3257
  info: {
3244
3258
  schema: stitchedSchema,
@@ -3247,8 +3261,10 @@ function createStitchingExecutor(stitchedSchema) {
3247
3261
  operation,
3248
3262
  fragments,
3249
3263
  parentType: rootType,
3250
- returnType: rootType.getFields()[fieldName]?.type,
3251
- variableValues: executorRequest.variables
3264
+ returnType: fieldInstance.type,
3265
+ variableValues: executorRequest.variables,
3266
+ rootValue: executorRequest.rootValue,
3267
+ path: { typename: void 0, key: responseKey, prev: void 0 }
3252
3268
  }
3253
3269
  });
3254
3270
  if (Array.isArray(result)) {
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { handleOverrideByDelegation as handleOverrideByDelegation$1, subtractSelectionSets, extractUnavailableFields, leftOverByDelegationPlan, extractUnavailableFieldsFromSelectionSet, delegateToSchema, cloneSubschemaConfig, isSubschemaConfig, defaultMergedResolver, Subschema } from '@graphql-tools/delegate';
2
2
  import { mergeType, mergeInputType, mergeInterface, mergeUnion, mergeEnum, mergeScalar, mergeTypeDefs, mergeResolvers, mergeExtensions, applyExtensions } from '@graphql-tools/merge';
3
3
  import { extendResolversFromInterfaces, addResolversToSchema, assertResolversPresent, makeExecutableSchema } from '@graphql-tools/schema';
4
- import { memoize3, collectSubFields, memoize2, memoize1, parseSelectionSet, collectFields, isSome, getImplementingTypes, getRootTypeNames, filterSchema, mergeDeep, getDescription, createNamedStub, createStub, getRootTypeMap, getRootTypes, inspect, rewireTypes, getOperationASTFromRequest, getDefinedRootType } from '@graphql-tools/utils';
4
+ import { memoize3, collectSubFields, memoize2, memoize1, parseSelectionSet, collectFields, isSome, getImplementingTypes, getRootTypeNames, filterSchema, mergeDeep, getDescription, createNamedStub, createStub, getRootTypeMap, getRootTypes, inspect, rewireTypes, getOperationASTFromRequest, getDefinedRootType, getArgumentValues } from '@graphql-tools/utils';
5
5
  import { isAbstractType, Kind, TypeNameMetaFieldDef, getNamedType, GraphQLList, isLeafType, isInputObjectType, isUnionType, print, isObjectType, isInterfaceType, visit, isScalarType, isCompositeType, isNonNullType, isEnumType, isListType, getNullableType, isNullableType, GraphQLObjectType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLScalarType, GraphQLDirective, valueFromASTUntyped, getDirectiveValues, GraphQLDeprecatedDirective, DirectiveLocation, isNamedType, isIntrospectionType, isDirective, isSpecifiedScalarType, specifiedDirectives, GraphQLSchema, extendSchema } from 'graphql';
6
6
  import { handleMaybePromise } from '@whatwg-node/promise-helpers';
7
7
  import { batchDelegateToSchema } from '@graphql-tools/batch-delegate';
@@ -3225,7 +3225,15 @@ function createStitchingExecutor(stitchedSchema) {
3225
3225
  );
3226
3226
  const data = {};
3227
3227
  for (const [fieldName, fieldNodes] of fields) {
3228
- const responseKey = fieldNodes[0]?.alias?.value ?? fieldName;
3228
+ const fieldNode = fieldNodes[0];
3229
+ if (!fieldNode) {
3230
+ continue;
3231
+ }
3232
+ const fieldInstance = rootType.getFields()[fieldName];
3233
+ if (!fieldInstance) {
3234
+ continue;
3235
+ }
3236
+ const responseKey = fieldNode.alias?.value ?? fieldName;
3229
3237
  const subschemaForField = subschemas.find((subschema) => {
3230
3238
  const subschemaSchema = isSubschemaConfig(subschema) ? subschema.schema : subschema;
3231
3239
  const rootType2 = getDefinedRootType(
@@ -3234,9 +3242,15 @@ function createStitchingExecutor(stitchedSchema) {
3234
3242
  );
3235
3243
  return rootType2.getFields()[fieldName] != null;
3236
3244
  });
3245
+ const args = getArgumentValues(
3246
+ fieldInstance,
3247
+ fieldNode,
3248
+ executorRequest.variables
3249
+ );
3237
3250
  let result = await delegateToSchema({
3238
3251
  schema: subschemaForField || stitchedSchema,
3239
3252
  rootValue: executorRequest.rootValue,
3253
+ args,
3240
3254
  context: executorRequest.context,
3241
3255
  info: {
3242
3256
  schema: stitchedSchema,
@@ -3245,8 +3259,10 @@ function createStitchingExecutor(stitchedSchema) {
3245
3259
  operation,
3246
3260
  fragments,
3247
3261
  parentType: rootType,
3248
- returnType: rootType.getFields()[fieldName]?.type,
3249
- variableValues: executorRequest.variables
3262
+ returnType: fieldInstance.type,
3263
+ variableValues: executorRequest.variables,
3264
+ rootValue: executorRequest.rootValue,
3265
+ path: { typename: void 0, key: responseKey, prev: void 0 }
3250
3266
  }
3251
3267
  });
3252
3268
  if (Array.isArray(result)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/stitch",
3
- "version": "10.1.4-alpha-d559b168057533856ad4120c2f588a414115df86",
3
+ "version": "10.1.4-alpha-b323a207564a3292807f99fe3e654b3482547755",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {
@@ -38,13 +38,13 @@
38
38
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@graphql-tools/batch-delegate": "10.0.6-alpha-d559b168057533856ad4120c2f588a414115df86",
42
- "@graphql-tools/delegate": "11.1.4-alpha-d559b168057533856ad4120c2f588a414115df86",
41
+ "@graphql-tools/batch-delegate": "10.0.6-alpha-b323a207564a3292807f99fe3e654b3482547755",
42
+ "@graphql-tools/delegate": "12.0.0-alpha-b323a207564a3292807f99fe3e654b3482547755",
43
43
  "@graphql-tools/executor": "^1.4.13",
44
44
  "@graphql-tools/merge": "^9.1.5",
45
45
  "@graphql-tools/schema": "^10.0.29",
46
46
  "@graphql-tools/utils": "^10.10.3",
47
- "@graphql-tools/wrap": "11.0.6-alpha-d559b168057533856ad4120c2f588a414115df86",
47
+ "@graphql-tools/wrap": "11.1.0-alpha-b323a207564a3292807f99fe3e654b3482547755",
48
48
  "@whatwg-node/promise-helpers": "^1.3.2",
49
49
  "tslib": "^2.8.1"
50
50
  },