graphql 14.3.0 → 14.3.1

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 (272) hide show
  1. package/error/GraphQLError.js +12 -10
  2. package/error/GraphQLError.js.flow +7 -1
  3. package/error/GraphQLError.mjs +12 -2
  4. package/error/formatError.js +1 -1
  5. package/error/formatError.mjs +1 -1
  6. package/error/index.js +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.js +32 -26
  15. package/execution/execute.js.flow +6 -3
  16. package/execution/execute.mjs +32 -26
  17. package/execution/index.js +1 -1
  18. package/execution/index.mjs +1 -1
  19. package/execution/values.js +4 -4
  20. package/execution/values.js.flow +4 -3
  21. package/execution/values.mjs +4 -4
  22. package/graphql.js +6 -2
  23. package/graphql.js.flow +2 -1
  24. package/graphql.mjs +3 -2
  25. package/index.js +1 -1
  26. package/index.mjs +1 -1
  27. package/jsutils/ObjMap.js +1 -1
  28. package/jsutils/ObjMap.mjs +1 -0
  29. package/jsutils/PromiseOrValue.js +1 -1
  30. package/jsutils/PromiseOrValue.mjs +1 -0
  31. package/jsutils/dedent.js +1 -1
  32. package/jsutils/dedent.mjs +1 -1
  33. package/jsutils/defineToJSON.js +1 -1
  34. package/jsutils/defineToJSON.mjs +1 -1
  35. package/jsutils/defineToStringTag.js +1 -1
  36. package/jsutils/defineToStringTag.mjs +1 -1
  37. package/jsutils/inspect.js +2 -2
  38. package/jsutils/inspect.js.flow +1 -1
  39. package/jsutils/inspect.mjs +2 -2
  40. package/jsutils/instanceOf.js +1 -1
  41. package/jsutils/instanceOf.mjs +1 -1
  42. package/jsutils/invariant.js +4 -2
  43. package/jsutils/invariant.js.flow +2 -1
  44. package/jsutils/invariant.mjs +4 -2
  45. package/jsutils/isInvalid.js +1 -1
  46. package/jsutils/isInvalid.mjs +1 -1
  47. package/jsutils/isNullish.js +1 -1
  48. package/jsutils/isNullish.mjs +1 -1
  49. package/jsutils/isPromise.js +1 -1
  50. package/jsutils/isPromise.mjs +1 -1
  51. package/jsutils/keyMap.js +3 -2
  52. package/jsutils/keyMap.js.flow +4 -4
  53. package/jsutils/keyMap.mjs +3 -2
  54. package/jsutils/keyValMap.js +3 -2
  55. package/jsutils/keyValMap.js.flow +4 -4
  56. package/jsutils/keyValMap.mjs +3 -2
  57. package/jsutils/mapValue.js +1 -1
  58. package/jsutils/mapValue.mjs +1 -1
  59. package/jsutils/memoize3.js +2 -2
  60. package/jsutils/memoize3.js.flow +1 -1
  61. package/jsutils/memoize3.mjs +2 -2
  62. package/jsutils/nodejsCustomInspectSymbol.js +1 -1
  63. package/jsutils/nodejsCustomInspectSymbol.mjs +1 -1
  64. package/jsutils/orList.js +1 -1
  65. package/jsutils/orList.mjs +1 -1
  66. package/jsutils/promiseForObject.js +1 -1
  67. package/jsutils/promiseForObject.mjs +1 -1
  68. package/jsutils/promiseReduce.js +1 -1
  69. package/jsutils/promiseReduce.mjs +1 -1
  70. package/jsutils/quotedOrList.js +1 -1
  71. package/jsutils/quotedOrList.mjs +1 -1
  72. package/jsutils/suggestionList.js +1 -1
  73. package/jsutils/suggestionList.mjs +1 -1
  74. package/language/ast.js +1 -1
  75. package/language/ast.mjs +1 -0
  76. package/language/blockString.js +1 -1
  77. package/language/blockString.js.flow +1 -1
  78. package/language/blockString.mjs +1 -1
  79. package/language/directiveLocation.js +1 -1
  80. package/language/directiveLocation.mjs +1 -1
  81. package/language/index.js +1 -1
  82. package/language/index.mjs +1 -1
  83. package/language/kinds.js +1 -1
  84. package/language/kinds.mjs +1 -1
  85. package/language/lexer.js +11 -9
  86. package/language/lexer.js.flow +3 -1
  87. package/language/lexer.mjs +11 -9
  88. package/language/location.js +1 -1
  89. package/language/location.mjs +1 -1
  90. package/language/parser.js +2 -2
  91. package/language/parser.js.flow +1 -1
  92. package/language/parser.mjs +2 -2
  93. package/language/predicates.js +1 -1
  94. package/language/predicates.mjs +1 -1
  95. package/language/printer.js +1 -1
  96. package/language/printer.mjs +1 -1
  97. package/language/source.js +1 -1
  98. package/language/source.mjs +1 -1
  99. package/language/visitor.js +1 -1
  100. package/language/visitor.mjs +1 -1
  101. package/package.json +1 -1
  102. package/polyfills/find.js +1 -1
  103. package/polyfills/find.mjs +1 -1
  104. package/polyfills/flatMap.js +1 -1
  105. package/polyfills/flatMap.mjs +1 -1
  106. package/polyfills/isFinite.js +1 -1
  107. package/polyfills/isFinite.mjs +1 -1
  108. package/polyfills/isInteger.js +1 -1
  109. package/polyfills/isInteger.mjs +1 -1
  110. package/polyfills/objectEntries.js +1 -1
  111. package/polyfills/objectEntries.mjs +1 -1
  112. package/polyfills/objectValues.js +1 -1
  113. package/polyfills/objectValues.mjs +1 -1
  114. package/subscription/asyncIteratorReject.js +1 -1
  115. package/subscription/asyncIteratorReject.mjs +1 -1
  116. package/subscription/index.js +1 -1
  117. package/subscription/index.mjs +1 -1
  118. package/subscription/mapAsyncIterator.js +1 -1
  119. package/subscription/mapAsyncIterator.mjs +1 -1
  120. package/subscription/subscribe.js +1 -1
  121. package/subscription/subscribe.mjs +1 -1
  122. package/type/definition.js +8 -14
  123. package/type/definition.js.flow +4 -4
  124. package/type/definition.mjs +8 -14
  125. package/type/directives.js +1 -1
  126. package/type/directives.mjs +1 -1
  127. package/type/index.js +1 -1
  128. package/type/index.mjs +1 -1
  129. package/type/introspection.js +1 -1
  130. package/type/introspection.mjs +1 -1
  131. package/type/scalars.js +1 -1
  132. package/type/scalars.mjs +1 -1
  133. package/type/schema.js +3 -2
  134. package/type/schema.js.flow +4 -4
  135. package/type/schema.mjs +3 -2
  136. package/type/validate.js +1 -1
  137. package/type/validate.mjs +1 -1
  138. package/utilities/TypeInfo.js +92 -72
  139. package/utilities/TypeInfo.js.flow +18 -9
  140. package/utilities/TypeInfo.mjs +92 -72
  141. package/utilities/assertValidName.js +1 -1
  142. package/utilities/assertValidName.mjs +1 -1
  143. package/utilities/astFromValue.js +1 -1
  144. package/utilities/astFromValue.mjs +1 -1
  145. package/utilities/buildASTSchema.js +3 -1
  146. package/utilities/buildASTSchema.mjs +3 -1
  147. package/utilities/buildClientSchema.js +5 -2
  148. package/utilities/buildClientSchema.js.flow +3 -1
  149. package/utilities/buildClientSchema.mjs +5 -2
  150. package/utilities/coerceValue.js +1 -1
  151. package/utilities/coerceValue.mjs +1 -1
  152. package/utilities/concatAST.js +1 -1
  153. package/utilities/concatAST.mjs +1 -1
  154. package/utilities/extendSchema.js +1 -1
  155. package/utilities/extendSchema.mjs +1 -1
  156. package/utilities/findBreakingChanges.js +23 -34
  157. package/utilities/findBreakingChanges.js.flow +40 -34
  158. package/utilities/findBreakingChanges.mjs +49 -34
  159. package/utilities/findDeprecatedUsages.js +1 -1
  160. package/utilities/findDeprecatedUsages.mjs +1 -1
  161. package/utilities/getOperationAST.js +1 -1
  162. package/utilities/getOperationAST.mjs +1 -1
  163. package/utilities/getOperationRootType.js +23 -23
  164. package/utilities/getOperationRootType.js.flow +33 -30
  165. package/utilities/getOperationRootType.mjs +23 -23
  166. package/utilities/index.js +1 -1
  167. package/utilities/index.mjs +1 -1
  168. package/utilities/introspectionFromSchema.js +4 -2
  169. package/utilities/introspectionFromSchema.js.flow +2 -1
  170. package/utilities/introspectionFromSchema.mjs +3 -2
  171. package/utilities/introspectionQuery.js +1 -1
  172. package/utilities/introspectionQuery.mjs +1 -1
  173. package/utilities/isValidJSValue.js +1 -1
  174. package/utilities/isValidJSValue.mjs +1 -1
  175. package/utilities/isValidLiteralValue.js +1 -1
  176. package/utilities/isValidLiteralValue.mjs +1 -1
  177. package/utilities/lexicographicSortSchema.js +1 -1
  178. package/utilities/lexicographicSortSchema.mjs +1 -1
  179. package/utilities/schemaPrinter.js +1 -1
  180. package/utilities/schemaPrinter.mjs +1 -1
  181. package/utilities/separateOperations.js +1 -1
  182. package/utilities/separateOperations.mjs +1 -1
  183. package/utilities/stripIgnoredCharacters.js +7 -7
  184. package/utilities/stripIgnoredCharacters.js.flow +6 -6
  185. package/utilities/stripIgnoredCharacters.mjs +7 -7
  186. package/utilities/typeComparators.js +1 -1
  187. package/utilities/typeComparators.mjs +1 -1
  188. package/utilities/typeFromAST.js +1 -1
  189. package/utilities/typeFromAST.mjs +1 -1
  190. package/utilities/valueFromAST.js +1 -1
  191. package/utilities/valueFromAST.mjs +1 -1
  192. package/utilities/valueFromASTUntyped.js +5 -3
  193. package/utilities/valueFromASTUntyped.js.flow +2 -1
  194. package/utilities/valueFromASTUntyped.mjs +5 -3
  195. package/validation/ValidationContext.js +1 -1
  196. package/validation/ValidationContext.mjs +1 -1
  197. package/validation/index.js +1 -1
  198. package/validation/index.mjs +1 -1
  199. package/validation/rules/ExecutableDefinitions.js +1 -1
  200. package/validation/rules/ExecutableDefinitions.mjs +1 -1
  201. package/validation/rules/FieldsOnCorrectType.js +1 -1
  202. package/validation/rules/FieldsOnCorrectType.mjs +1 -1
  203. package/validation/rules/FragmentsOnCompositeTypes.js +1 -1
  204. package/validation/rules/FragmentsOnCompositeTypes.mjs +1 -1
  205. package/validation/rules/KnownArgumentNames.js +1 -1
  206. package/validation/rules/KnownArgumentNames.mjs +1 -1
  207. package/validation/rules/KnownDirectives.js +5 -3
  208. package/validation/rules/KnownDirectives.js.flow +2 -1
  209. package/validation/rules/KnownDirectives.mjs +5 -3
  210. package/validation/rules/KnownFragmentNames.js +1 -1
  211. package/validation/rules/KnownFragmentNames.mjs +1 -1
  212. package/validation/rules/KnownTypeNames.js +1 -1
  213. package/validation/rules/KnownTypeNames.mjs +1 -1
  214. package/validation/rules/LoneAnonymousOperation.js +1 -1
  215. package/validation/rules/LoneAnonymousOperation.mjs +1 -1
  216. package/validation/rules/LoneSchemaDefinition.js +1 -1
  217. package/validation/rules/LoneSchemaDefinition.mjs +1 -1
  218. package/validation/rules/NoFragmentCycles.js +1 -1
  219. package/validation/rules/NoFragmentCycles.mjs +1 -1
  220. package/validation/rules/NoUndefinedVariables.js +1 -1
  221. package/validation/rules/NoUndefinedVariables.mjs +1 -1
  222. package/validation/rules/NoUnusedFragments.js +1 -1
  223. package/validation/rules/NoUnusedFragments.mjs +1 -1
  224. package/validation/rules/NoUnusedVariables.js +1 -1
  225. package/validation/rules/NoUnusedVariables.mjs +1 -1
  226. package/validation/rules/OverlappingFieldsCanBeMerged.js +21 -16
  227. package/validation/rules/OverlappingFieldsCanBeMerged.js.flow +4 -2
  228. package/validation/rules/OverlappingFieldsCanBeMerged.mjs +21 -16
  229. package/validation/rules/PossibleFragmentSpreads.js +1 -1
  230. package/validation/rules/PossibleFragmentSpreads.mjs +1 -1
  231. package/validation/rules/PossibleTypeExtensions.js +1 -1
  232. package/validation/rules/PossibleTypeExtensions.mjs +1 -1
  233. package/validation/rules/ProvidedRequiredArguments.js +1 -1
  234. package/validation/rules/ProvidedRequiredArguments.mjs +1 -1
  235. package/validation/rules/ScalarLeafs.js +1 -1
  236. package/validation/rules/ScalarLeafs.mjs +1 -1
  237. package/validation/rules/SingleFieldSubscriptions.js +1 -1
  238. package/validation/rules/SingleFieldSubscriptions.mjs +1 -1
  239. package/validation/rules/UniqueArgumentNames.js +1 -1
  240. package/validation/rules/UniqueArgumentNames.mjs +1 -1
  241. package/validation/rules/UniqueDirectiveNames.js +1 -1
  242. package/validation/rules/UniqueDirectiveNames.mjs +1 -1
  243. package/validation/rules/UniqueDirectivesPerLocation.js +2 -1
  244. package/validation/rules/UniqueDirectivesPerLocation.mjs +2 -1
  245. package/validation/rules/UniqueEnumValueNames.js +1 -1
  246. package/validation/rules/UniqueEnumValueNames.mjs +1 -1
  247. package/validation/rules/UniqueFieldDefinitionNames.js +1 -1
  248. package/validation/rules/UniqueFieldDefinitionNames.mjs +1 -1
  249. package/validation/rules/UniqueFragmentNames.js +1 -1
  250. package/validation/rules/UniqueFragmentNames.mjs +1 -1
  251. package/validation/rules/UniqueInputFieldNames.js +1 -1
  252. package/validation/rules/UniqueInputFieldNames.mjs +1 -1
  253. package/validation/rules/UniqueOperationNames.js +1 -1
  254. package/validation/rules/UniqueOperationNames.mjs +1 -1
  255. package/validation/rules/UniqueOperationTypes.js +1 -1
  256. package/validation/rules/UniqueOperationTypes.mjs +1 -1
  257. package/validation/rules/UniqueTypeNames.js +1 -1
  258. package/validation/rules/UniqueTypeNames.mjs +1 -1
  259. package/validation/rules/UniqueVariableNames.js +1 -1
  260. package/validation/rules/UniqueVariableNames.mjs +1 -1
  261. package/validation/rules/ValuesOfCorrectType.js +1 -1
  262. package/validation/rules/ValuesOfCorrectType.mjs +1 -1
  263. package/validation/rules/VariablesAreInputTypes.js +1 -1
  264. package/validation/rules/VariablesAreInputTypes.mjs +1 -1
  265. package/validation/rules/VariablesInAllowedPosition.js +2 -2
  266. package/validation/rules/VariablesInAllowedPosition.js.flow +1 -1
  267. package/validation/rules/VariablesInAllowedPosition.mjs +2 -2
  268. package/validation/specifiedRules.js +1 -1
  269. package/validation/specifiedRules.mjs +1 -1
  270. package/validation/validate.js +1 -1
  271. package/validation/validate.mjs +1 -1
  272. package/codecov.yml +0 -14
