@graphql-tools/stitch 9.4.5 → 9.4.6-alpha-4db67676097d6ff18285104dc2c71e4b0ab47e83

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,11 @@
1
1
  # @graphql-tools/stitch
2
2
 
3
+ ## 9.4.6-alpha-4db67676097d6ff18285104dc2c71e4b0ab47e83
4
+
5
+ ### Patch Changes
6
+
7
+ - [#247](https://github.com/graphql-hive/gateway/pull/247) [`0c0b70a`](https://github.com/graphql-hive/gateway/commit/0c0b70a1257ae3af87201f4adcc706f55b3b60e2) Thanks [@ardatan](https://github.com/ardatan)! - Fixes the bug when interfaces extended by \`additionalTypeDefs\`
8
+
3
9
  ## 9.4.5
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -2654,7 +2654,7 @@ function buildTypeCandidates({
2654
2654
  const originalTypeMap = schema.getTypeMap();
2655
2655
  for (const typeName in originalTypeMap) {
2656
2656
  const type = originalTypeMap[typeName];
2657
- if (graphql.isNamedType(type) && graphql.getNamedType(type).name.slice(0, 2) !== "__" && !rootTypes.has(type)) {
2657
+ if (graphql.isNamedType(type) && !graphql.isIntrospectionType(type) && !rootTypes.has(type)) {
2658
2658
  addTypeCandidate(typeCandidates, type.name, {
2659
2659
  type,
2660
2660
  subschema: originalSubschemaMap.get(subschema),
@@ -2670,6 +2670,15 @@ function buildTypeCandidates({
2670
2670
  throw new Error(`Expected to get named typed but got ${utils.inspect(def)}`);
2671
2671
  }
2672
2672
  if (type != null) {
2673
+ if (graphql.isInterfaceType(type)) {
2674
+ try {
2675
+ type.getInterfaces();
2676
+ } catch {
2677
+ Object.defineProperty(type, "_interfaces", {
2678
+ value: []
2679
+ });
2680
+ }
2681
+ }
2673
2682
  addTypeCandidate(typeCandidates, type.name, { type });
2674
2683
  }
2675
2684
  }
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { extractUnavailableFields, leftOverByDelegationPlan, extractUnavailableF
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
4
  import { collectSubFields, memoize1, memoize2, memoize3, parseSelectionSet, mapMaybePromise, isSome, collectFields, getImplementingTypes, filterSchema, getRootTypeNames, mergeDeep, getDescription, createNamedStub, createStub, getRootTypeMap, getRootTypes, inspect, rewireTypes, getOperationASTFromRequest, getDefinedRootType } from '@graphql-tools/utils';
5
- import { isAbstractType, Kind, getNamedType, GraphQLList, isObjectType, isInterfaceType, isLeafType, isInputObjectType, isUnionType, print, isScalarType, isCompositeType, isNonNullType, isEnumType, isListType, getNullableType, isNullableType, GraphQLObjectType, GraphQLInputObjectType, GraphQLInterfaceType, GraphQLUnionType, GraphQLEnumType, GraphQLScalarType, GraphQLDirective, valueFromASTUntyped, getDirectiveValues, GraphQLDeprecatedDirective, DirectiveLocation, isNamedType, isDirective, isSpecifiedScalarType, specifiedDirectives, GraphQLSchema, extendSchema } from 'graphql';
5
+ import { isAbstractType, Kind, getNamedType, GraphQLList, isObjectType, isInterfaceType, isLeafType, isInputObjectType, isUnionType, print, 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 { batchDelegateToSchema } from '@graphql-tools/batch-delegate';
7
7
  import { FilterTypes, TransformCompositeFields, wrapSchema } from '@graphql-tools/wrap';
8
8
  import { getFragmentsFromDocument } from '@graphql-tools/executor';
@@ -2652,7 +2652,7 @@ function buildTypeCandidates({
2652
2652
  const originalTypeMap = schema.getTypeMap();
2653
2653
  for (const typeName in originalTypeMap) {
2654
2654
  const type = originalTypeMap[typeName];
2655
- if (isNamedType(type) && getNamedType(type).name.slice(0, 2) !== "__" && !rootTypes.has(type)) {
2655
+ if (isNamedType(type) && !isIntrospectionType(type) && !rootTypes.has(type)) {
2656
2656
  addTypeCandidate(typeCandidates, type.name, {
2657
2657
  type,
2658
2658
  subschema: originalSubschemaMap.get(subschema),
@@ -2668,6 +2668,15 @@ function buildTypeCandidates({
2668
2668
  throw new Error(`Expected to get named typed but got ${inspect(def)}`);
2669
2669
  }
2670
2670
  if (type != null) {
2671
+ if (isInterfaceType(type)) {
2672
+ try {
2673
+ type.getInterfaces();
2674
+ } catch {
2675
+ Object.defineProperty(type, "_interfaces", {
2676
+ value: []
2677
+ });
2678
+ }
2679
+ }
2671
2680
  addTypeCandidate(typeCandidates, type.name, { type });
2672
2681
  }
2673
2682
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/stitch",
3
- "version": "9.4.5",
3
+ "version": "9.4.6-alpha-4db67676097d6ff18285104dc2c71e4b0ab47e83",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {