graphql 15.4.0 → 15.5.3

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 (72) hide show
  1. package/README.md +10 -0
  2. package/error/GraphQLError.js +3 -3
  3. package/error/GraphQLError.js.flow +1 -1
  4. package/error/GraphQLError.mjs +1 -1
  5. package/execution/execute.js +8 -9
  6. package/execution/execute.js.flow +8 -10
  7. package/execution/execute.mjs +8 -8
  8. package/jsutils/instanceOf.js +15 -9
  9. package/jsutils/instanceOf.js.flow +12 -5
  10. package/jsutils/instanceOf.mjs +13 -5
  11. package/jsutils/isAsyncIterable.js +1 -7
  12. package/jsutils/isAsyncIterable.js.flow +1 -5
  13. package/jsutils/isAsyncIterable.mjs +1 -7
  14. package/jsutils/naturalCompare.js +69 -0
  15. package/jsutils/naturalCompare.js.flow +59 -0
  16. package/jsutils/naturalCompare.mjs +61 -0
  17. package/jsutils/safeArrayFrom.js +73 -0
  18. package/jsutils/safeArrayFrom.js.flow +59 -0
  19. package/jsutils/safeArrayFrom.mjs +66 -0
  20. package/jsutils/suggestionList.js +5 -1
  21. package/jsutils/suggestionList.js.flow +3 -1
  22. package/jsutils/suggestionList.mjs +3 -1
  23. package/language/blockString.js.flow +2 -2
  24. package/language/parser.d.ts +456 -1
  25. package/language/source.js.flow +1 -1
  26. package/package.json +2 -3
  27. package/type/definition.js +1 -0
  28. package/type/definition.js.flow +58 -45
  29. package/type/definition.mjs +1 -0
  30. package/type/directives.js.flow +9 -7
  31. package/type/schema.js.flow +1 -1
  32. package/utilities/TypeInfo.js.flow +1 -1
  33. package/utilities/astFromValue.js +6 -8
  34. package/utilities/astFromValue.js.flow +6 -6
  35. package/utilities/astFromValue.mjs +6 -7
  36. package/utilities/buildClientSchema.js +2 -1
  37. package/utilities/buildClientSchema.js.flow +1 -0
  38. package/utilities/buildClientSchema.mjs +2 -1
  39. package/utilities/coerceInputValue.js +7 -8
  40. package/utilities/coerceInputValue.js.flow +11 -8
  41. package/utilities/coerceInputValue.mjs +7 -7
  42. package/utilities/findBreakingChanges.js +6 -2
  43. package/utilities/findBreakingChanges.js.flow +6 -2
  44. package/utilities/findBreakingChanges.mjs +5 -2
  45. package/utilities/getIntrospectionQuery.d.ts +6 -0
  46. package/utilities/getIntrospectionQuery.js +8 -2
  47. package/utilities/getIntrospectionQuery.js.flow +16 -3
  48. package/utilities/getIntrospectionQuery.mjs +8 -2
  49. package/utilities/introspectionFromSchema.js +3 -1
  50. package/utilities/introspectionFromSchema.js.flow +2 -0
  51. package/utilities/introspectionFromSchema.mjs +3 -1
  52. package/utilities/lexicographicSortSchema.js +3 -1
  53. package/utilities/lexicographicSortSchema.js.flow +3 -2
  54. package/utilities/lexicographicSortSchema.mjs +2 -1
  55. package/utilities/separateOperations.js +44 -40
  56. package/utilities/separateOperations.js.flow +46 -36
  57. package/utilities/separateOperations.mjs +44 -40
  58. package/validation/ValidationContext.js.flow +3 -3
  59. package/validation/rules/FieldsOnCorrectTypeRule.js +3 -1
  60. package/validation/rules/FieldsOnCorrectTypeRule.js.flow +2 -1
  61. package/validation/rules/FieldsOnCorrectTypeRule.mjs +2 -1
  62. package/validation/rules/UniqueDirectiveNamesRule.js +1 -1
  63. package/validation/rules/UniqueDirectiveNamesRule.mjs +1 -1
  64. package/validation/rules/UniqueTypeNamesRule.js +1 -1
  65. package/validation/rules/UniqueTypeNamesRule.mjs +1 -1
  66. package/validation/validate.js.flow +4 -4
  67. package/version.js +3 -3
  68. package/version.js.flow +3 -3
  69. package/version.mjs +3 -3
  70. package/jsutils/isCollection.js +0 -47
  71. package/jsutils/isCollection.js.flow +0 -38
  72. package/jsutils/isCollection.mjs +0 -40
@@ -27,7 +27,7 @@ function UniqueTypeNamesRule(context) {
27
27
  function checkTypeName(node) {
28
28
  var typeName = node.name.value;
29
29
 
30
- if (schema === null || schema === void 0 ? void 0 : schema.getType(typeName)) {
30
+ if (schema !== null && schema !== void 0 && schema.getType(typeName)) {
31
31
  context.reportError(new _GraphQLError.GraphQLError("Type \"".concat(typeName, "\" already exists in the schema. It cannot also be defined in this type definition."), node.name));
32
32
  return;
33
33
  }
@@ -20,7 +20,7 @@ export function UniqueTypeNamesRule(context) {
20
20
  function checkTypeName(node) {
21
21
  var typeName = node.name.value;
22
22
 
23
- if (schema === null || schema === void 0 ? void 0 : schema.getType(typeName)) {
23
+ if (schema !== null && schema !== void 0 && schema.getType(typeName)) {
24
24
  context.reportError(new GraphQLError("Type \"".concat(typeName, "\" already exists in the schema. It cannot also be defined in this type definition."), node.name));
25
25
  return;
26
26
  }
@@ -34,9 +34,9 @@ import { SDLValidationContext, ValidationContext } from './ValidationContext';
34
34
  export function validate(
35
35
  schema: GraphQLSchema,
36
36
  documentAST: DocumentNode,
37
- rules?: $ReadOnlyArray<ValidationRule> = specifiedRules,
38
- typeInfo?: TypeInfo = new TypeInfo(schema),
39
- options?: {| maxErrors?: number |} = { maxErrors: undefined },
37
+ rules: $ReadOnlyArray<ValidationRule> = specifiedRules,
38
+ typeInfo: TypeInfo = new TypeInfo(schema),
39
+ options: {| maxErrors?: number |} = { maxErrors: undefined },
40
40
  ): $ReadOnlyArray<GraphQLError> {
41
41
  devAssert(documentAST, 'Must provide document.');
42
42
  // If the schema used for validation is invalid, throw an error.
@@ -82,7 +82,7 @@ export function validate(
82
82
  export function validateSDL(
83
83
  documentAST: DocumentNode,
84
84
  schemaToExtend?: ?GraphQLSchema,
85
- rules?: $ReadOnlyArray<SDLValidationRule> = specifiedSDLRules,
85
+ rules: $ReadOnlyArray<SDLValidationRule> = specifiedSDLRules,
86
86
  ): $ReadOnlyArray<GraphQLError> {
87
87
  const errors = [];
88
88
  const context = new SDLValidationContext(
package/version.js CHANGED
@@ -13,7 +13,7 @@ exports.versionInfo = exports.version = void 0;
13
13
  /**
14
14
  * A string containing the version of the GraphQL.js library
15
15
  */
16
- var version = '15.4.0';
16
+ var version = '15.5.3';
17
17
  /**
18
18
  * An object containing the components of the GraphQL.js version string
19
19
  */
@@ -21,8 +21,8 @@ var version = '15.4.0';
21
21
  exports.version = version;
22
22
  var versionInfo = Object.freeze({
23
23
  major: 15,
24
- minor: 4,
25
- patch: 0,
24
+ minor: 5,
25
+ patch: 3,
26
26
  preReleaseTag: null
27
27
  });
28
28
  exports.versionInfo = versionInfo;
package/version.js.flow CHANGED
@@ -7,14 +7,14 @@
7
7
  /**
8
8
  * A string containing the version of the GraphQL.js library
9
9
  */
10
- export const version = '15.4.0';
10
+ export const version = '15.5.3';
11
11
 
12
12
  /**
13
13
  * An object containing the components of the GraphQL.js version string
14
14
  */
15
15
  export const versionInfo = Object.freeze({
16
16
  major: 15,
17
- minor: 4,
18
- patch: 0,
17
+ minor: 5,
18
+ patch: 3,
19
19
  preReleaseTag: null,
20
20
  });
package/version.mjs CHANGED
@@ -6,14 +6,14 @@
6
6
  /**
7
7
  * A string containing the version of the GraphQL.js library
8
8
  */
9
- export var version = '15.4.0';
9
+ export var version = '15.5.3';
10
10
  /**
11
11
  * An object containing the components of the GraphQL.js version string
12
12
  */
13
13
 
14
14
  export var versionInfo = Object.freeze({
15
15
  major: 15,
16
- minor: 4,
17
- patch: 0,
16
+ minor: 5,
17
+ patch: 3,
18
18
  preReleaseTag: null
19
19
  });
@@ -1,47 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = isCollection;
7
-
8
- var _symbols = require("../polyfills/symbols.js");
9
-
10
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
11
-
12
- /**
13
- * Returns true if the provided object is an Object (i.e. not a string literal)
14
- * and is either Iterable or Array-like.
15
- *
16
- * This may be used in place of [Array.isArray()][isArray] to determine if an
17
- * object should be iterated-over. It always excludes string literals and
18
- * includes Arrays (regardless of if it is Iterable). It also includes other
19
- * Array-like objects such as NodeList, TypedArray, and Buffer.
20
- *
21
- * @example
22
- *
23
- * isCollection([ 1, 2, 3 ]) // true
24
- * isCollection('ABC') // false
25
- * isCollection({ length: 1, 0: 'Alpha' }) // true
26
- * isCollection({ key: 'value' }) // false
27
- * isCollection(new Map()) // true
28
- *
29
- * @param obj
30
- * An Object value which might implement the Iterable or Array-like protocols.
31
- * @return {boolean} true if Iterable or Array-like Object.
32
- */
33
- function isCollection(obj) {
34
- if (obj == null || _typeof(obj) !== 'object') {
35
- return false;
36
- } // Is Array like?
37
-
38
-
39
- var length = obj.length;
40
-
41
- if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
42
- return true;
43
- } // Is Iterable?
44
-
45
-
46
- return typeof obj[_symbols.SYMBOL_ITERATOR] === 'function';
47
- }
@@ -1,38 +0,0 @@
1
- // @flow strict
2
- import { SYMBOL_ITERATOR } from '../polyfills/symbols';
3
-
4
- /**
5
- * Returns true if the provided object is an Object (i.e. not a string literal)
6
- * and is either Iterable or Array-like.
7
- *
8
- * This may be used in place of [Array.isArray()][isArray] to determine if an
9
- * object should be iterated-over. It always excludes string literals and
10
- * includes Arrays (regardless of if it is Iterable). It also includes other
11
- * Array-like objects such as NodeList, TypedArray, and Buffer.
12
- *
13
- * @example
14
- *
15
- * isCollection([ 1, 2, 3 ]) // true
16
- * isCollection('ABC') // false
17
- * isCollection({ length: 1, 0: 'Alpha' }) // true
18
- * isCollection({ key: 'value' }) // false
19
- * isCollection(new Map()) // true
20
- *
21
- * @param obj
22
- * An Object value which might implement the Iterable or Array-like protocols.
23
- * @return {boolean} true if Iterable or Array-like Object.
24
- */
25
- export default function isCollection(obj: mixed): boolean {
26
- if (obj == null || typeof obj !== 'object') {
27
- return false;
28
- }
29
-
30
- // Is Array like?
31
- const length = obj.length;
32
- if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
33
- return true;
34
- }
35
-
36
- // Is Iterable?
37
- return typeof obj[SYMBOL_ITERATOR] === 'function';
38
- }
@@ -1,40 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
3
- import { SYMBOL_ITERATOR } from "../polyfills/symbols.mjs";
4
- /**
5
- * Returns true if the provided object is an Object (i.e. not a string literal)
6
- * and is either Iterable or Array-like.
7
- *
8
- * This may be used in place of [Array.isArray()][isArray] to determine if an
9
- * object should be iterated-over. It always excludes string literals and
10
- * includes Arrays (regardless of if it is Iterable). It also includes other
11
- * Array-like objects such as NodeList, TypedArray, and Buffer.
12
- *
13
- * @example
14
- *
15
- * isCollection([ 1, 2, 3 ]) // true
16
- * isCollection('ABC') // false
17
- * isCollection({ length: 1, 0: 'Alpha' }) // true
18
- * isCollection({ key: 'value' }) // false
19
- * isCollection(new Map()) // true
20
- *
21
- * @param obj
22
- * An Object value which might implement the Iterable or Array-like protocols.
23
- * @return {boolean} true if Iterable or Array-like Object.
24
- */
25
-
26
- export default function isCollection(obj) {
27
- if (obj == null || _typeof(obj) !== 'object') {
28
- return false;
29
- } // Is Array like?
30
-
31
-
32
- var length = obj.length;
33
-
34
- if (typeof length === 'number' && length >= 0 && length % 1 === 0) {
35
- return true;
36
- } // Is Iterable?
37
-
38
-
39
- return typeof obj[SYMBOL_ITERATOR] === 'function';
40
- }