@@ -15,4 +15,4 @@ var objectEntries = Object.entries || function (obj) {
15
15
  });
16
16
  };
17
17
 
18
- export default objectEntries;
18
+ export default objectEntries;
@@ -23,4 +23,4 @@ var objectValues = Object.values || function (obj) {
23
23
  };
24
24
 
25
25
  var _default = objectValues;
26
- exports.default = _default;
26
+ exports.default = _default;
@@ -15,4 +15,4 @@ var objectValues = Object.values || function (obj) {
15
15
  });
16
16
  };
17
17
 
18
- export default objectValues;
18
+ export default objectValues;
@@ -42,4 +42,4 @@ function asyncIteratorReject(error) {
42
42
  }, _iterall.$$asyncIterator, function () {
43
43
  return this;
44
44
  });
45
- }
45
+ }
@@ -43,4 +43,4 @@ export default function asyncIteratorReject(error) {
43
43
  }, $$asyncIterator, function () {
44
44
  return this;
45
45
  });
46
- }
46
+ }
@@ -16,4 +16,4 @@ Object.defineProperty(exports, "createSourceEventStream", {
16
16
  }
17
17
  });
18
18
 
19
- var _subscribe = require("./subscribe");
19
+ var _subscribe = require("./subscribe");
@@ -6,4 +6,4 @@
6
6
  *
7
7
  *
8
8
  */
9
- export { subscribe, createSourceEventStream } from './subscribe';
9
+ export { subscribe, createSourceEventStream } from './subscribe';
@@ -82,4 +82,4 @@ function iteratorResult(value) {
82
82
  value: value,
83
83
  done: false
84
84
  };
85
- }
85
+ }
@@ -83,4 +83,4 @@ function iteratorResult(value) {
83
83
  value: value,
84
84
  done: false
85
85
  };
86
- }
86
+ }
@@ -148,4 +148,4 @@ function createSourceEventStream(schema, document, rootValue, contextValue, vari
148
148
  } catch (error) {
149
149
  return Promise.reject(error);
150
150
  }
151
- }
151
+ }
@@ -151,4 +151,4 @@ export function createSourceEventStream(schema, document, rootValue, contextValu
151
151
  } catch (error) {
152
152
  return Promise.reject(error);
153
153
  }
154
- }
154
+ }
@@ -564,7 +564,7 @@ function defineFieldMap(config) {
564
564
  !isPlainObj(fieldMap) ? (0, _invariant.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a ") + 'function which returns such an object.') : void 0;
565
565
  return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) {
566
566
  !isPlainObj(fieldConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " field config must be an object")) : void 0;
567
- !!fieldConfig.hasOwnProperty('isDeprecated') ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" ") + 'instead of "isDeprecated".') : void 0;
567
+ !!('isDeprecated' in fieldConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" ") + 'instead of "isDeprecated".') : void 0;
568
568
  !(fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function') ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat((0, _inspect.default)(fieldConfig.resolve), ".")) : void 0;
569
569
  var argsConfig = fieldConfig.args || {};
570
570
  !isPlainObj(argsConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " args must be an object with argument ") + 'names as keys.') : void 0;
