graphql 16.11.0 → 16.13.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 (48) hide show
  1. package/README.md +49 -6
  2. package/execution/execute.d.ts +14 -1
  3. package/execution/execute.js +72 -13
  4. package/execution/execute.mjs +72 -13
  5. package/execution/subscribe.js +1 -0
  6. package/execution/subscribe.mjs +2 -0
  7. package/index.d.ts +11 -0
  8. package/index.js +24 -0
  9. package/index.mjs +6 -2
  10. package/language/ast.d.ts +45 -1
  11. package/language/ast.js +14 -1
  12. package/language/ast.mjs +14 -1
  13. package/language/index.d.ts +14 -1
  14. package/language/index.js +12 -0
  15. package/language/index.mjs +8 -1
  16. package/language/kinds.d.ts +6 -0
  17. package/language/kinds.js +5 -0
  18. package/language/kinds.mjs +5 -0
  19. package/language/lexer.d.ts +52 -1
  20. package/language/lexer.js +10 -0
  21. package/language/lexer.mjs +17 -4
  22. package/language/parser.d.ts +30 -3
  23. package/language/parser.js +129 -13
  24. package/language/parser.mjs +123 -11
  25. package/language/predicates.d.ts +4 -0
  26. package/language/predicates.js +11 -0
  27. package/language/predicates.mjs +9 -0
  28. package/language/printer.js +42 -13
  29. package/language/printer.mjs +42 -13
  30. package/language/schemaCoordinateLexer.d.ts +43 -0
  31. package/language/schemaCoordinateLexer.js +171 -0
  32. package/language/schemaCoordinateLexer.mjs +122 -0
  33. package/language/tokenKind.d.ts +1 -0
  34. package/language/tokenKind.js +1 -0
  35. package/language/tokenKind.mjs +1 -0
  36. package/package.json +1 -1
  37. package/utilities/index.d.ts +5 -0
  38. package/utilities/index.js +14 -0
  39. package/utilities/index.mjs +5 -0
  40. package/utilities/resolveSchemaCoordinate.d.ts +80 -0
  41. package/utilities/resolveSchemaCoordinate.js +260 -0
  42. package/utilities/resolveSchemaCoordinate.mjs +243 -0
  43. package/validation/rules/ValuesOfCorrectTypeRule.js +7 -36
  44. package/validation/rules/ValuesOfCorrectTypeRule.mjs +7 -35
  45. package/validation/validate.js +12 -0
  46. package/validation/validate.mjs +13 -2
  47. package/version.js +2 -2
  48. package/version.mjs +2 -2
@@ -1,5 +1,7 @@
1
1
  import { devAssert } from '../jsutils/devAssert.mjs';
2
+ import { mapValue } from '../jsutils/mapValue.mjs';
2
3
  import { GraphQLError } from '../error/GraphQLError.mjs';
4
+ import { QueryDocumentKeys } from '../language/ast.mjs';
3
5
  import { visit, visitInParallel } from '../language/visitor.mjs';
4
6
  import { assertValidSchema } from '../type/validate.mjs';
5
7
  import { TypeInfo, visitWithTypeInfo } from '../utilities/TypeInfo.mjs';
@@ -7,7 +9,12 @@ import { specifiedRules, specifiedSDLRules } from './specifiedRules.mjs';
7
9
  import {
8
10
  SDLValidationContext,
9
11
  ValidationContext,
10
- } from './ValidationContext.mjs';
12
+ } from './ValidationContext.mjs'; // Per the specification, descriptions must not affect validation.
13
+ // See https://spec.graphql.org/draft/#sec-Descriptions
14
+
15
+ const QueryDocumentKeysToValidate = mapValue(QueryDocumentKeys, (keys) =>
16
+ keys.filter((key) => key !== 'description'),
17
+ );
11
18
  /**
12
19
  * Implements the "Validation" section of the spec.
13
20
  *
@@ -73,7 +80,11 @@ export function validate(
73
80
  const visitor = visitInParallel(rules.map((rule) => rule(context))); // Visit the whole document with each instance of all provided rules.
74
81
 
75
82
  try {
76
- visit(documentAST, visitWithTypeInfo(typeInfo, visitor));
83
+ visit(
84
+ documentAST,
85
+ visitWithTypeInfo(typeInfo, visitor),
86
+ QueryDocumentKeysToValidate,
87
+ );
77
88
  } catch (e) {
78
89
  if (e !== abortObj) {
79
90
  throw e;
package/version.js CHANGED
@@ -10,7 +10,7 @@ exports.versionInfo = exports.version = void 0;
10
10
  /**
11
11
  * A string containing the version of the GraphQL.js library
12
12
  */
13
- const version = '16.11.0';
13
+ const version = '16.13.0';
14
14
  /**
15
15
  * An object containing the components of the GraphQL.js version string
16
16
  */
@@ -18,7 +18,7 @@ const version = '16.11.0';
18
18
  exports.version = version;
19
19
  const versionInfo = Object.freeze({
20
20
  major: 16,
21
- minor: 11,
21
+ minor: 13,
22
22
  patch: 0,
23
23
  preReleaseTag: null,
24
24
  });
package/version.mjs CHANGED
@@ -4,14 +4,14 @@
4
4
  /**
5
5
  * A string containing the version of the GraphQL.js library
6
6
  */
7
- export const version = '16.11.0';
7
+ export const version = '16.13.0';
8
8
  /**
9
9
  * An object containing the components of the GraphQL.js version string
10
10
  */
11
11
 
12
12
  export const versionInfo = Object.freeze({
13
13
  major: 16,
14
- minor: 11,
14
+ minor: 13,
15
15
  patch: 0,
16
16
  preReleaseTag: null,
17
17
  });