@graphql-tools/stitch 10.1.3 → 10.1.4-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2

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,5 +1,13 @@
1
1
  # @graphql-tools/stitch
2
2
 
3
+ ## 10.1.4-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2
4
+ ### Patch Changes
5
+
6
+ - Updated dependencies [[`92670d4`](https://github.com/graphql-hive/gateway/commit/92670d45670ca7533638de4823e043acc40566a5), [`92670d4`](https://github.com/graphql-hive/gateway/commit/92670d45670ca7533638de4823e043acc40566a5)]:
7
+ - @graphql-tools/wrap@11.1.0-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2
8
+ - @graphql-tools/delegate@12.0.0-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2
9
+ - @graphql-tools/batch-delegate@10.0.6-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2
10
+
3
11
  ## 10.1.3
4
12
  ### Patch Changes
5
13
 
package/dist/index.cjs CHANGED
@@ -3217,7 +3217,15 @@ function createStitchingExecutor(stitchedSchema) {
3217
3217
  );
3218
3218
  const data = {};
3219
3219
  for (const [fieldName, fieldNodes] of fields) {
3220
- const responseKey = fieldNodes[0]?.alias?.value ?? fieldName;
3220
+ const fieldNode = fieldNodes[0];
3221
+ if (!fieldNode) {
3222
+ continue;
3223
+ }
3224
+ const fieldInstance = rootType.getFields()[fieldName];
3225
+ if (!fieldInstance) {
3226
+ continue;
3227
+ }
3228
+ const responseKey = fieldNode.alias?.value ?? fieldName;
3221
3229
  const subschemaForField = subschemas.find((subschema) => {
3222
3230
  const subschemaSchema = delegate.isSubschemaConfig(subschema) ? subschema.schema : subschema;
3223
3231
  const rootType2 = utils.getDefinedRootType(
@@ -3226,9 +3234,15 @@ function createStitchingExecutor(stitchedSchema) {
3226
3234
  );
3227
3235
  return rootType2.getFields()[fieldName] != null;
3228
3236
  });
3237
+ const args = utils.getArgumentValues(
3238
+ fieldInstance,
3239
+ fieldNode,
3240
+ executorRequest.variables
3241
+ );
3229
3242
  let result = await delegate.delegateToSchema({
3230
3243
  schema: subschemaForField || stitchedSchema,
3231
3244
  rootValue: executorRequest.rootValue,
3245
+ args,
3232
3246
  context: executorRequest.context,
3233
3247
  info: {
3234
3248
  schema: stitchedSchema,
@@ -3237,8 +3251,10 @@ function createStitchingExecutor(stitchedSchema) {
3237
3251
  operation,
3238
3252
  fragments,
3239
3253
  parentType: rootType,
3240
- returnType: rootType.getFields()[fieldName]?.type,
3241
- variableValues: executorRequest.variables
3254
+ returnType: fieldInstance.type,
3255
+ variableValues: executorRequest.variables,
3256
+ rootValue: executorRequest.rootValue,
3257
+ path: { typename: void 0, key: responseKey, prev: void 0 }
3242
3258
  }
3243
3259
  });
3244
3260
  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';
@@ -3215,7 +3215,15 @@ function createStitchingExecutor(stitchedSchema) {
3215
3215
  );
3216
3216
  const data = {};
3217
3217
  for (const [fieldName, fieldNodes] of fields) {
3218
- const responseKey = fieldNodes[0]?.alias?.value ?? fieldName;
3218
+ const fieldNode = fieldNodes[0];
3219
+ if (!fieldNode) {
3220
+ continue;
3221
+ }
3222
+ const fieldInstance = rootType.getFields()[fieldName];
3223
+ if (!fieldInstance) {
3224
+ continue;
3225
+ }
3226
+ const responseKey = fieldNode.alias?.value ?? fieldName;
3219
3227
  const subschemaForField = subschemas.find((subschema) => {
3220
3228
  const subschemaSchema = isSubschemaConfig(subschema) ? subschema.schema : subschema;
3221
3229
  const rootType2 = getDefinedRootType(
@@ -3224,9 +3232,15 @@ function createStitchingExecutor(stitchedSchema) {
3224
3232
  );
3225
3233
  return rootType2.getFields()[fieldName] != null;
3226
3234
  });
3235
+ const args = getArgumentValues(
3236
+ fieldInstance,
3237
+ fieldNode,
3238
+ executorRequest.variables
3239
+ );
3227
3240
  let result = await delegateToSchema({
3228
3241
  schema: subschemaForField || stitchedSchema,
3229
3242
  rootValue: executorRequest.rootValue,
3243
+ args,
3230
3244
  context: executorRequest.context,
3231
3245
  info: {
3232
3246
  schema: stitchedSchema,
@@ -3235,8 +3249,10 @@ function createStitchingExecutor(stitchedSchema) {
3235
3249
  operation,
3236
3250
  fragments,
3237
3251
  parentType: rootType,
3238
- returnType: rootType.getFields()[fieldName]?.type,
3239
- variableValues: executorRequest.variables
3252
+ returnType: fieldInstance.type,
3253
+ variableValues: executorRequest.variables,
3254
+ rootValue: executorRequest.rootValue,
3255
+ path: { typename: void 0, key: responseKey, prev: void 0 }
3240
3256
  }
3241
3257
  });
3242
3258
  if (Array.isArray(result)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/stitch",
3
- "version": "10.1.3",
3
+ "version": "10.1.4-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2",
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.5",
42
- "@graphql-tools/delegate": "^11.1.3",
41
+ "@graphql-tools/batch-delegate": "10.0.6-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2",
42
+ "@graphql-tools/delegate": "12.0.0-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2",
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.5",
47
+ "@graphql-tools/wrap": "11.1.0-alpha-2fdbd878624cd480a0494dac0df63cedf77c7dd2",
48
48
  "@whatwg-node/promise-helpers": "^1.3.2",
49
49
  "tslib": "^2.8.1"
50
50
  },