@@ -789,9 +789,7 @@ var GraphQLEnumType
789
789
  =
790
790
  /*#__PURE__*/
791
791
  function () {
792
- function GraphQLEnumType(config
793
- /* <T> */
794
- ) {
792
+ function GraphQLEnumType(config) {
795
793
  this.name = config.name;
796
794
  this.description = config.description;
797
795
  this.astNode = config.astNode;
@@ -816,9 +814,7 @@ function () {
816
814
  return this._nameLookup[name];
817
815
  };
818
816
 
819
- _proto5.serialize = function serialize(value
820
- /* T */
821
- ) {
817
+ _proto5.serialize = function serialize(value) {
822
818
  var enumValue = this._valueLookup.get(value);
823
819
 
824
820
  if (enumValue) {
@@ -883,22 +879,20 @@ exports.GraphQLEnumType = GraphQLEnumType;
883
879
  (0, _defineToStringTag.default)(GraphQLEnumType);
884
880
  (0, _defineToJSON.default)(GraphQLEnumType);
885
881
 
886
- function defineEnumValues(type, valueMap
887
- /* <T> */
888
- ) {
882
+ function defineEnumValues(type, valueMap) {
889
883
  !isPlainObj(valueMap) ? (0, _invariant.default)(0, "".concat(type.name, " values must be an object with value names as keys.")) : void 0;
890
884
  return (0, _objectEntries.default)(valueMap).map(function (_ref2) {
891
885
  var valueName = _ref2[0],
892
886
  value = _ref2[1];
893
887
  !isPlainObj(value) ? (0, _invariant.default)(0, "".concat(type.name, ".").concat(valueName, " must refer to an object with a \"value\" key ") + "representing an internal value but got: ".concat((0, _inspect.default)(value), ".")) : void 0;
894
- !!value.hasOwnProperty('isDeprecated') ? (0, _invariant.default)(0, "".concat(type.name, ".").concat(valueName, " should provide \"deprecationReason\" instead ") + 'of "isDeprecated".') : void 0;
888
+ !!('isDeprecated' in value) ? (0, _invariant.default)(0, "".concat(type.name, ".").concat(valueName, " should provide \"deprecationReason\" instead ") + 'of "isDeprecated".') : void 0;
895
889
  return {
896
890
  name: valueName,
897
891
  description: value.description,
898
892
  isDeprecated: Boolean(value.deprecationReason),
899
893
  deprecationReason: value.deprecationReason,
900
894
  astNode: value.astNode,
901
- value: value.hasOwnProperty('value') ? value.value : valueName
895
+ value: 'value' in value ? value.value : valueName
902
896
  };
903
897
  });
904
898
  }
@@ -979,7 +973,7 @@ function defineInputFieldMap(config) {
979
973
  var fieldMap = resolveThunk(config.fields) || {};
980
974
  !isPlainObj(fieldMap) ? (0, _invariant.default)(0, "".concat(config.name, " fields must be an object with field names as keys or a ") + 'function which returns such an object.') : void 0;
981
975
  return (0, _mapValue.default)(fieldMap, function (fieldConfig, fieldName) {
982
- !!fieldConfig.hasOwnProperty('resolve') ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but ") + 'Input Types cannot define resolvers.') : void 0;
976
+ !!('resolve' in fieldConfig) ? (0, _invariant.default)(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but ") + 'Input Types cannot define resolvers.') : void 0;
983
977
  return _objectSpread({}, fieldConfig, {
984
978
  name: fieldName
985
979
  });
@@ -988,4 +982,4 @@ function defineInputFieldMap(config) {
988
982
 
989
983
  function isRequiredInputField(field) {
990
984
  return isNonNullType(field.type) && field.defaultValue === undefined;
991
- }
985
+ }
@@ -759,7 +759,7 @@ function defineFieldMap<TSource, TContext>(
759
759
  `${config.name}.${fieldName} field config must be an object`,
760
760
  );
761
761
  invariant(
762
- !fieldConfig.hasOwnProperty('isDeprecated'),
762
+ !('isDeprecated' in fieldConfig),
763
763
  `${config.name}.${fieldName} should provide "deprecationReason" ` +
764
764
  'instead of "isDeprecated".',
765
765
  );
@@ -1253,7 +1253,7 @@ function defineEnumValues(
1253
1253
  `representing an internal value but got: ${inspect(value)}.`,
1254
1254
  );
1255
1255
  invariant(
1256
- !value.hasOwnProperty('isDeprecated'),
1256
+ !('isDeprecated' in value),
1257
1257
  `${type.name}.${valueName} should provide "deprecationReason" instead ` +
1258
1258
  'of "isDeprecated".',
1259
1259
  );
@@ -1263,7 +1263,7 @@ function defineEnumValues(
1263
1263
  isDeprecated: Boolean(value.deprecationReason),
1264
1264
  deprecationReason: value.deprecationReason,
1265
1265
  astNode: value.astNode,
1266
- value: value.hasOwnProperty('value') ? value.value : valueName,
1266
+ value: 'value' in value ? value.value : valueName,
1267
1267
  };
1268
1268
  });
1269
1269
  }
@@ -1379,7 +1379,7 @@ function defineInputFieldMap(
1379
1379
  );
1380
1380
  return mapValue(fieldMap, (fieldConfig, fieldName) => {
1381
1381
  invariant(
1382
- !fieldConfig.hasOwnProperty('resolve'),
1382
+ !('resolve' in fieldConfig),
1383
1383
  `${config.name}.${fieldName} field has a resolve property, but ` +
1384
1384
  'Input Types cannot define resolvers.',
1385
1385
  );
@@ -469,7 +469,7 @@ function defineFieldMap(config) {
469
469
  !isPlainObj(fieldMap) ? invariant(0, "".concat(config.name, " fields must be an object with field names as keys or a ") + 'function which returns such an object.') : void 0;
470
470
  return mapValue(fieldMap, function (fieldConfig, fieldName) {
471
471
  !isPlainObj(fieldConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " field config must be an object")) : void 0;
472
- !!fieldConfig.hasOwnProperty('isDeprecated') ? invariant(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" ") + 'instead of "isDeprecated".') : void 0;
472
+ !!('isDeprecated' in fieldConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " should provide \"deprecationReason\" ") + 'instead of "isDeprecated".') : void 0;
473
473
  !(fieldConfig.resolve == null || typeof fieldConfig.resolve === 'function') ? invariant(0, "".concat(config.name, ".").concat(fieldName, " field resolver must be a function if ") + "provided, but got: ".concat(inspect(fieldConfig.resolve), ".")) : void 0;
474
474
  var argsConfig = fieldConfig.args || {};
475
475
  !isPlainObj(argsConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " args must be an object with argument ") + 'names as keys.') : void 0;
@@ -689,9 +689,7 @@ export var GraphQLEnumType
689
689
  =
690
690
  /*#__PURE__*/
691
691
  function () {
692
- function GraphQLEnumType(config
693
- /* <T> */
694
- ) {
692
+ function GraphQLEnumType(config) {
695
693
  this.name = config.name;
696
694
  this.description = config.description;
697
695
  this.astNode = config.astNode;
@@ -716,9 +714,7 @@ function () {
716
714
  return this._nameLookup[name];
717
715
  };
718
716
 
719
- _proto5.serialize = function serialize(value
720
- /* T */
721
- ) {
717
+ _proto5.serialize = function serialize(value) {
722
718
  var enumValue = this._valueLookup.get(value);
723
719
 
724
720
  if (enumValue) {
@@ -781,22 +777,20 @@ function () {
781
777
  defineToStringTag(GraphQLEnumType);
782
778
  defineToJSON(GraphQLEnumType);
783
779
 
784
- function defineEnumValues(type, valueMap
785
- /* <T> */
786
- ) {
780
+ function defineEnumValues(type, valueMap) {
787
781
  !isPlainObj(valueMap) ? invariant(0, "".concat(type.name, " values must be an object with value names as keys.")) : void 0;
788
782
  return objectEntries(valueMap).map(function (_ref2) {
789
783
  var valueName = _ref2[0],
790
784
  value = _ref2[1];
791
785
  !isPlainObj(value) ? invariant(0, "".concat(type.name, ".").concat(valueName, " must refer to an object with a \"value\" key ") + "representing an internal value but got: ".concat(inspect(value), ".")) : void 0;
792
- !!value.hasOwnProperty('isDeprecated') ? invariant(0, "".concat(type.name, ".").concat(valueName, " should provide \"deprecationReason\" instead ") + 'of "isDeprecated".') : void 0;
786
+ !!('isDeprecated' in value) ? invariant(0, "".concat(type.name, ".").concat(valueName, " should provide \"deprecationReason\" instead ") + 'of "isDeprecated".') : void 0;
793
787
  return {
794
788
  name: valueName,
795
789
  description: value.description,
796
790
  isDeprecated: Boolean(value.deprecationReason),
797
791
  deprecationReason: value.deprecationReason,
798
792
  astNode: value.astNode,
799
- value: value.hasOwnProperty('value') ? value.value : valueName
793
+ value: 'value' in value ? value.value : valueName
800
794
  };
801
795
  });
802
796
  }
@@ -875,7 +869,7 @@ function defineInputFieldMap(config) {
875
869
  var fieldMap = resolveThunk(config.fields) || {};
876
870
  !isPlainObj(fieldMap) ? invariant(0, "".concat(config.name, " fields must be an object with field names as keys or a ") + 'function which returns such an object.') : void 0;
877
871
  return mapValue(fieldMap, function (fieldConfig, fieldName) {
878
- !!fieldConfig.hasOwnProperty('resolve') ? invariant(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but ") + 'Input Types cannot define resolvers.') : void 0;
872
+ !!('resolve' in fieldConfig) ? invariant(0, "".concat(config.name, ".").concat(fieldName, " field has a resolve property, but ") + 'Input Types cannot define resolvers.') : void 0;
879
873
  return _objectSpread({}, fieldConfig, {
880
874
  name: fieldName
881
875
  });
@@ -884,4 +878,4 @@ function defineInputFieldMap(config) {
884
878
 
885
879
  export function isRequiredInputField(field) {
886
880
  return isNonNullType(field.type) && field.defaultValue === undefined;
887
- }
881
+ }
@@ -160,4 +160,4 @@ function isSpecifiedDirective(directive) {
160
160
  var name = _ref2.name;
161
161
  return name === directive.name;
162
162
  });
163
- }
163
+ }
@@ -141,4 +141,4 @@ export function isSpecifiedDirective(directive) {
141
141
  var name = _ref2.name;
142
142
  return name === directive.name;
143
143
  });
144
- }
144
+ }
package/type/index.js CHANGED
@@ -500,4 +500,4 @@ var _scalars = require("./scalars");
500
500
 
501
501
  var _introspection = require("./introspection");
502
502
 
503
- var _validate = require("./validate");
503
+ var _validate = require("./validate");
package/type/index.mjs CHANGED
@@ -32,4 +32,4 @@ introspectionTypes, __Schema, __Directive, __DirectiveLocation, __Type, __Field,
32
32
  TypeKind, // Meta-field definitions.
33
33
  SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef } from './introspection';
34
34
  // Validate GraphQL schema.
35
- export { validateSchema, assertValidSchema } from './validate';
35
+ export { validateSchema, assertValidSchema } from './validate';
@@ -548,4 +548,4 @@ function isIntrospectionType(type) {
548
548
  var name = _ref8.name;
549
549
  return type.name === name;
550
550
  });
551
- }
551
+ }
@@ -502,4 +502,4 @@ export function isIntrospectionType(type) {
502
502
  var name = _ref8.name;
503
503
  return type.name === name;
504
504
  });
505
- }
505
+ }
package/type/scalars.js CHANGED
@@ -253,4 +253,4 @@ function isSpecifiedScalarType(type) {
253
253
  var name = _ref.name;
254
254
  return type.name === name;
255
255
  });
256
- }
256
+ }
package/type/scalars.mjs CHANGED
@@ -238,4 +238,4 @@ export function isSpecifiedScalarType(type) {
238
238
  var name = _ref.name;
239
239
  return type.name === name;
240
240
  });
241
- }
241
+ }
package/type/schema.js CHANGED
@@ -247,7 +247,8 @@ function () {
247
247
  if (!possibleTypeMap[abstractType.name]) {
248
248
  var possibleTypes = this.getPossibleTypes(abstractType);
249
249
  possibleTypeMap[abstractType.name] = possibleTypes.reduce(function (map, type) {
250
- return map[type.name] = true, map;
250
+ map[type.name] = true;
251
+ return map;
251
252
  }, Object.create(null));
252
253
  }
253
254
 
@@ -382,4 +383,4 @@ function typeMapDirectiveReducer(map, directive) {
382
383
  return directive.args.reduce(function (_map, arg) {
383
384
  return typeMapReducer(_map, arg.type);
384
385
  }, map);
385
- }
386
+ }
@@ -257,10 +257,10 @@ export class GraphQLSchema {
257
257
 
258
258
  if (!possibleTypeMap[abstractType.name]) {
259
259
  const possibleTypes = this.getPossibleTypes(abstractType);
260
- possibleTypeMap[abstractType.name] = possibleTypes.reduce(
261
- (map, type) => ((map[type.name] = true), map),
262
- Object.create(null),
263
- );
260
+ possibleTypeMap[abstractType.name] = possibleTypes.reduce((map, type) => {
261
+ map[type.name] = true;
262
+ return map;
263
+ }, Object.create(null));
264
264
  }
265
265
 
266
266
  return Boolean(possibleTypeMap[abstractType.name][possibleType.name]);
package/type/schema.mjs CHANGED
@@ -233,7 +233,8 @@ function () {
233
233
  if (!possibleTypeMap[abstractType.name]) {
234
234
  var possibleTypes = this.getPossibleTypes(abstractType);
235
235
  possibleTypeMap[abstractType.name] = possibleTypes.reduce(function (map, type) {
236
- return map[type.name] = true, map;
236
+ map[type.name] = true;
237
+ return map;
237
238
  }, Object.create(null));
238
239
  }
239
240
 
@@ -366,4 +367,4 @@ function typeMapDirectiveReducer(map, directive) {
366
367
  return directive.args.reduce(function (_map, arg) {
367
368
  return typeMapReducer(_map, arg.type);
368
369
  }, map);
369
- }
370
+ }
package/type/validate.js CHANGED
@@ -770,4 +770,4 @@ function getUnionMemberTypeNodes(union, typeName) {
770
770
  }).filter(function (typeNode) {
771
771
  return typeNode.name.value === typeName;
772
772
  });
773
- }
773
+ }
package/type/validate.mjs CHANGED
@@ -747,4 +747,4 @@ function getUnionMemberTypeNodes(union, typeName) {
747
747
  }).filter(function (typeNode) {
748
748
  return typeNode.name.value === typeName;
749
749
  });
