graphql 14.0.2 → 14.1.0

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.
Files changed (279) hide show
  1. package/README.md +4 -4
  2. package/error/GraphQLError.js +1 -1
  3. package/error/GraphQLError.js.flow +3 -3
  4. package/error/GraphQLError.mjs +1 -1
  5. package/error/formatError.js +1 -1
  6. package/error/formatError.mjs +1 -1
  7. package/error/index.mjs +1 -1
  8. package/error/locatedError.js +1 -1
  9. package/error/locatedError.mjs +1 -1
  10. package/error/printError.js +1 -1
  11. package/error/printError.mjs +1 -1
  12. package/error/syntaxError.js +1 -1
  13. package/error/syntaxError.mjs +1 -1
  14. package/execution/execute.mjs +1 -1
  15. package/execution/index.mjs +1 -1
  16. package/execution/values.js +3 -3
  17. package/execution/values.js.flow +1 -1
  18. package/execution/values.mjs +2 -2
  19. package/graphql.js +1 -1
  20. package/graphql.mjs +1 -1
  21. package/index.js +12 -0
  22. package/index.js.flow +2 -0
  23. package/index.mjs +2 -2
  24. package/jsutils/dedent.js +1 -1
  25. package/jsutils/dedent.mjs +1 -1
  26. package/jsutils/defineToJSON.js +17 -6
  27. package/jsutils/defineToJSON.js.flow +14 -5
  28. package/jsutils/defineToJSON.mjs +14 -6
  29. package/jsutils/defineToStringTag.js +5 -5
  30. package/jsutils/defineToStringTag.js.flow +3 -3
  31. package/jsutils/defineToStringTag.mjs +4 -4
  32. package/jsutils/inspect.js +22 -11
  33. package/jsutils/inspect.js.flow +22 -2
  34. package/jsutils/inspect.mjs +21 -4
  35. package/jsutils/instanceOf.js +1 -1
  36. package/jsutils/instanceOf.mjs +1 -1
  37. package/jsutils/invariant.js +1 -1
  38. package/jsutils/invariant.mjs +1 -1
  39. package/jsutils/isInvalid.js +1 -1
  40. package/jsutils/isInvalid.mjs +1 -1
  41. package/jsutils/isNullish.js +1 -1
  42. package/jsutils/isNullish.mjs +1 -1
  43. package/jsutils/isPromise.js +1 -1
  44. package/jsutils/isPromise.mjs +1 -1
  45. package/jsutils/keyMap.js +1 -1
  46. package/jsutils/keyMap.mjs +1 -1
  47. package/jsutils/keyValMap.js +1 -1
  48. package/jsutils/keyValMap.mjs +1 -1
  49. package/jsutils/mapValue.js +54 -0
  50. package/jsutils/mapValue.js.flow +27 -0
  51. package/jsutils/mapValue.mjs +44 -0
  52. package/jsutils/memoize3.js +1 -1
  53. package/jsutils/memoize3.mjs +1 -1
  54. package/jsutils/nodejsCustomInspectSymbol.js +18 -0
  55. package/jsutils/nodejsCustomInspectSymbol.js.flow +15 -0
  56. package/jsutils/nodejsCustomInspectSymbol.mjs +10 -0
  57. package/jsutils/orList.js +17 -4
  58. package/jsutils/orList.js.flow +13 -7
  59. package/jsutils/orList.mjs +14 -4
  60. package/jsutils/promiseForObject.js +1 -1
  61. package/jsutils/promiseForObject.mjs +1 -1
  62. package/jsutils/promiseReduce.js +1 -1
  63. package/jsutils/promiseReduce.mjs +1 -1
  64. package/jsutils/quotedOrList.js +1 -1
  65. package/jsutils/quotedOrList.mjs +1 -1
  66. package/jsutils/suggestionList.js +1 -1
  67. package/jsutils/suggestionList.mjs +1 -1
  68. package/language/blockStringValue.js +1 -1
  69. package/language/blockStringValue.mjs +1 -1
  70. package/language/directiveLocation.js +1 -1
  71. package/language/directiveLocation.mjs +1 -1
  72. package/language/index.mjs +1 -1
  73. package/language/kinds.js +1 -1
  74. package/language/kinds.mjs +1 -1
  75. package/language/lexer.js +28 -12
  76. package/language/lexer.js.flow +33 -19
  77. package/language/lexer.mjs +27 -12
  78. package/language/location.js +1 -1
  79. package/language/location.mjs +1 -1
  80. package/language/parser.js +31 -38
  81. package/language/parser.js.flow +32 -48
  82. package/language/parser.mjs +30 -38
  83. package/language/predicates.js +1 -1
  84. package/language/predicates.mjs +1 -1
  85. package/language/printer.js +13 -7
  86. package/language/printer.js.flow +19 -9
  87. package/language/printer.mjs +13 -7
  88. package/language/source.js +8 -7
  89. package/language/source.mjs +1 -9
  90. package/language/visitor.js +6 -5
  91. package/language/visitor.js.flow +2 -4
  92. package/language/visitor.mjs +6 -5
  93. package/package.json +5 -2
  94. package/polyfills/find.js +31 -0
  95. package/polyfills/find.js.flow +29 -0
  96. package/polyfills/find.mjs +23 -0
  97. package/{jsutils → polyfills}/isFinite.js +1 -1
  98. package/{jsutils → polyfills}/isFinite.js.flow +0 -0
  99. package/{jsutils → polyfills}/isFinite.mjs +1 -1
  100. package/{jsutils → polyfills}/isInteger.js +1 -1
  101. package/{jsutils → polyfills}/isInteger.js.flow +0 -0
  102. package/{jsutils → polyfills}/isInteger.mjs +1 -1
  103. package/polyfills/objectEntries.js +26 -0
  104. package/polyfills/objectEntries.js.flow +19 -0
  105. package/polyfills/objectEntries.mjs +18 -0
  106. package/{jsutils → polyfills}/objectValues.js +1 -1
  107. package/{jsutils → polyfills}/objectValues.js.flow +1 -1
  108. package/{jsutils → polyfills}/objectValues.mjs +1 -1
  109. package/subscription/asyncIteratorReject.mjs +1 -1
  110. package/subscription/index.mjs +1 -1
  111. package/subscription/mapAsyncIterator.mjs +1 -1
  112. package/subscription/subscribe.js +1 -1
  113. package/subscription/subscribe.mjs +1 -1
  114. package/type/definition.js +31 -130
  115. package/type/definition.js.flow +35 -47
  116. package/type/definition.mjs +30 -131
  117. package/type/directives.js +25 -29
  118. package/type/directives.js.flow +24 -20
  119. package/type/directives.mjs +22 -30
  120. package/type/index.js +12 -0
  121. package/type/index.js.flow +4 -0
  122. package/type/index.mjs +5 -3
  123. package/type/introspection.js +3 -3
  124. package/type/introspection.js.flow +1 -1
  125. package/type/introspection.mjs +2 -2
  126. package/type/scalars.js +45 -34
  127. package/type/scalars.js.flow +40 -26
  128. package/type/scalars.mjs +44 -26
  129. package/type/schema.js +82 -87
  130. package/type/schema.js.flow +17 -9
  131. package/type/schema.mjs +79 -86
  132. package/type/validate.js +168 -175
  133. package/type/validate.js.flow +8 -49
  134. package/type/validate.mjs +159 -175
  135. package/utilities/TypeInfo.js +10 -23
  136. package/utilities/TypeInfo.js.flow +1 -1
  137. package/utilities/TypeInfo.mjs +2 -24
  138. package/utilities/assertValidName.js +1 -1
  139. package/utilities/assertValidName.mjs +1 -1
  140. package/utilities/astFromValue.js +2 -2
  141. package/utilities/astFromValue.js.flow +1 -1
  142. package/utilities/astFromValue.mjs +2 -2
  143. package/utilities/buildASTSchema.js +53 -53
  144. package/utilities/buildASTSchema.js.flow +14 -30
  145. package/utilities/buildASTSchema.mjs +45 -55
  146. package/utilities/buildClientSchema.js +3 -3
  147. package/utilities/buildClientSchema.js.flow +6 -2
  148. package/utilities/buildClientSchema.mjs +3 -3
  149. package/utilities/coerceValue.js +38 -19
  150. package/utilities/coerceValue.js.flow +41 -47
  151. package/utilities/coerceValue.mjs +38 -20
  152. package/utilities/concatAST.js +1 -1
  153. package/utilities/concatAST.mjs +1 -1
  154. package/utilities/extendSchema.js +228 -312
  155. package/utilities/extendSchema.js.flow +27 -152
  156. package/utilities/extendSchema.mjs +229 -312
  157. package/utilities/findBreakingChanges.js +7 -5
  158. package/utilities/findBreakingChanges.js.flow +3 -2
  159. package/utilities/findBreakingChanges.mjs +6 -5
  160. package/utilities/findDeprecatedUsages.js +1 -1
  161. package/utilities/findDeprecatedUsages.mjs +1 -1
  162. package/utilities/getOperationAST.js +1 -1
  163. package/utilities/getOperationAST.mjs +1 -1
  164. package/utilities/getOperationRootType.js +1 -1
  165. package/utilities/getOperationRootType.mjs +1 -1
  166. package/utilities/index.mjs +1 -1
  167. package/utilities/introspectionFromSchema.js +1 -1
  168. package/utilities/introspectionFromSchema.mjs +1 -1
  169. package/utilities/introspectionQuery.js +1 -1
  170. package/utilities/introspectionQuery.mjs +1 -1
  171. package/utilities/isValidJSValue.js +1 -1
  172. package/utilities/isValidJSValue.mjs +1 -1
  173. package/utilities/isValidLiteralValue.js +1 -1
  174. package/utilities/isValidLiteralValue.mjs +1 -1
  175. package/utilities/lexicographicSortSchema.js +2 -2
  176. package/utilities/lexicographicSortSchema.js.flow +1 -1
  177. package/utilities/lexicographicSortSchema.mjs +2 -2
  178. package/utilities/schemaPrinter.js +3 -3
  179. package/utilities/schemaPrinter.js.flow +1 -1
  180. package/utilities/schemaPrinter.mjs +2 -2
  181. package/utilities/separateOperations.js +1 -1
  182. package/utilities/separateOperations.mjs +1 -1
  183. package/utilities/typeComparators.js +1 -1
  184. package/utilities/typeComparators.mjs +1 -1
  185. package/utilities/typeFromAST.js +1 -1
  186. package/utilities/typeFromAST.mjs +1 -1
  187. package/utilities/valueFromAST.js +3 -3
  188. package/utilities/valueFromAST.js.flow +1 -1
  189. package/utilities/valueFromAST.mjs +2 -2
  190. package/utilities/valueFromASTUntyped.js +1 -1
  191. package/utilities/valueFromASTUntyped.mjs +1 -1
  192. package/validation/ValidationContext.js +57 -82
  193. package/validation/ValidationContext.js.flow +52 -49
  194. package/validation/ValidationContext.mjs +52 -77
  195. package/validation/index.mjs +1 -1
  196. package/validation/rules/ExecutableDefinitions.js +1 -1
  197. package/validation/rules/ExecutableDefinitions.js.flow +1 -1
  198. package/validation/rules/ExecutableDefinitions.mjs +1 -1
  199. package/validation/rules/FieldsOnCorrectType.js +1 -1
  200. package/validation/rules/FieldsOnCorrectType.mjs +1 -1
  201. package/validation/rules/FragmentsOnCompositeTypes.js +1 -1
  202. package/validation/rules/FragmentsOnCompositeTypes.mjs +1 -1
  203. package/validation/rules/KnownArgumentNames.mjs +1 -1
  204. package/validation/rules/KnownDirectives.js +1 -1
  205. package/validation/rules/KnownDirectives.mjs +1 -1
  206. package/validation/rules/KnownFragmentNames.js +1 -1
  207. package/validation/rules/KnownFragmentNames.mjs +1 -1
  208. package/validation/rules/KnownTypeNames.js +59 -21
  209. package/validation/rules/KnownTypeNames.js.flow +54 -20
  210. package/validation/rules/KnownTypeNames.mjs +56 -21
  211. package/validation/rules/LoneAnonymousOperation.js +1 -1
  212. package/validation/rules/LoneAnonymousOperation.mjs +1 -1
  213. package/validation/rules/LoneSchemaDefinition.js +1 -1
  214. package/validation/rules/LoneSchemaDefinition.mjs +1 -1
  215. package/validation/rules/NoFragmentCycles.js +1 -1
  216. package/validation/rules/NoFragmentCycles.js.flow +2 -2
  217. package/validation/rules/NoFragmentCycles.mjs +1 -1
  218. package/validation/rules/NoUndefinedVariables.js +1 -1
  219. package/validation/rules/NoUndefinedVariables.mjs +1 -1
  220. package/validation/rules/NoUnusedFragments.js +1 -1
  221. package/validation/rules/NoUnusedFragments.js.flow +2 -2
  222. package/validation/rules/NoUnusedFragments.mjs +1 -1
  223. package/validation/rules/NoUnusedVariables.js +1 -1
  224. package/validation/rules/NoUnusedVariables.mjs +1 -1
  225. package/validation/rules/OverlappingFieldsCanBeMerged.js +56 -32
  226. package/validation/rules/OverlappingFieldsCanBeMerged.js.flow +3 -3
  227. package/validation/rules/OverlappingFieldsCanBeMerged.mjs +47 -32
  228. package/validation/rules/PossibleFragmentSpreads.js +1 -1
  229. package/validation/rules/PossibleFragmentSpreads.mjs +1 -1
  230. package/validation/rules/PossibleTypeExtensions.js +158 -0
  231. package/validation/rules/PossibleTypeExtensions.js.flow +160 -0
  232. package/validation/rules/PossibleTypeExtensions.mjs +146 -0
  233. package/validation/rules/ProvidedRequiredArguments.mjs +1 -1
  234. package/validation/rules/ScalarLeafs.js +1 -1
  235. package/validation/rules/ScalarLeafs.mjs +1 -1
  236. package/validation/rules/SingleFieldSubscriptions.js +1 -1
  237. package/validation/rules/SingleFieldSubscriptions.mjs +1 -1
  238. package/validation/rules/UniqueArgumentNames.js +1 -1
  239. package/validation/rules/UniqueArgumentNames.mjs +1 -1
  240. package/validation/rules/UniqueDirectiveNames.js +55 -0
  241. package/validation/rules/UniqueDirectiveNames.js.flow +64 -0
  242. package/validation/rules/UniqueDirectiveNames.mjs +43 -0
  243. package/validation/rules/UniqueDirectivesPerLocation.js +1 -1
  244. package/validation/rules/UniqueDirectivesPerLocation.mjs +1 -1
  245. package/validation/rules/UniqueEnumValueNames.js +94 -0
  246. package/validation/rules/UniqueEnumValueNames.js.flow +87 -0
  247. package/validation/rules/UniqueEnumValueNames.mjs +81 -0
  248. package/validation/rules/UniqueFieldDefinitionNames.js +105 -0
  249. package/validation/rules/UniqueFieldDefinitionNames.js.flow +101 -0
  250. package/validation/rules/UniqueFieldDefinitionNames.mjs +92 -0
  251. package/validation/rules/UniqueFragmentNames.js +1 -1
  252. package/validation/rules/UniqueFragmentNames.mjs +1 -1
  253. package/validation/rules/UniqueInputFieldNames.js +1 -1
  254. package/validation/rules/UniqueInputFieldNames.mjs +1 -1
  255. package/validation/rules/UniqueOperationNames.js +1 -1
  256. package/validation/rules/UniqueOperationNames.mjs +1 -1
  257. package/validation/rules/UniqueOperationTypes.js +85 -0
  258. package/validation/rules/UniqueOperationTypes.js.flow +76 -0
  259. package/validation/rules/UniqueOperationTypes.mjs +73 -0
  260. package/validation/rules/UniqueTypeNames.js +62 -0
  261. package/validation/rules/UniqueTypeNames.js.flow +67 -0
  262. package/validation/rules/UniqueTypeNames.mjs +50 -0
  263. package/validation/rules/UniqueVariableNames.js +1 -1
  264. package/validation/rules/UniqueVariableNames.mjs +1 -1
  265. package/validation/rules/ValuesOfCorrectType.js +29 -13
  266. package/validation/rules/ValuesOfCorrectType.js.flow +4 -5
  267. package/validation/rules/ValuesOfCorrectType.mjs +28 -13
  268. package/validation/rules/VariablesAreInputTypes.js +1 -1
  269. package/validation/rules/VariablesAreInputTypes.mjs +1 -1
  270. package/validation/rules/VariablesInAllowedPosition.js +4 -4
  271. package/validation/rules/VariablesInAllowedPosition.mjs +4 -4
  272. package/validation/specifiedRules.js +14 -2
  273. package/validation/specifiedRules.js.flow +13 -0
  274. package/validation/specifiedRules.mjs +8 -2
  275. package/validation/validate.js +1 -1
  276. package/validation/validate.mjs +1 -1
  277. package/jsutils/find.js +0 -22
  278. package/jsutils/find.js.flow +0 -19
  279. package/jsutils/find.mjs +0 -15
@@ -5,20 +5,18 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.extendSchema = extendSchema;
7
7
 
8
+ var _objectValues = _interopRequireDefault(require("../polyfills/objectValues"));
9
+
8
10
  var _invariant = _interopRequireDefault(require("../jsutils/invariant"));
9
11
 
10
- var _keyMap = _interopRequireDefault(require("../jsutils/keyMap"));
12
+ var _mapValue = _interopRequireDefault(require("../jsutils/mapValue"));
11
13
 
12
14
  var _keyValMap = _interopRequireDefault(require("../jsutils/keyValMap"));
13
15
 
14
- var _objectValues = _interopRequireDefault(require("../jsutils/objectValues"));
15
-
16
16
  var _buildASTSchema = require("./buildASTSchema");
17
17
 
18
18
  var _validate = require("../validation/validate");
19
19
 
20
- var _GraphQLError = require("../error/GraphQLError");
21
-
22
20
  var _schema = require("../type/schema");
23
21
 
24
22
  var _introspection = require("../type/introspection");
@@ -58,7 +56,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
58
56
  *
59
57
  */
60
58
  function extendSchema(schema, documentAST, options) {
61
- !(0, _schema.isSchema)(schema) ? (0, _invariant.default)(0, 'Must provide valid GraphQLSchema') : void 0;
59
+ (0, _schema.assertSchema)(schema);
62
60
  !(documentAST && documentAST.kind === _kinds.Kind.DOCUMENT) ? (0, _invariant.default)(0, 'Must provide valid Document AST') : void 0;
63
61
 
64
62
  if (!options || !(options.assumeValid || options.assumeValidSDL)) {
@@ -74,64 +72,54 @@ function extendSchema(schema, documentAST, options) {
74
72
  var schemaDef; // Schema extensions are collected which may add additional operation types.
75
73
 
76
74
  var schemaExtensions = [];
77
-
78
- for (var i = 0; i < documentAST.definitions.length; i++) {
79
- var def = documentAST.definitions[i];
80
-
81
- if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) {
82
- schemaDef = def;
83
- } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) {
84
- schemaExtensions.push(def);
85
- } else if ((0, _predicates.isTypeDefinitionNode)(def)) {
86
- // Sanity check that none of the defined types conflict with the
87
- // schema's existing types.
88
- var typeName = def.name.value;
89
-
90
- if (schema.getType(typeName)) {
91
- throw new _GraphQLError.GraphQLError("Type \"".concat(typeName, "\" already exists in the schema. It cannot also ") + 'be defined in this type definition.', [def]);
75
+ var _iteratorNormalCompletion = true;
76
+ var _didIteratorError = false;
77
+ var _iteratorError = undefined;
78
+
79
+ try {
80
+ for (var _iterator = documentAST.definitions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
81
+ var def = _step.value;
82
+
83
+ if (def.kind === _kinds.Kind.SCHEMA_DEFINITION) {
84
+ schemaDef = def;
85
+ } else if (def.kind === _kinds.Kind.SCHEMA_EXTENSION) {
86
+ schemaExtensions.push(def);
87
+ } else if ((0, _predicates.isTypeDefinitionNode)(def)) {
88
+ var typeName = def.name.value;
89
+ typeDefinitionMap[typeName] = def;
90
+ } else if ((0, _predicates.isTypeExtensionNode)(def)) {
91
+ var extendedTypeName = def.name.value;
92
+ var existingTypeExtensions = typeExtensionsMap[extendedTypeName];
93
+ typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];
94
+ } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {
95
+ directiveDefinitions.push(def);
92
96
  }
97
+ } // If this document contains no new types, extensions, or directives then
98
+ // return the same unmodified GraphQLSchema instance.
93
99
 
94
- typeDefinitionMap[typeName] = def;
95
- } else if ((0, _predicates.isTypeExtensionNode)(def)) {
96
- // Sanity check that this type extension exists within the
97
- // schema's existing types.
98
- var extendedTypeName = def.name.value;
99
- var existingType = schema.getType(extendedTypeName);
100
-
101
- if (!existingType) {
102
- throw new _GraphQLError.GraphQLError("Cannot extend type \"".concat(extendedTypeName, "\" because it does not ") + 'exist in the existing schema.', [def]);
100
+ } catch (err) {
101
+ _didIteratorError = true;
102
+ _iteratorError = err;
103
+ } finally {
104
+ try {
105
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
106
+ _iterator.return();
103
107
  }
104
-
105
- checkExtensionNode(existingType, def);
106
- var existingTypeExtensions = typeExtensionsMap[extendedTypeName];
107
- typeExtensionsMap[extendedTypeName] = existingTypeExtensions ? existingTypeExtensions.concat([def]) : [def];
108
- } else if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {
109
- var directiveName = def.name.value;
110
- var existingDirective = schema.getDirective(directiveName);
111
-
112
- if (existingDirective) {
113
- throw new _GraphQLError.GraphQLError("Directive \"".concat(directiveName, "\" already exists in the schema. It ") + 'cannot be redefined.', [def]);
108
+ } finally {
109
+ if (_didIteratorError) {
110
+ throw _iteratorError;
114
111
  }
115
-
116
- directiveDefinitions.push(def);
117
112
  }
118
- } // If this document contains no new types, extensions, or directives then
119
- // return the same unmodified GraphQLSchema instance.
120
-
113
+ }
121
114
 
122
115
  if (Object.keys(typeExtensionsMap).length === 0 && Object.keys(typeDefinitionMap).length === 0 && directiveDefinitions.length === 0 && schemaExtensions.length === 0 && !schemaDef) {
123
116
  return schema;
124
117
  }
125
118
 
126
- var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(typeDefinitionMap, options, function (typeRef) {
127
- var typeName = typeRef.name.value;
119
+ var astBuilder = new _buildASTSchema.ASTDefinitionBuilder(typeDefinitionMap, options, function (typeName) {
128
120
  var existingType = schema.getType(typeName);
129
-
130
- if (existingType) {
131
- return extendNamedType(existingType);
132
- }
133
-
134
- throw new _GraphQLError.GraphQLError("Unknown type: \"".concat(typeName, "\". Ensure that this type exists ") + 'either in the original schema, or is added in a type definition.', [typeRef]);
121
+ !existingType ? (0, _invariant.default)(0, "Unknown type: \"".concat(typeName, "\".")) : void 0;
122
+ return extendNamedType(existingType);
135
123
  });
136
124
  var extendTypeCache = Object.create(null); // Get the extended root operation types.
137
125
 
@@ -142,36 +130,31 @@ function extendSchema(schema, documentAST, options) {
142
130
  };
143
131
 
144
132
  if (schemaDef) {
145
- var _iteratorNormalCompletion = true;
146
- var _didIteratorError = false;
147
- var _iteratorError = undefined;
133
+ var _iteratorNormalCompletion2 = true;
134
+ var _didIteratorError2 = false;
135
+ var _iteratorError2 = undefined;
148
136
 
149
137
  try {
150
- for (var _iterator = schemaDef.operationTypes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
151
- var _ref2 = _step.value;
152
- var operation = _ref2.operation,
153
- type = _ref2.type;
154
-
155
- if (operationTypes[operation]) {
156
- throw new Error("Must provide only one ".concat(operation, " type in schema."));
157
- } // Note: While this could make early assertions to get the correctly
138
+ for (var _iterator2 = schemaDef.operationTypes[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
139
+ var _ref2 = _step2.value;
140
+ var operation = _ref2.operation;
141
+ var type = _ref2.type;
142
+ // Note: While this could make early assertions to get the correctly
158
143
  // typed values, that would throw immediately while type system
159
144
  // validation with validateSchema() will produce more actionable results.
160
-
161
-
162
145
  operationTypes[operation] = astBuilder.buildType(type);
163
146
  }
164
147
  } catch (err) {
165
- _didIteratorError = true;
166
- _iteratorError = err;
148
+ _didIteratorError2 = true;
149
+ _iteratorError2 = err;
167
150
  } finally {
168
151
  try {
169
- if (!_iteratorNormalCompletion && _iterator.return != null) {
170
- _iterator.return();
152
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
153
+ _iterator2.return();
171
154
  }
172
155
  } finally {
173
- if (_didIteratorError) {
174
- throw _iteratorError;
156
+ if (_didIteratorError2) {
157
+ throw _iteratorError2;
175
158
  }
176
159
  }
177
160
  }
@@ -182,36 +165,31 @@ function extendSchema(schema, documentAST, options) {
182
165
  var schemaExtension = schemaExtensions[_i];
183
166
 
184
167
  if (schemaExtension.operationTypes) {
185
- var _iteratorNormalCompletion12 = true;
186
- var _didIteratorError12 = false;
187
- var _iteratorError12 = undefined;
168
+ var _iteratorNormalCompletion14 = true;
169
+ var _didIteratorError14 = false;
170
+ var _iteratorError14 = undefined;
188
171
 
189
172
  try {
190
- for (var _iterator12 = schemaExtension.operationTypes[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
191
- var _ref4 = _step12.value;
192
- var operation = _ref4.operation,
193
- type = _ref4.type;
194
-
195
- if (operationTypes[operation]) {
196
- throw new Error("Must provide only one ".concat(operation, " type in schema."));
197
- } // Note: While this could make early assertions to get the correctly
173
+ for (var _iterator14 = schemaExtension.operationTypes[Symbol.iterator](), _step14; !(_iteratorNormalCompletion14 = (_step14 = _iterator14.next()).done); _iteratorNormalCompletion14 = true) {
174
+ var _ref4 = _step14.value;
175
+ var _operation = _ref4.operation;
176
+ var _type = _ref4.type;
177
+ // Note: While this could make early assertions to get the correctly
198
178
  // typed values, that would throw immediately while type system
199
179
  // validation with validateSchema() will produce more actionable results.
200
-
201
-
202
- operationTypes[operation] = astBuilder.buildType(type);
180
+ operationTypes[_operation] = astBuilder.buildType(_type);
203
181
  }
204
182
  } catch (err) {
205
- _didIteratorError12 = true;
206
- _iteratorError12 = err;
183
+ _didIteratorError14 = true;
184
+ _iteratorError14 = err;
207
185
  } finally {
208
186
  try {
209
- if (!_iteratorNormalCompletion12 && _iterator12.return != null) {
210
- _iterator12.return();
187
+ if (!_iteratorNormalCompletion14 && _iterator14.return != null) {
188
+ _iterator14.return();
211
189
  }
212
190
  } finally {
213
- if (_didIteratorError12) {
214
- throw _iteratorError12;
191
+ if (_didIteratorError14) {
192
+ throw _iteratorError14;
215
193
  }
216
194
  }
217
195
  }
@@ -219,9 +197,9 @@ function extendSchema(schema, documentAST, options) {
219
197
  }
220
198
 
221
199
  var schemaExtensionASTNodes = schemaExtensions ? schema.extensionASTNodes ? schema.extensionASTNodes.concat(schemaExtensions) : schemaExtensions : schema.extensionASTNodes;
222
- var types = (0, _objectValues.default)(schema.getTypeMap()).map(function (type) {
200
+ var types = [].concat((0, _objectValues.default)(schema.getTypeMap()).map(function (type) {
223
201
  return extendNamedType(type);
224
- }).concat((0, _objectValues.default)(typeDefinitionMap).map(function (type) {
202
+ }), (0, _objectValues.default)(typeDefinitionMap).map(function (type) {
225
203
  return astBuilder.buildType(type);
226
204
  })); // Support both original legacy names and extended legacy names.
227
205
 
@@ -301,74 +279,60 @@ function extendSchema(schema, documentAST, options) {
301
279
  }
302
280
 
303
281
  function extendInputFieldMap(type) {
304
- var newFieldMap = Object.create(null);
305
- var oldFieldMap = type.getFields();
306
-
307
- var _arr = Object.keys(oldFieldMap);
308
-
309
- for (var _i2 = 0; _i2 < _arr.length; _i2++) {
310
- var _fieldName = _arr[_i2];
311
- var _field = oldFieldMap[_fieldName];
312
- newFieldMap[_fieldName] = {
313
- description: _field.description,
314
- type: extendType(_field.type),
315
- defaultValue: _field.defaultValue,
316
- astNode: _field.astNode
282
+ var newFieldMap = (0, _mapValue.default)(type.getFields(), function (field) {
283
+ return {
284
+ description: field.description,
285
+ type: extendType(field.type),
286
+ defaultValue: field.defaultValue,
287
+ astNode: field.astNode
317
288
  };
318
- } // If there are any extensions to the fields, apply those here.
319
-
289
+ }); // If there are any extensions to the fields, apply those here.
320
290
 
321
291
  var extensions = typeExtensionsMap[type.name];
322
292
 
323
293
  if (extensions) {
324
- var _iteratorNormalCompletion2 = true;
325
- var _didIteratorError2 = false;
326
- var _iteratorError2 = undefined;
294
+ var _iteratorNormalCompletion3 = true;
295
+ var _didIteratorError3 = false;
296
+ var _iteratorError3 = undefined;
327
297
 
328
298
  try {
329
- for (var _iterator2 = extensions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
330
- var extension = _step2.value;
331
- var _iteratorNormalCompletion3 = true;
332
- var _didIteratorError3 = false;
333
- var _iteratorError3 = undefined;
299
+ for (var _iterator3 = extensions[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
300
+ var extension = _step3.value;
301
+ var _iteratorNormalCompletion4 = true;
302
+ var _didIteratorError4 = false;
303
+ var _iteratorError4 = undefined;
334
304
 
335
305
  try {
336
- for (var _iterator3 = extension.fields[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
337
- var field = _step3.value;
338
- var fieldName = field.name.value;
339
-
340
- if (oldFieldMap[fieldName]) {
341
- throw new _GraphQLError.GraphQLError("Field \"".concat(type.name, ".").concat(fieldName, "\" already exists in the ") + 'schema. It cannot also be defined in this type extension.', [field]);
342
- }
343
-
344
- newFieldMap[fieldName] = astBuilder.buildInputField(field);
306
+ for (var _iterator4 = extension.fields[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
307
+ var field = _step4.value;
308
+ newFieldMap[field.name.value] = astBuilder.buildInputField(field);
345
309
  }
346
310
  } catch (err) {
347
- _didIteratorError3 = true;
348
- _iteratorError3 = err;
311
+ _didIteratorError4 = true;
312
+ _iteratorError4 = err;
349
313
  } finally {
350
314
  try {
351
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
352
- _iterator3.return();
315
+ if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
316
+ _iterator4.return();
353
317
  }
354
318
  } finally {
355
- if (_didIteratorError3) {
356
- throw _iteratorError3;
319
+ if (_didIteratorError4) {
320
+ throw _iteratorError4;
357
321
  }
358
322
  }
359
323
  }
360
324
  }
361
325
  } catch (err) {
362
- _didIteratorError2 = true;
363
- _iteratorError2 = err;
326
+ _didIteratorError3 = true;
327
+ _iteratorError3 = err;
364
328
  } finally {
365
329
  try {
366
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
367
- _iterator2.return();
330
+ if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
331
+ _iterator3.return();
368
332
  }
369
333
  } finally {
370
- if (_didIteratorError2) {
371
- throw _iteratorError2;
334
+ if (_didIteratorError3) {
335
+ throw _iteratorError3;
372
336
  }
373
337
  }
374
338
  }
@@ -391,76 +355,81 @@ function extendSchema(schema, documentAST, options) {
391
355
 
392
356
  function extendValueMap(type) {
393
357
  var newValueMap = Object.create(null);
394
- var oldValueMap = (0, _keyMap.default)(type.getValues(), function (value) {
395
- return value.name;
396
- });
358
+ var _iteratorNormalCompletion5 = true;
359
+ var _didIteratorError5 = false;
360
+ var _iteratorError5 = undefined;
397
361
 
398
- var _arr2 = Object.keys(oldValueMap);
399
-
400
- for (var _i3 = 0; _i3 < _arr2.length; _i3++) {
401
- var _valueName = _arr2[_i3];
402
- var _value = oldValueMap[_valueName];
403
- newValueMap[_valueName] = {
404
- name: _value.name,
405
- description: _value.description,
406
- value: _value.value,
407
- deprecationReason: _value.deprecationReason,
408
- astNode: _value.astNode
409
- };
410
- } // If there are any extensions to the values, apply those here.
362
+ try {
363
+ for (var _iterator5 = type.getValues()[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
364
+ var _value = _step5.value;
365
+ newValueMap[_value.name] = {
366
+ description: _value.description,
367
+ value: _value.value,
368
+ deprecationReason: _value.deprecationReason,
369
+ astNode: _value.astNode
370
+ };
371
+ } // If there are any extensions to the values, apply those here.
411
372
 
373
+ } catch (err) {
374
+ _didIteratorError5 = true;
375
+ _iteratorError5 = err;
376
+ } finally {
377
+ try {
378
+ if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
379
+ _iterator5.return();
380
+ }
381
+ } finally {
382
+ if (_didIteratorError5) {
383
+ throw _iteratorError5;
384
+ }
385
+ }
386
+ }
412
387
 
413
388
  var extensions = typeExtensionsMap[type.name];
414
389
 
415
390
  if (extensions) {
416
- var _iteratorNormalCompletion4 = true;
417
- var _didIteratorError4 = false;
418
- var _iteratorError4 = undefined;
391
+ var _iteratorNormalCompletion6 = true;
392
+ var _didIteratorError6 = false;
393
+ var _iteratorError6 = undefined;
419
394
 
420
395
  try {
421
- for (var _iterator4 = extensions[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
422
- var extension = _step4.value;
423
- var _iteratorNormalCompletion5 = true;
424
- var _didIteratorError5 = false;
425
- var _iteratorError5 = undefined;
396
+ for (var _iterator6 = extensions[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
397
+ var extension = _step6.value;
398
+ var _iteratorNormalCompletion7 = true;
399
+ var _didIteratorError7 = false;
400
+ var _iteratorError7 = undefined;
426
401
 
427
402
  try {
428
- for (var _iterator5 = extension.values[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
429
- var value = _step5.value;
430
- var valueName = value.name.value;
431
-
432
- if (oldValueMap[valueName]) {
433
- throw new _GraphQLError.GraphQLError("Enum value \"".concat(type.name, ".").concat(valueName, "\" already exists in the ") + 'schema. It cannot also be defined in this type extension.', [value]);
434
- }
435
-
436
- newValueMap[valueName] = astBuilder.buildEnumValue(value);
403
+ for (var _iterator7 = extension.values[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
404
+ var value = _step7.value;
405
+ newValueMap[value.name.value] = astBuilder.buildEnumValue(value);
437
406
  }
438
407
  } catch (err) {
439
- _didIteratorError5 = true;
440
- _iteratorError5 = err;
408
+ _didIteratorError7 = true;
409
+ _iteratorError7 = err;
441
410
  } finally {
442
411
  try {
443
- if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
444
- _iterator5.return();
412
+ if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
413
+ _iterator7.return();
445
414
  }
446
415
  } finally {
447
- if (_didIteratorError5) {
448
- throw _iteratorError5;
416
+ if (_didIteratorError7) {
417
+ throw _iteratorError7;
449
418
  }
450
419
  }
451
420
  }
452
421
  }
453
422
  } catch (err) {
454
- _didIteratorError4 = true;
455
- _iteratorError4 = err;
423
+ _didIteratorError6 = true;
424
+ _iteratorError6 = err;
456
425
  } finally {
457
426
  try {
458
- if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
459
- _iterator4.return();
427
+ if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
428
+ _iterator6.return();
460
429
  }
461
430
  } finally {
462
- if (_didIteratorError4) {
463
- throw _iteratorError4;
431
+ if (_didIteratorError6) {
432
+ throw _iteratorError6;
464
433
  }
465
434
  }
466
435
  }
@@ -549,65 +518,6 @@ function extendSchema(schema, documentAST, options) {
549
518
 
550
519
  var extensions = typeExtensionsMap[type.name];
551
520
 
552
- if (extensions) {
553
- var _iteratorNormalCompletion6 = true;
554
- var _didIteratorError6 = false;
555
- var _iteratorError6 = undefined;
556
-
557
- try {
558
- for (var _iterator6 = extensions[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) {
559
- var extension = _step6.value;
560
- var _iteratorNormalCompletion7 = true;
561
- var _didIteratorError7 = false;
562
- var _iteratorError7 = undefined;
563
-
564
- try {
565
- for (var _iterator7 = extension.types[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) {
566
- var namedType = _step7.value;
567
- // Note: While this could make early assertions to get the correctly
568
- // typed values, that would throw immediately while type system
569
- // validation with validateSchema() will produce more actionable results.
570
- possibleTypes.push(astBuilder.buildType(namedType));
571
- }
572
- } catch (err) {
573
- _didIteratorError7 = true;
574
- _iteratorError7 = err;
575
- } finally {
576
- try {
577
- if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
578
- _iterator7.return();
579
- }
580
- } finally {
581
- if (_didIteratorError7) {
582
- throw _iteratorError7;
583
- }
584
- }
585
- }
586
- }
587
- } catch (err) {
588
- _didIteratorError6 = true;
589
- _iteratorError6 = err;
590
- } finally {
591
- try {
592
- if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
593
- _iterator6.return();
594
- }
595
- } finally {
596
- if (_didIteratorError6) {
597
- throw _iteratorError6;
598
- }
599
- }
600
- }
601
- }
602
-
603
- return possibleTypes;
604
- }
605
-
606
- function extendImplementedInterfaces(type) {
607
- var interfaces = type.getInterfaces().map(extendNamedType); // If there are any extensions to the interfaces, apply those here.
608
-
609
- var extensions = typeExtensionsMap[type.name];
610
-
611
521
  if (extensions) {
612
522
  var _iteratorNormalCompletion8 = true;
613
523
  var _didIteratorError8 = false;
@@ -621,12 +531,12 @@ function extendSchema(schema, documentAST, options) {
621
531
  var _iteratorError9 = undefined;
622
532
 
623
533
  try {
624
- for (var _iterator9 = extension.interfaces[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
534
+ for (var _iterator9 = extension.types[Symbol.iterator](), _step9; !(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done); _iteratorNormalCompletion9 = true) {
625
535
  var namedType = _step9.value;
626
536
  // Note: While this could make early assertions to get the correctly
627
537
  // typed values, that would throw immediately while type system
628
538
  // validation with validateSchema() will produce more actionable results.
629
- interfaces.push(astBuilder.buildType(namedType));
539
+ possibleTypes.push(astBuilder.buildType(namedType));
630
540
  }
631
541
  } catch (err) {
632
542
  _didIteratorError9 = true;
@@ -659,28 +569,11 @@ function extendSchema(schema, documentAST, options) {
659
569
  }
660
570
  }
661
571
 
662
- return interfaces;
572
+ return possibleTypes;
663
573
  }
664
574
 
665
- function extendFieldMap(type) {
666
- var newFieldMap = Object.create(null);
667
- var oldFieldMap = type.getFields();
668
-
669
- var _arr3 = Object.keys(oldFieldMap);
670
-
671
- for (var _i4 = 0; _i4 < _arr3.length; _i4++) {
672
- var _fieldName2 = _arr3[_i4];
673
- var _field2 = oldFieldMap[_fieldName2];
674
- newFieldMap[_fieldName2] = {
675
- description: _field2.description,
676
- deprecationReason: _field2.deprecationReason,
677
- type: extendType(_field2.type),
678
- args: extendArgs(_field2.args),
679
- astNode: _field2.astNode,
680
- resolve: _field2.resolve
681
- };
682
- } // If there are any extensions to the fields, apply those here.
683
-
575
+ function extendImplementedInterfaces(type) {
576
+ var interfaces = type.getInterfaces().map(extendNamedType); // If there are any extensions to the interfaces, apply those here.
684
577
 
685
578
  var extensions = typeExtensionsMap[type.name];
686
579
 
@@ -697,15 +590,12 @@ function extendSchema(schema, documentAST, options) {
697
590
  var _iteratorError11 = undefined;
698
591
 
699
592
  try {
700
- for (var _iterator11 = extension.fields[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {
701
- var field = _step11.value;
702
- var fieldName = field.name.value;
703
-
704
- if (oldFieldMap[fieldName]) {
705
- throw new _GraphQLError.GraphQLError("Field \"".concat(type.name, ".").concat(fieldName, "\" already exists in the ") + 'schema. It cannot also be defined in this type extension.', [field]);
706
- }
707
-
708
- newFieldMap[fieldName] = astBuilder.buildField(field);
593
+ for (var _iterator11 = extension.interfaces[Symbol.iterator](), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {
594
+ var namedType = _step11.value;
595
+ // Note: While this could make early assertions to get the correctly
596
+ // typed values, that would throw immediately while type system
597
+ // validation with validateSchema() will produce more actionable results.
598
+ interfaces.push(astBuilder.buildType(namedType));
709
599
  }
710
600
  } catch (err) {
711
601
  _didIteratorError11 = true;
@@ -738,6 +628,71 @@ function extendSchema(schema, documentAST, options) {
738
628
  }
739
629
  }
740
630
 
631
+ return interfaces;
632
+ }
633
+
634
+ function extendFieldMap(type) {
635
+ var newFieldMap = (0, _mapValue.default)(type.getFields(), function (field) {
636
+ return {
637
+ description: field.description,
638
+ deprecationReason: field.deprecationReason,
639
+ type: extendType(field.type),
640
+ args: extendArgs(field.args),
641
+ astNode: field.astNode,
642
+ resolve: field.resolve
643
+ };
644
+ }); // If there are any extensions to the fields, apply those here.
645
+
646
+ var extensions = typeExtensionsMap[type.name];
647
+
648
+ if (extensions) {
649
+ var _iteratorNormalCompletion12 = true;
650
+ var _didIteratorError12 = false;
651
+ var _iteratorError12 = undefined;
652
+
653
+ try {
654
+ for (var _iterator12 = extensions[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
655
+ var extension = _step12.value;
656
+ var _iteratorNormalCompletion13 = true;
657
+ var _didIteratorError13 = false;
658
+ var _iteratorError13 = undefined;
659
+
660
+ try {
661
+ for (var _iterator13 = extension.fields[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) {
662
+ var field = _step13.value;
663
+ newFieldMap[field.name.value] = astBuilder.buildField(field);
664
+ }
665
+ } catch (err) {
666
+ _didIteratorError13 = true;
667
+ _iteratorError13 = err;
668
+ } finally {
669
+ try {
670
+ if (!_iteratorNormalCompletion13 && _iterator13.return != null) {
671
+ _iterator13.return();
672
+ }
673
+ } finally {
674
+ if (_didIteratorError13) {
675
+ throw _iteratorError13;
676
+ }
677
+ }
678
+ }
679
+ }
680
+ } catch (err) {
681
+ _didIteratorError12 = true;
682
+ _iteratorError12 = err;
683
+ } finally {
684
+ try {
685
+ if (!_iteratorNormalCompletion12 && _iterator12.return != null) {
686
+ _iterator12.return();
687
+ }
688
+ } finally {
689
+ if (_didIteratorError12) {
690
+ throw _iteratorError12;
691
+ }
692
+ }
693
+ }
694
+ }
695
+
741
696
  return newFieldMap;
742
697
  }
743
698
 
@@ -752,43 +707,4 @@ function extendSchema(schema, documentAST, options) {
752
707
 
753
708
  return extendNamedType(typeDef);
754
709
  }
755
- }
756
-
757
- function checkExtensionNode(type, node) {
758
- switch (node.kind) {
759
- case _kinds.Kind.OBJECT_TYPE_EXTENSION:
760
- if (!(0, _definition.isObjectType)(type)) {
761
- throw new _GraphQLError.GraphQLError("Cannot extend non-object type \"".concat(type.name, "\"."), [node]);
762
- }
763
-
764
- break;
765
-
766
- case _kinds.Kind.INTERFACE_TYPE_EXTENSION:
767
- if (!(0, _definition.isInterfaceType)(type)) {
768
- throw new _GraphQLError.GraphQLError("Cannot extend non-interface type \"".concat(type.name, "\"."), [node]);
769
- }
770
-
771
- break;
772
-
773
- case _kinds.Kind.ENUM_TYPE_EXTENSION:
774
- if (!(0, _definition.isEnumType)(type)) {
775
- throw new _GraphQLError.GraphQLError("Cannot extend non-enum type \"".concat(type.name, "\"."), [node]);
776
- }
777
-
778
- break;
779
-
780
- case _kinds.Kind.UNION_TYPE_EXTENSION:
781
- if (!(0, _definition.isUnionType)(type)) {
782
- throw new _GraphQLError.GraphQLError("Cannot extend non-union type \"".concat(type.name, "\"."), [node]);
783
- }
784
-
785
- break;
786
-
787
- case _kinds.Kind.INPUT_OBJECT_TYPE_EXTENSION:
788
- if (!(0, _definition.isInputObjectType)(type)) {
789
- throw new _GraphQLError.GraphQLError("Cannot extend non-input object type \"".concat(type.name, "\"."), [node]);
790
- }
791
-
792
- break;
793
- }
794
710
  }