750
- }
750
+ }
@@ -36,7 +36,9 @@ var TypeInfo =
36
36
  function () {
37
37
  function TypeInfo(schema, // NOTE: this experimental optional second parameter is only needed in order
38
38
  // to support non-spec-compliant codebases. You should never need to use it.
39
+ // It may disappear in the future.
39
40
  getFieldDefFn, // Initial type may be provided in rare cases to facilitate traversals
41
+ // beginning somewhere other than documents.
40
42
  initialType) {
41
43
  this._schema = schema;
42
44
  this._typeStack = [];
@@ -122,128 +124,146 @@ function () {
122
124
 
123
125
  switch (node.kind) {
124
126
  case _kinds.Kind.SELECTION_SET:
125
- var namedType = (0, _definition.getNamedType)(this.getType());
127
+ {
128
+ var namedType = (0, _definition.getNamedType)(this.getType());
126
129
 
127
- this._parentTypeStack.push((0, _definition.isCompositeType)(namedType) ? namedType : undefined);
130
+ this._parentTypeStack.push((0, _definition.isCompositeType)(namedType) ? namedType : undefined);
128
131
 
129
- break;
132
+ break;
133
+ }
130
134
 
131
135
  case _kinds.Kind.FIELD:
132
- var parentType = this.getParentType();
133
- var fieldDef;
134
- var fieldType;
136
+ {
137
+ var parentType = this.getParentType();
138
+ var fieldDef;
139
+ var fieldType;
135
140
 
136
- if (parentType) {
137
- fieldDef = this._getFieldDef(schema, parentType, node);
141
+ if (parentType) {
142
+ fieldDef = this._getFieldDef(schema, parentType, node);
138
143
 
139
- if (fieldDef) {
140
- fieldType = fieldDef.type;
144
+ if (fieldDef) {
145
+ fieldType = fieldDef.type;
146
+ }
141
147
  }
142
- }
143
148
 
144
- this._fieldDefStack.push(fieldDef);
149
+ this._fieldDefStack.push(fieldDef);
145
150
 
146
- this._typeStack.push((0, _definition.isOutputType)(fieldType) ? fieldType : undefined);
151
+ this._typeStack.push((0, _definition.isOutputType)(fieldType) ? fieldType : undefined);
147
152
 
148
- break;
153
+ break;
154
+ }
149
155
 
150
156
  case _kinds.Kind.DIRECTIVE:
151
157
  this._directive = schema.getDirective(node.name.value);
152
158
  break;
153
159
 
154
160
  case _kinds.Kind.OPERATION_DEFINITION:
155
- var type;
156
-
157
- if (node.operation === 'query') {
158
- type = schema.getQueryType();
159
- } else if (node.operation === 'mutation') {
160
- type = schema.getMutationType();
161
- } else if (node.operation === 'subscription') {
162
- type = schema.getSubscriptionType();
163
- }
161
+ {
162
+ var type;
163
+
164
+ if (node.operation === 'query') {
165
+ type = schema.getQueryType();
166
+ } else if (node.operation === 'mutation') {
167
+ type = schema.getMutationType();
168
+ } else if (node.operation === 'subscription') {
169
+ type = schema.getSubscriptionType();
170
+ }
164
171
 
165
- this._typeStack.push((0, _definition.isObjectType)(type) ? type : undefined);
172
+ this._typeStack.push((0, _definition.isObjectType)(type) ? type : undefined);
166
173
 
167
- break;
174
+ break;
175
+ }
168
176
 
169
177
  case _kinds.Kind.INLINE_FRAGMENT:
170
178
  case _kinds.Kind.FRAGMENT_DEFINITION:
171
- var typeConditionAST = node.typeCondition;
172
- var outputType = typeConditionAST ? (0, _typeFromAST.typeFromAST)(schema, typeConditionAST) : (0, _definition.getNamedType)(this.getType());
179
+ {
180
+ var typeConditionAST = node.typeCondition;
181
+ var outputType = typeConditionAST ? (0, _typeFromAST.typeFromAST)(schema, typeConditionAST) : (0, _definition.getNamedType)(this.getType());
173
182
 
174
- this._typeStack.push((0, _definition.isOutputType)(outputType) ? outputType : undefined);
183
+ this._typeStack.push((0, _definition.isOutputType)(outputType) ? outputType : undefined);
175
184
 
176
- break;
185
+ break;
186
+ }
177
187
 
178
188
  case _kinds.Kind.VARIABLE_DEFINITION:
179
- var inputType = (0, _typeFromAST.typeFromAST)(schema, node.type);
189
+ {
190
+ var inputType = (0, _typeFromAST.typeFromAST)(schema, node.type);
180
191
 
181
- this._inputTypeStack.push((0, _definition.isInputType)(inputType) ? inputType : undefined);
192
+ this._inputTypeStack.push((0, _definition.isInputType)(inputType) ? inputType : undefined);
182
193
 
183
- break;
194
+ break;
195
+ }
184
196
 
185
197
  case _kinds.Kind.ARGUMENT:
186
- var argDef;
187
- var argType;
188
- var fieldOrDirective = this.getDirective() || this.getFieldDef();
189
-
190
- if (fieldOrDirective) {
191
- argDef = (0, _find.default)(fieldOrDirective.args, function (arg) {
192
- return arg.name === node.name.value;
193
- });
194
-
195
- if (argDef) {
196
- argType = argDef.type;
198
+ {
199
+ var argDef;
200
+ var argType;
201
+ var fieldOrDirective = this.getDirective() || this.getFieldDef();
202
+
203
+ if (fieldOrDirective) {
204
+ argDef = (0, _find.default)(fieldOrDirective.args, function (arg) {
205
+ return arg.name === node.name.value;
206
+ });
207
+
208
+ if (argDef) {
209
+ argType = argDef.type;
210
+ }
197
211
  }
198
- }
199
212
 
200
- this._argument = argDef;
213
+ this._argument = argDef;
201
214
 
202
- this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined);
215
+ this._defaultValueStack.push(argDef ? argDef.defaultValue : undefined);
203
216
 
204
- this._inputTypeStack.push((0, _definition.isInputType)(argType) ? argType : undefined);
217
+ this._inputTypeStack.push((0, _definition.isInputType)(argType) ? argType : undefined);
205
218
 
206
- break;
219
+ break;
220
+ }
207
221
 
208
222
  case _kinds.Kind.LIST:
209
- var listType = (0, _definition.getNullableType)(this.getInputType());
210
- var itemType = (0, _definition.isListType)(listType) ? listType.ofType : listType; // List positions never have a default value.
223
+ {
224
+ var listType = (0, _definition.getNullableType)(this.getInputType());
225
+ var itemType = (0, _definition.isListType)(listType) ? listType.ofType : listType; // List positions never have a default value.
211
226
 
212
- this._defaultValueStack.push(undefined);
227
+ this._defaultValueStack.push(undefined);
213
228
 
214
- this._inputTypeStack.push((0, _definition.isInputType)(itemType) ? itemType : undefined);
229
+ this._inputTypeStack.push((0, _definition.isInputType)(itemType) ? itemType : undefined);
215
230
 
216
- break;
231
+ break;
232
+ }
217
233
 
218
234
  case _kinds.Kind.OBJECT_FIELD:
219
- var objectType = (0, _definition.getNamedType)(this.getInputType());
220
- var inputFieldType;
221
- var inputField;
235
+ {
236
+ var objectType = (0, _definition.getNamedType)(this.getInputType());
237
+ var inputFieldType;
238
+ var inputField;
222
239
 
223
- if ((0, _definition.isInputObjectType)(objectType)) {
224
- inputField = objectType.getFields()[node.name.value];
240
+ if ((0, _definition.isInputObjectType)(objectType)) {
241
+ inputField = objectType.getFields()[node.name.value];
225
242
 
226
- if (inputField) {
227
- inputFieldType = inputField.type;
243
+ if (inputField) {
244
+ inputFieldType = inputField.type;
245
+ }
228
246
  }
229
- }
230
247
 
231
- this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined);
248
+ this._defaultValueStack.push(inputField ? inputField.defaultValue : undefined);
232
249
 
233
- this._inputTypeStack.push((0, _definition.isInputType)(inputFieldType) ? inputFieldType : undefined);
250
+ this._inputTypeStack.push((0, _definition.isInputType)(inputFieldType) ? inputFieldType : undefined);
234
251
 
235
- break;
252
+ break;
253
+ }
236
254
 
237
255
  case _kinds.Kind.ENUM:
238
- var enumType = (0, _definition.getNamedType)(this.getInputType());
239
- var enumValue;
256
+ {
257
+ var enumType = (0, _definition.getNamedType)(this.getInputType());
258
+ var enumValue;
240
259
 
241
- if ((0, _definition.isEnumType)(enumType)) {
242
- enumValue = enumType.getValue(node.value);
243
- }
260
+ if ((0, _definition.isEnumType)(enumType)) {
261
+ enumValue = enumType.getValue(node.value);
262
+ }
244
263
 
245
- this._enumValue = enumValue;
246
- break;
264
+ this._enumValue = enumValue;
265
+ break;
266
+ }
247
267
  }
248
268
  };
249
269
 
@@ -329,4 +349,4 @@ function getFieldDef(schema, parentType, fieldNode) {
329
349
  if ((0, _definition.isObjectType)(parentType) || (0, _definition.isInterfaceType)(parentType)) {
330
350
  return parentType.getFields()[name];
331
351
  }
332
- }
352
+ }