graphql 14.4.2 → 14.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 (343) hide show
  1. package/README.md +5 -10
  2. package/error/GraphQLError.d.ts +87 -0
  3. package/error/GraphQLError.js +7 -45
  4. package/error/GraphQLError.js.flow +1 -0
  5. package/error/GraphQLError.mjs +7 -45
  6. package/error/formatError.d.ts +39 -0
  7. package/error/formatError.js +5 -2
  8. package/error/formatError.js.flow +27 -3
  9. package/error/formatError.mjs +5 -2
  10. package/error/index.d.ts +4 -0
  11. package/error/locatedError.d.ts +13 -0
  12. package/error/locatedError.js.flow +2 -1
  13. package/error/locatedError.mjs +1 -1
  14. package/error/syntaxError.d.ts +12 -0
  15. package/error/syntaxError.js.flow +1 -0
  16. package/execution/execute.d.ts +190 -0
  17. package/execution/execute.js +55 -89
  18. package/execution/execute.js.flow +95 -133
  19. package/execution/execute.mjs +75 -80
  20. package/execution/index.d.ts +11 -0
  21. package/execution/index.js +8 -6
  22. package/execution/index.js.flow +3 -6
  23. package/execution/index.mjs +2 -1
  24. package/execution/values.d.ts +68 -0
  25. package/execution/values.js +119 -128
  26. package/execution/values.js.flow +150 -127
  27. package/execution/values.mjs +117 -125
  28. package/graphql.d.ts +88 -0
  29. package/graphql.js +5 -5
  30. package/graphql.js.flow +9 -5
  31. package/graphql.mjs +41 -1
  32. package/index.d.ts +446 -0
  33. package/index.js +6 -0
  34. package/index.js.flow +3 -1
  35. package/index.mjs +2 -1
  36. package/jsutils/ObjMap.js.flow +6 -0
  37. package/jsutils/Path.d.ts +14 -0
  38. package/jsutils/Path.js +33 -0
  39. package/jsutils/Path.js.flow +26 -0
  40. package/jsutils/Path.mjs +24 -0
  41. package/jsutils/PromiseOrValue.d.ts +1 -0
  42. package/jsutils/dedent.js +6 -24
  43. package/jsutils/dedent.mjs +6 -24
  44. package/jsutils/defineToStringTag.js.flow +1 -1
  45. package/jsutils/devAssert.js +14 -0
  46. package/jsutils/devAssert.js.flow +8 -0
  47. package/jsutils/devAssert.mjs +7 -0
  48. package/jsutils/inspect.js +1 -1
  49. package/jsutils/inspect.js.flow +1 -1
  50. package/jsutils/inspect.mjs +1 -1
  51. package/jsutils/invariant.js +1 -2
  52. package/jsutils/invariant.js.flow +2 -3
  53. package/jsutils/invariant.mjs +1 -2
  54. package/jsutils/mapValue.js +6 -24
  55. package/jsutils/mapValue.js.flow +2 -1
  56. package/jsutils/mapValue.mjs +6 -24
  57. package/jsutils/printPathArray.js +15 -0
  58. package/jsutils/printPathArray.js.flow +14 -0
  59. package/jsutils/printPathArray.mjs +8 -0
  60. package/jsutils/suggestionList.js +14 -34
  61. package/jsutils/suggestionList.js.flow +4 -6
  62. package/jsutils/suggestionList.mjs +14 -34
  63. package/jsutils/toObjMap.js +28 -0
  64. package/jsutils/toObjMap.js.flow +26 -0
  65. package/jsutils/toObjMap.mjs +18 -0
  66. package/language/ast.d.ts +573 -0
  67. package/language/blockString.d.ts +21 -0
  68. package/language/directiveLocation.d.ts +35 -0
  69. package/language/index.d.ts +96 -0
  70. package/language/kinds.d.ts +77 -0
  71. package/language/lexer.d.ts +60 -0
  72. package/language/lexer.js +2 -12
  73. package/language/lexer.js.flow +6 -12
  74. package/language/lexer.mjs +1 -9
  75. package/language/location.d.ts +15 -0
  76. package/language/parser.d.ts +89 -0
  77. package/language/parser.js +1329 -1302
  78. package/language/parser.js.flow +1289 -1298
  79. package/language/parser.mjs +1326 -1297
  80. package/language/predicates.d.ts +36 -0
  81. package/language/predicates.js.flow +1 -1
  82. package/language/printLocation.d.ts +16 -0
  83. package/language/printLocation.js.flow +1 -1
  84. package/language/printer.d.ts +7 -0
  85. package/language/printer.js.flow +1 -1
  86. package/language/source.d.ts +19 -0
  87. package/language/source.js +3 -3
  88. package/language/source.js.flow +3 -3
  89. package/language/source.mjs +3 -3
  90. package/language/tokenKind.d.ts +35 -0
  91. package/language/visitor.d.ts +264 -0
  92. package/language/visitor.js +2 -2
  93. package/language/visitor.js.flow +3 -1
  94. package/language/visitor.mjs +2 -2
  95. package/package.json +1 -1
  96. package/polyfills/find.js +2 -2
  97. package/polyfills/find.js.flow +1 -2
  98. package/polyfills/find.mjs +2 -2
  99. package/polyfills/flatMap.js +3 -3
  100. package/polyfills/flatMap.js.flow +2 -3
  101. package/polyfills/flatMap.mjs +3 -3
  102. package/subscription/asyncIteratorReject.d.ts +6 -0
  103. package/subscription/index.d.ts +5 -0
  104. package/subscription/mapAsyncIterator.d.ts +9 -0
  105. package/subscription/mapAsyncIterator.js.flow +1 -0
  106. package/subscription/subscribe.d.ts +86 -0
  107. package/subscription/subscribe.js +29 -10
  108. package/subscription/subscribe.js.flow +45 -24
  109. package/subscription/subscribe.mjs +27 -9
  110. package/tsutils/Maybe.d.ts +4 -0
  111. package/type/definition.d.ts +805 -0
  112. package/type/definition.js +154 -70
  113. package/type/definition.js.flow +217 -160
  114. package/type/definition.mjs +149 -66
  115. package/type/directives.d.ts +72 -0
  116. package/type/directives.js +20 -12
  117. package/type/directives.js.flow +34 -19
  118. package/type/directives.mjs +17 -10
  119. package/type/index.d.ts +155 -0
  120. package/type/index.js.flow +2 -2
  121. package/type/introspection.d.ts +40 -0
  122. package/type/introspection.js +24 -10
  123. package/type/introspection.js.flow +29 -8
  124. package/type/introspection.mjs +23 -10
  125. package/type/scalars.d.ts +11 -0
  126. package/type/scalars.js +2 -2
  127. package/type/scalars.js.flow +4 -1
  128. package/type/scalars.mjs +2 -2
  129. package/type/schema.d.ts +108 -0
  130. package/type/schema.js +74 -151
  131. package/type/schema.js.flow +75 -73
  132. package/type/schema.mjs +75 -149
  133. package/type/validate.d.ts +19 -0
  134. package/type/validate.js +227 -486
  135. package/type/validate.js.flow +13 -8
  136. package/type/validate.mjs +218 -477
  137. package/utilities/TypeInfo.d.ts +49 -0
  138. package/utilities/TypeInfo.js.flow +9 -6
  139. package/utilities/assertValidName.d.ts +15 -0
  140. package/utilities/assertValidName.js +3 -3
  141. package/utilities/assertValidName.js.flow +3 -2
  142. package/utilities/assertValidName.mjs +2 -2
  143. package/utilities/astFromValue.d.ts +25 -0
  144. package/utilities/astFromValue.js +22 -38
  145. package/utilities/astFromValue.js.flow +7 -4
  146. package/utilities/astFromValue.mjs +19 -36
  147. package/utilities/buildASTSchema.d.ts +114 -0
  148. package/utilities/buildASTSchema.js +37 -68
  149. package/utilities/buildASTSchema.js.flow +32 -30
  150. package/utilities/buildASTSchema.mjs +32 -64
  151. package/utilities/buildClientSchema.d.ts +21 -0
  152. package/utilities/buildClientSchema.js +23 -15
  153. package/utilities/buildClientSchema.js.flow +17 -16
  154. package/utilities/buildClientSchema.mjs +20 -12
  155. package/utilities/coerceInputValue.d.ts +17 -0
  156. package/utilities/coerceInputValue.js +161 -0
  157. package/utilities/coerceInputValue.js.flow +214 -0
  158. package/utilities/coerceInputValue.mjs +142 -0
  159. package/utilities/coerceValue.d.ts +23 -0
  160. package/utilities/coerceValue.js +21 -199
  161. package/utilities/coerceValue.js.flow +31 -223
  162. package/utilities/coerceValue.mjs +20 -195
  163. package/utilities/concatAST.d.ts +8 -0
  164. package/utilities/concatAST.js.flow +1 -0
  165. package/utilities/extendSchema.d.ts +45 -0
  166. package/utilities/extendSchema.js +64 -131
  167. package/utilities/extendSchema.js.flow +27 -24
  168. package/utilities/extendSchema.mjs +61 -129
  169. package/utilities/findBreakingChanges.d.ts +64 -0
  170. package/utilities/findBreakingChanges.js +194 -619
  171. package/utilities/findBreakingChanges.js.flow +8 -5
  172. package/utilities/findBreakingChanges.mjs +194 -619
  173. package/utilities/findDeprecatedUsages.d.ts +13 -0
  174. package/utilities/findDeprecatedUsages.js.flow +4 -1
  175. package/utilities/getOperationAST.d.ts +12 -0
  176. package/utilities/getOperationAST.js +13 -31
  177. package/utilities/getOperationAST.mjs +13 -31
  178. package/utilities/getOperationRootType.d.ts +14 -0
  179. package/utilities/getOperationRootType.js.flow +2 -0
  180. package/utilities/index.d.ts +127 -0
  181. package/utilities/index.js +8 -0
  182. package/utilities/index.js.flow +4 -1
  183. package/utilities/index.mjs +3 -1
  184. package/utilities/introspectionFromSchema.d.ts +16 -0
  185. package/utilities/introspectionFromSchema.js +5 -3
  186. package/utilities/introspectionFromSchema.js.flow +4 -2
  187. package/utilities/introspectionFromSchema.mjs +4 -2
  188. package/utilities/introspectionQuery.d.ts +177 -0
  189. package/utilities/isValidJSValue.d.ts +8 -0
  190. package/utilities/isValidJSValue.js +1 -1
  191. package/utilities/isValidJSValue.js.flow +3 -2
  192. package/utilities/isValidJSValue.mjs +2 -2
  193. package/utilities/isValidLiteralValue.d.ts +15 -0
  194. package/utilities/isValidLiteralValue.js +4 -4
  195. package/utilities/isValidLiteralValue.js.flow +8 -4
  196. package/utilities/isValidLiteralValue.mjs +2 -2
  197. package/utilities/lexicographicSortSchema.d.ts +6 -0
  198. package/utilities/lexicographicSortSchema.js +11 -8
  199. package/utilities/lexicographicSortSchema.js.flow +5 -3
  200. package/utilities/lexicographicSortSchema.mjs +9 -7
  201. package/utilities/schemaPrinter.d.ts +30 -0
  202. package/utilities/schemaPrinter.js +15 -32
  203. package/utilities/schemaPrinter.js.flow +14 -10
  204. package/utilities/schemaPrinter.mjs +14 -32
  205. package/utilities/separateOperations.d.ts +11 -0
  206. package/utilities/separateOperations.js +6 -6
  207. package/utilities/separateOperations.js.flow +2 -1
  208. package/utilities/separateOperations.mjs +6 -6
  209. package/utilities/stripIgnoredCharacters.d.ts +55 -0
  210. package/utilities/stripIgnoredCharacters.js.flow +1 -0
  211. package/utilities/typeComparators.d.ts +32 -0
  212. package/utilities/typeComparators.js.flow +1 -1
  213. package/utilities/typeComparators.mjs +1 -1
  214. package/utilities/typeFromAST.d.ts +29 -0
  215. package/utilities/typeFromAST.js +5 -3
  216. package/utilities/typeFromAST.js.flow +5 -3
  217. package/utilities/typeFromAST.mjs +14 -3
  218. package/utilities/valueFromAST.d.ts +29 -0
  219. package/utilities/valueFromAST.js +40 -74
  220. package/utilities/valueFromAST.js.flow +7 -4
  221. package/utilities/valueFromAST.mjs +39 -74
  222. package/utilities/valueFromASTUntyped.d.ts +23 -0
  223. package/utilities/valueFromASTUntyped.js +4 -3
  224. package/utilities/valueFromASTUntyped.js.flow +3 -2
  225. package/utilities/valueFromASTUntyped.mjs +3 -3
  226. package/validation/ValidationContext.d.ts +96 -0
  227. package/validation/ValidationContext.js +38 -86
  228. package/validation/ValidationContext.js.flow +22 -7
  229. package/validation/ValidationContext.mjs +37 -85
  230. package/validation/index.d.ts +126 -0
  231. package/validation/rules/ExecutableDefinitions.d.ts +14 -0
  232. package/validation/rules/ExecutableDefinitions.js +4 -23
  233. package/validation/rules/ExecutableDefinitions.js.flow +4 -2
  234. package/validation/rules/ExecutableDefinitions.mjs +4 -23
  235. package/validation/rules/FieldsOnCorrectType.d.ts +17 -0
  236. package/validation/rules/FieldsOnCorrectType.js +21 -57
  237. package/validation/rules/FieldsOnCorrectType.js.flow +7 -3
  238. package/validation/rules/FieldsOnCorrectType.mjs +21 -57
  239. package/validation/rules/FragmentsOnCompositeTypes.d.ts +20 -0
  240. package/validation/rules/FragmentsOnCompositeTypes.js.flow +5 -1
  241. package/validation/rules/KnownArgumentNames.d.ts +28 -0
  242. package/validation/rules/KnownArgumentNames.js +26 -79
  243. package/validation/rules/KnownArgumentNames.js.flow +10 -6
  244. package/validation/rules/KnownArgumentNames.mjs +22 -75
  245. package/validation/rules/KnownDirectives.d.ts +19 -0
  246. package/validation/rules/KnownDirectives.js +12 -48
  247. package/validation/rules/KnownDirectives.js.flow +8 -5
  248. package/validation/rules/KnownDirectives.mjs +12 -48
  249. package/validation/rules/KnownFragmentNames.d.ts +12 -0
  250. package/validation/rules/KnownFragmentNames.js.flow +2 -1
  251. package/validation/rules/KnownTypeNames.d.ts +15 -0
  252. package/validation/rules/KnownTypeNames.js +6 -24
  253. package/validation/rules/KnownTypeNames.js.flow +10 -6
  254. package/validation/rules/KnownTypeNames.mjs +6 -24
  255. package/validation/rules/LoneAnonymousOperation.d.ts +14 -0
  256. package/validation/rules/LoneAnonymousOperation.js.flow +3 -1
  257. package/validation/rules/LoneSchemaDefinition.d.ts +13 -0
  258. package/validation/rules/LoneSchemaDefinition.js.flow +2 -1
  259. package/validation/rules/NoFragmentCycles.d.ts +9 -0
  260. package/validation/rules/NoFragmentCycles.js +17 -35
  261. package/validation/rules/NoFragmentCycles.js.flow +4 -2
  262. package/validation/rules/NoFragmentCycles.mjs +17 -35
  263. package/validation/rules/NoUndefinedVariables.d.ts +16 -0
  264. package/validation/rules/NoUndefinedVariables.js +6 -24
  265. package/validation/rules/NoUndefinedVariables.js.flow +2 -1
  266. package/validation/rules/NoUndefinedVariables.mjs +6 -24
  267. package/validation/rules/NoUnusedFragments.d.ts +12 -0
  268. package/validation/rules/NoUnusedFragments.js +7 -25
  269. package/validation/rules/NoUnusedFragments.js.flow +2 -1
  270. package/validation/rules/NoUnusedFragments.mjs +7 -25
  271. package/validation/rules/NoUnusedVariables.d.ts +16 -0
  272. package/validation/rules/NoUnusedVariables.js +6 -24
  273. package/validation/rules/NoUnusedVariables.js.flow +2 -1
  274. package/validation/rules/NoUnusedVariables.mjs +6 -24
  275. package/validation/rules/OverlappingFieldsCanBeMerged.d.ts +24 -0
  276. package/validation/rules/OverlappingFieldsCanBeMerged.js +27 -46
  277. package/validation/rules/OverlappingFieldsCanBeMerged.js.flow +17 -8
  278. package/validation/rules/OverlappingFieldsCanBeMerged.mjs +25 -44
  279. package/validation/rules/PossibleFragmentSpreads.d.ts +22 -0
  280. package/validation/rules/PossibleFragmentSpreads.js +2 -2
  281. package/validation/rules/PossibleFragmentSpreads.js.flow +8 -3
  282. package/validation/rules/PossibleFragmentSpreads.mjs +2 -2
  283. package/validation/rules/PossibleTypeExtensions.d.ts +21 -0
  284. package/validation/rules/PossibleTypeExtensions.js +4 -22
  285. package/validation/rules/PossibleTypeExtensions.js.flow +6 -2
  286. package/validation/rules/PossibleTypeExtensions.mjs +4 -22
  287. package/validation/rules/ProvidedRequiredArguments.d.ts +29 -0
  288. package/validation/rules/ProvidedRequiredArguments.js +27 -79
  289. package/validation/rules/ProvidedRequiredArguments.js.flow +12 -8
  290. package/validation/rules/ProvidedRequiredArguments.mjs +25 -77
  291. package/validation/rules/ScalarLeafs.d.ts +20 -0
  292. package/validation/rules/ScalarLeafs.js.flow +6 -2
  293. package/validation/rules/SingleFieldSubscriptions.d.ts +14 -0
  294. package/validation/rules/SingleFieldSubscriptions.js.flow +4 -2
  295. package/validation/rules/UniqueArgumentNames.d.ts +12 -0
  296. package/validation/rules/UniqueArgumentNames.js.flow +2 -1
  297. package/validation/rules/UniqueDirectiveNames.d.ts +13 -0
  298. package/validation/rules/UniqueDirectiveNames.js.flow +2 -1
  299. package/validation/rules/UniqueDirectivesPerLocation.d.ts +14 -0
  300. package/validation/rules/UniqueDirectivesPerLocation.js +15 -69
  301. package/validation/rules/UniqueDirectivesPerLocation.js.flow +7 -4
  302. package/validation/rules/UniqueDirectivesPerLocation.mjs +15 -69
  303. package/validation/rules/UniqueEnumValueNames.d.ts +19 -0
  304. package/validation/rules/UniqueEnumValueNames.js +10 -28
  305. package/validation/rules/UniqueEnumValueNames.js.flow +2 -1
  306. package/validation/rules/UniqueEnumValueNames.mjs +10 -28
  307. package/validation/rules/UniqueFieldDefinitionNames.d.ts +21 -0
  308. package/validation/rules/UniqueFieldDefinitionNames.js +9 -27
  309. package/validation/rules/UniqueFieldDefinitionNames.js.flow +2 -1
  310. package/validation/rules/UniqueFieldDefinitionNames.mjs +9 -27
  311. package/validation/rules/UniqueFragmentNames.d.ts +11 -0
  312. package/validation/rules/UniqueFragmentNames.js.flow +2 -1
  313. package/validation/rules/UniqueInputFieldNames.d.ts +14 -0
  314. package/validation/rules/UniqueInputFieldNames.js.flow +2 -1
  315. package/validation/rules/UniqueOperationNames.d.ts +11 -0
  316. package/validation/rules/UniqueOperationNames.js.flow +2 -1
  317. package/validation/rules/UniqueOperationTypes.d.ts +13 -0
  318. package/validation/rules/UniqueOperationTypes.js +11 -30
  319. package/validation/rules/UniqueOperationTypes.js.flow +2 -1
  320. package/validation/rules/UniqueOperationTypes.mjs +10 -29
  321. package/validation/rules/UniqueTypeNames.d.ts +13 -0
  322. package/validation/rules/UniqueTypeNames.js.flow +3 -1
  323. package/validation/rules/UniqueVariableNames.d.ts +11 -0
  324. package/validation/rules/UniqueVariableNames.js.flow +4 -2
  325. package/validation/rules/ValuesOfCorrectType.d.ts +34 -0
  326. package/validation/rules/ValuesOfCorrectType.js +16 -34
  327. package/validation/rules/ValuesOfCorrectType.js.flow +11 -6
  328. package/validation/rules/ValuesOfCorrectType.mjs +12 -30
  329. package/validation/rules/VariablesAreInputTypes.d.ts +15 -0
  330. package/validation/rules/VariablesAreInputTypes.js.flow +6 -2
  331. package/validation/rules/VariablesInAllowedPosition.d.ts +15 -0
  332. package/validation/rules/VariablesInAllowedPosition.js +22 -40
  333. package/validation/rules/VariablesInAllowedPosition.js.flow +8 -3
  334. package/validation/rules/VariablesInAllowedPosition.mjs +18 -36
  335. package/validation/specifiedRules.d.ts +98 -0
  336. package/validation/validate.d.ts +56 -0
  337. package/validation/validate.js +35 -7
  338. package/validation/validate.js.flow +51 -9
  339. package/validation/validate.mjs +30 -7
  340. package/version.d.ts +14 -0
  341. package/version.js +3 -3
  342. package/version.js.flow +3 -3
  343. package/version.mjs +3 -3
@@ -0,0 +1,96 @@
1
+ import Maybe from '../tsutils/Maybe';
2
+ import { GraphQLError } from '../error';
3
+ import { ASTVisitor } from '../language/visitor';
4
+ import {
5
+ DocumentNode,
6
+ OperationDefinitionNode,
7
+ VariableNode,
8
+ SelectionSetNode,
9
+ FragmentSpreadNode,
10
+ FragmentDefinitionNode,
11
+ } from '../language/ast';
12
+ import { GraphQLSchema } from '../type/schema';
13
+ import { GraphQLDirective } from '../type/directives';
14
+ import {
15
+ GraphQLInputType,
16
+ GraphQLOutputType,
17
+ GraphQLCompositeType,
18
+ GraphQLField,
19
+ GraphQLArgument,
20
+ } from '../type/definition';
21
+ import { TypeInfo } from '../utilities/TypeInfo';
22
+
23
+ type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;
24
+ type VariableUsage = {
25
+ readonly node: VariableNode;
26
+ readonly type: Maybe<GraphQLInputType>;
27
+ readonly defaultValue: Maybe<any>;
28
+ };
29
+
30
+ /**
31
+ * An instance of this class is passed as the "this" context to all validators,
32
+ * allowing access to commonly useful contextual information from within a
33
+ * validation rule.
34
+ */
35
+ export class ASTValidationContext {
36
+ constructor(ast: DocumentNode);
37
+
38
+ reportError(error: GraphQLError): undefined;
39
+
40
+ getErrors(): ReadonlyArray<GraphQLError>;
41
+
42
+ getDocument(): DocumentNode;
43
+
44
+ getFragment(name: string): Maybe<FragmentDefinitionNode>;
45
+
46
+ getFragmentSpreads(node: SelectionSetNode): ReadonlyArray<FragmentSpreadNode>;
47
+
48
+ getRecursivelyReferencedFragments(
49
+ operation: OperationDefinitionNode,
50
+ ): ReadonlyArray<FragmentDefinitionNode>;
51
+ }
52
+
53
+ export class SDLValidationContext extends ASTValidationContext {
54
+ constructor(
55
+ ast: DocumentNode,
56
+ schema: Maybe<GraphQLSchema>,
57
+ onError?: (err: GraphQLError) => void,
58
+ );
59
+
60
+ getSchema(): Maybe<GraphQLSchema>;
61
+ }
62
+
63
+ export type SDLValidationRule = (context: SDLValidationContext) => ASTVisitor;
64
+
65
+ export class ValidationContext extends ASTValidationContext {
66
+ constructor(
67
+ schema: GraphQLSchema,
68
+ ast: DocumentNode,
69
+ typeInfo: TypeInfo,
70
+ onError?: (err: GraphQLError) => void,
71
+ );
72
+
73
+ getSchema(): GraphQLSchema;
74
+
75
+ getVariableUsages(node: NodeWithSelectionSet): ReadonlyArray<VariableUsage>;
76
+
77
+ getRecursivelyReferencedFragments(
78
+ operation: OperationDefinitionNode,
79
+ ): ReadonlyArray<FragmentDefinitionNode>;
80
+
81
+ getType(): Maybe<GraphQLOutputType>;
82
+
83
+ getParentType(): Maybe<GraphQLCompositeType>;
84
+
85
+ getInputType(): Maybe<GraphQLInputType>;
86
+
87
+ getParentInputType(): Maybe<GraphQLInputType>;
88
+
89
+ getFieldDef(): Maybe<GraphQLField<any, any>>;
90
+
91
+ getDirective(): Maybe<GraphQLDirective>;
92
+
93
+ getArgument(): Maybe<GraphQLArgument>;
94
+ }
95
+
96
+ export type ValidationRule = (context: ValidationContext) => ASTVisitor;
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ValidationContext = exports.SDLValidationContext = exports.ASTValidationContext = void 0;
7
7
 
8
- var _visitor = require("../language/visitor");
9
-
10
8
  var _kinds = require("../language/kinds");
11
9
 
10
+ var _visitor = require("../language/visitor");
11
+
12
12
  var _TypeInfo = require("../utilities/TypeInfo");
13
13
 
14
14
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
@@ -21,19 +21,25 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.crea
21
21
  var ASTValidationContext =
22
22
  /*#__PURE__*/
23
23
  function () {
24
- function ASTValidationContext(ast) {
24
+ function ASTValidationContext(ast, onError) {
25
25
  this._ast = ast;
26
26
  this._errors = [];
27
27
  this._fragments = undefined;
28
28
  this._fragmentSpreads = new Map();
29
29
  this._recursivelyReferencedFragments = new Map();
30
+ this._onError = onError;
30
31
  }
31
32
 
32
33
  var _proto = ASTValidationContext.prototype;
33
34
 
34
35
  _proto.reportError = function reportError(error) {
35
36
  this._errors.push(error);
36
- };
37
+
38
+ if (this._onError) {
39
+ this._onError(error);
40
+ }
41
+ } // @deprecated: use onError callback instead - will be removed in v15.
42
+ ;
37
43
 
38
44
  _proto.getErrors = function getErrors() {
39
45
  return this._errors;
@@ -68,32 +74,14 @@ function () {
68
74
 
69
75
  while (setsToVisit.length !== 0) {
70
76
  var set = setsToVisit.pop();
71
- var _iteratorNormalCompletion = true;
72
- var _didIteratorError = false;
73
- var _iteratorError = undefined;
74
-
75
- try {
76
- for (var _iterator = set.selections[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
77
- var selection = _step.value;
78
-
79
- if (selection.kind === _kinds.Kind.FRAGMENT_SPREAD) {
80
- spreads.push(selection);
81
- } else if (selection.selectionSet) {
82
- setsToVisit.push(selection.selectionSet);
83
- }
84
- }
85
- } catch (err) {
86
- _didIteratorError = true;
87
- _iteratorError = err;
88
- } finally {
89
- try {
90
- if (!_iteratorNormalCompletion && _iterator.return != null) {
91
- _iterator.return();
92
- }
93
- } finally {
94
- if (_didIteratorError) {
95
- throw _iteratorError;
96
- }
77
+
78
+ for (var _i2 = 0, _set$selections2 = set.selections; _i2 < _set$selections2.length; _i2++) {
79
+ var selection = _set$selections2[_i2];
80
+
81
+ if (selection.kind === _kinds.Kind.FRAGMENT_SPREAD) {
82
+ spreads.push(selection);
83
+ } else if (selection.selectionSet) {
84
+ setsToVisit.push(selection.selectionSet);
97
85
  }
98
86
  }
99
87
  }
@@ -114,36 +102,18 @@ function () {
114
102
 
115
103
  while (nodesToVisit.length !== 0) {
116
104
  var node = nodesToVisit.pop();
117
- var _iteratorNormalCompletion2 = true;
118
- var _didIteratorError2 = false;
119
- var _iteratorError2 = undefined;
120
-
121
- try {
122
- for (var _iterator2 = this.getFragmentSpreads(node)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
123
- var spread = _step2.value;
124
- var fragName = spread.name.value;
125
-
126
- if (collectedNames[fragName] !== true) {
127
- collectedNames[fragName] = true;
128
- var fragment = this.getFragment(fragName);
129
-
130
- if (fragment) {
131
- fragments.push(fragment);
132
- nodesToVisit.push(fragment.selectionSet);
133
- }
134
- }
135
- }
136
- } catch (err) {
137
- _didIteratorError2 = true;
138
- _iteratorError2 = err;
139
- } finally {
140
- try {
141
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
142
- _iterator2.return();
143
- }
144
- } finally {
145
- if (_didIteratorError2) {
146
- throw _iteratorError2;
105
+
106
+ for (var _i4 = 0, _this$getFragmentSpre2 = this.getFragmentSpreads(node); _i4 < _this$getFragmentSpre2.length; _i4++) {
107
+ var spread = _this$getFragmentSpre2[_i4];
108
+ var fragName = spread.name.value;
109
+
110
+ if (collectedNames[fragName] !== true) {
111
+ collectedNames[fragName] = true;
112
+ var fragment = this.getFragment(fragName);
113
+
114
+ if (fragment) {
115
+ fragments.push(fragment);
116
+ nodesToVisit.push(fragment.selectionSet);
147
117
  }
148
118
  }
149
119
  }
@@ -165,10 +135,10 @@ var SDLValidationContext =
165
135
  function (_ASTValidationContext) {
166
136
  _inheritsLoose(SDLValidationContext, _ASTValidationContext);
167
137
 
168
- function SDLValidationContext(ast, schema) {
138
+ function SDLValidationContext(ast, schema, onError) {
169
139
  var _this;
170
140
 
171
- _this = _ASTValidationContext.call(this, ast) || this;
141
+ _this = _ASTValidationContext.call(this, ast, onError) || this;
172
142
  _this._schema = schema;
173
143
  return _this;
174
144
  }
@@ -189,10 +159,10 @@ var ValidationContext =
189
159
  function (_ASTValidationContext2) {
190
160
  _inheritsLoose(ValidationContext, _ASTValidationContext2);
191
161
 
192
- function ValidationContext(schema, ast, typeInfo) {
162
+ function ValidationContext(schema, ast, typeInfo, onError) {
193
163
  var _this2;
194
164
 
195
- _this2 = _ASTValidationContext2.call(this, ast) || this;
165
+ _this2 = _ASTValidationContext2.call(this, ast, onError) || this;
196
166
  _this2._schema = schema;
197
167
  _this2._typeInfo = typeInfo;
198
168
  _this2._variableUsages = new Map();
@@ -237,28 +207,10 @@ function (_ASTValidationContext2) {
237
207
 
238
208
  if (!usages) {
239
209
  usages = this.getVariableUsages(operation);
240
- var _iteratorNormalCompletion3 = true;
241
- var _didIteratorError3 = false;
242
- var _iteratorError3 = undefined;
243
-
244
- try {
245
- for (var _iterator3 = this.getRecursivelyReferencedFragments(operation)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
246
- var frag = _step3.value;
247
- usages = usages.concat(this.getVariableUsages(frag));
248
- }
249
- } catch (err) {
250
- _didIteratorError3 = true;
251
- _iteratorError3 = err;
252
- } finally {
253
- try {
254
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
255
- _iterator3.return();
256
- }
257
- } finally {
258
- if (_didIteratorError3) {
259
- throw _iteratorError3;
260
- }
261
- }
210
+
211
+ for (var _i6 = 0, _this$getRecursivelyR2 = this.getRecursivelyReferencedFragments(operation); _i6 < _this$getRecursivelyR2.length; _i6++) {
212
+ var frag = _this$getRecursivelyR2[_i6];
213
+ usages = usages.concat(this.getVariableUsages(frag));
262
214
  }
263
215
 
264
216
  this._recursiveVariableUsages.set(operation, usages);
@@ -1,9 +1,11 @@
1
1
  // @flow strict
2
2
 
3
3
  import { type ObjMap } from '../jsutils/ObjMap';
4
+
4
5
  import { type GraphQLError } from '../error/GraphQLError';
5
- import { type ASTVisitor, visit, visitWithTypeInfo } from '../language/visitor';
6
+
6
7
  import { Kind } from '../language/kinds';
8
+ import { type ASTVisitor, visit, visitWithTypeInfo } from '../language/visitor';
7
9
  import {
8
10
  type DocumentNode,
9
11
  type OperationDefinitionNode,
@@ -12,7 +14,9 @@ import {
12
14
  type FragmentSpreadNode,
13
15
  type FragmentDefinitionNode,
14
16
  } from '../language/ast';
17
+
15
18
  import { type GraphQLSchema } from '../type/schema';
19
+ import { type GraphQLDirective } from '../type/directives';
16
20
  import {
17
21
  type GraphQLInputType,
18
22
  type GraphQLOutputType,
@@ -20,7 +24,7 @@ import {
20
24
  type GraphQLField,
21
25
  type GraphQLArgument,
22
26
  } from '../type/definition';
23
- import { type GraphQLDirective } from '../type/directives';
27
+
24
28
  import { TypeInfo } from '../utilities/TypeInfo';
25
29
 
26
30
  type NodeWithSelectionSet = OperationDefinitionNode | FragmentDefinitionNode;
@@ -37,6 +41,7 @@ type VariableUsage = {|
37
41
  */
38
42
  export class ASTValidationContext {
39
43
  _ast: DocumentNode;
44
+ _onError: ?(err: GraphQLError) => void;
40
45
  _errors: Array<GraphQLError>;
41
46
  _fragments: ?ObjMap<FragmentDefinitionNode>;
42
47
  _fragmentSpreads: Map<SelectionSetNode, $ReadOnlyArray<FragmentSpreadNode>>;
@@ -45,18 +50,23 @@ export class ASTValidationContext {
45
50
  $ReadOnlyArray<FragmentDefinitionNode>,
46
51
  >;
47
52
 
48
- constructor(ast: DocumentNode): void {
53
+ constructor(ast: DocumentNode, onError?: (err: GraphQLError) => void): void {
49
54
  this._ast = ast;
50
55
  this._errors = [];
51
56
  this._fragments = undefined;
52
57
  this._fragmentSpreads = new Map();
53
58
  this._recursivelyReferencedFragments = new Map();
59
+ this._onError = onError;
54
60
  }
55
61
 
56
62
  reportError(error: GraphQLError): void {
57
63
  this._errors.push(error);
64
+ if (this._onError) {
65
+ this._onError(error);
66
+ }
58
67
  }
59
68
 
69
+ // @deprecated: use onError callback instead - will be removed in v15.
60
70
  getErrors(): $ReadOnlyArray<GraphQLError> {
61
71
  return this._errors;
62
72
  }
@@ -136,8 +146,12 @@ export type ASTValidationRule = ASTValidationContext => ASTVisitor;
136
146
  export class SDLValidationContext extends ASTValidationContext {
137
147
  _schema: ?GraphQLSchema;
138
148
 
139
- constructor(ast: DocumentNode, schema?: ?GraphQLSchema): void {
140
- super(ast);
149
+ constructor(
150
+ ast: DocumentNode,
151
+ schema: ?GraphQLSchema,
152
+ onError: (err: GraphQLError) => void,
153
+ ): void {
154
+ super(ast, onError);
141
155
  this._schema = schema;
142
156
  }
143
157
 
@@ -161,8 +175,9 @@ export class ValidationContext extends ASTValidationContext {
161
175
  schema: GraphQLSchema,
162
176
  ast: DocumentNode,
163
177
  typeInfo: TypeInfo,
178
+ onError?: (err: GraphQLError) => void,
164
179
  ): void {
165
- super(ast);
180
+ super(ast, onError);
166
181
  this._schema = schema;
167
182
  this._typeInfo = typeInfo;
168
183
  this._variableUsages = new Map();
@@ -227,7 +242,7 @@ export class ValidationContext extends ASTValidationContext {
227
242
  return this._typeInfo.getParentInputType();
228
243
  }
229
244
 
230
- getFieldDef(): ?GraphQLField<*, *> {
245
+ getFieldDef(): ?GraphQLField<mixed, mixed> {
231
246
  return this._typeInfo.getFieldDef();
232
247
  }
233
248
 
@@ -1,7 +1,7 @@
1
1
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
2
2
 
3
- import { visit, visitWithTypeInfo } from '../language/visitor';
4
3
  import { Kind } from '../language/kinds';
4
+ import { visit, visitWithTypeInfo } from '../language/visitor';
5
5
  import { TypeInfo } from '../utilities/TypeInfo';
6
6
 
7
7
  /**
@@ -12,19 +12,25 @@ import { TypeInfo } from '../utilities/TypeInfo';
12
12
  export var ASTValidationContext =
13
13
  /*#__PURE__*/
14
14
  function () {
15
- function ASTValidationContext(ast) {
15
+ function ASTValidationContext(ast, onError) {
16
16
  this._ast = ast;
17
17
  this._errors = [];
18
18
  this._fragments = undefined;
19
19
  this._fragmentSpreads = new Map();
20
20
  this._recursivelyReferencedFragments = new Map();
21
+ this._onError = onError;
21
22
  }
22
23
 
23
24
  var _proto = ASTValidationContext.prototype;
24
25
 
25
26
  _proto.reportError = function reportError(error) {
26
27
  this._errors.push(error);
27
- };
28
+
29
+ if (this._onError) {
30
+ this._onError(error);
31
+ }
32
+ } // @deprecated: use onError callback instead - will be removed in v15.
33
+ ;
28
34
 
29
35
  _proto.getErrors = function getErrors() {
30
36
  return this._errors;
@@ -59,32 +65,14 @@ function () {
59
65
 
60
66
  while (setsToVisit.length !== 0) {
61
67
  var set = setsToVisit.pop();
62
- var _iteratorNormalCompletion = true;
63
- var _didIteratorError = false;
64
- var _iteratorError = undefined;
65
-
66
- try {
67
- for (var _iterator = set.selections[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
68
- var selection = _step.value;
69
-
70
- if (selection.kind === Kind.FRAGMENT_SPREAD) {
71
- spreads.push(selection);
72
- } else if (selection.selectionSet) {
73
- setsToVisit.push(selection.selectionSet);
74
- }
75
- }
76
- } catch (err) {
77
- _didIteratorError = true;
78
- _iteratorError = err;
79
- } finally {
80
- try {
81
- if (!_iteratorNormalCompletion && _iterator.return != null) {
82
- _iterator.return();
83
- }
84
- } finally {
85
- if (_didIteratorError) {
86
- throw _iteratorError;
87
- }
68
+
69
+ for (var _i2 = 0, _set$selections2 = set.selections; _i2 < _set$selections2.length; _i2++) {
70
+ var selection = _set$selections2[_i2];
71
+
72
+ if (selection.kind === Kind.FRAGMENT_SPREAD) {
73
+ spreads.push(selection);
74
+ } else if (selection.selectionSet) {
75
+ setsToVisit.push(selection.selectionSet);
88
76
  }
89
77
  }
90
78
  }
@@ -105,36 +93,18 @@ function () {
105
93
 
106
94
  while (nodesToVisit.length !== 0) {
107
95
  var node = nodesToVisit.pop();
108
- var _iteratorNormalCompletion2 = true;
109
- var _didIteratorError2 = false;
110
- var _iteratorError2 = undefined;
111
-
112
- try {
113
- for (var _iterator2 = this.getFragmentSpreads(node)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
114
- var spread = _step2.value;
115
- var fragName = spread.name.value;
116
-
117
- if (collectedNames[fragName] !== true) {
118
- collectedNames[fragName] = true;
119
- var fragment = this.getFragment(fragName);
120
-
121
- if (fragment) {
122
- fragments.push(fragment);
123
- nodesToVisit.push(fragment.selectionSet);
124
- }
125
- }
126
- }
127
- } catch (err) {
128
- _didIteratorError2 = true;
129
- _iteratorError2 = err;
130
- } finally {
131
- try {
132
- if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
133
- _iterator2.return();
134
- }
135
- } finally {
136
- if (_didIteratorError2) {
137
- throw _iteratorError2;
96
+
97
+ for (var _i4 = 0, _this$getFragmentSpre2 = this.getFragmentSpreads(node); _i4 < _this$getFragmentSpre2.length; _i4++) {
98
+ var spread = _this$getFragmentSpre2[_i4];
99
+ var fragName = spread.name.value;
100
+
101
+ if (collectedNames[fragName] !== true) {
102
+ collectedNames[fragName] = true;
103
+ var fragment = this.getFragment(fragName);
104
+
105
+ if (fragment) {
106
+ fragments.push(fragment);
107
+ nodesToVisit.push(fragment.selectionSet);
138
108
  }
139
109
  }
140
110
  }
@@ -153,10 +123,10 @@ export var SDLValidationContext =
153
123
  function (_ASTValidationContext) {
154
124
  _inheritsLoose(SDLValidationContext, _ASTValidationContext);
155
125
 
156
- function SDLValidationContext(ast, schema) {
126
+ function SDLValidationContext(ast, schema, onError) {
157
127
  var _this;
158
128
 
159
- _this = _ASTValidationContext.call(this, ast) || this;
129
+ _this = _ASTValidationContext.call(this, ast, onError) || this;
160
130
  _this._schema = schema;
161
131
  return _this;
162
132
  }
@@ -174,10 +144,10 @@ export var ValidationContext =
174
144
  function (_ASTValidationContext2) {
175
145
  _inheritsLoose(ValidationContext, _ASTValidationContext2);
176
146
 
177
- function ValidationContext(schema, ast, typeInfo) {
147
+ function ValidationContext(schema, ast, typeInfo, onError) {
178
148
  var _this2;
179
149
 
180
- _this2 = _ASTValidationContext2.call(this, ast) || this;
150
+ _this2 = _ASTValidationContext2.call(this, ast, onError) || this;
181
151
  _this2._schema = schema;
182
152
  _this2._typeInfo = typeInfo;
183
153
  _this2._variableUsages = new Map();
@@ -222,28 +192,10 @@ function (_ASTValidationContext2) {
222
192
 
223
193
  if (!usages) {
224
194
  usages = this.getVariableUsages(operation);
225
- var _iteratorNormalCompletion3 = true;
226
- var _didIteratorError3 = false;
227
- var _iteratorError3 = undefined;
228
-
229
- try {
230
- for (var _iterator3 = this.getRecursivelyReferencedFragments(operation)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
231
- var frag = _step3.value;
232
- usages = usages.concat(this.getVariableUsages(frag));
233
- }
234
- } catch (err) {
235
- _didIteratorError3 = true;
236
- _iteratorError3 = err;
237
- } finally {
238
- try {
239
- if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
240
- _iterator3.return();
241
- }
242
- } finally {
243
- if (_didIteratorError3) {
244
- throw _iteratorError3;
245
- }
246
- }
195
+
196
+ for (var _i6 = 0, _this$getRecursivelyR2 = this.getRecursivelyReferencedFragments(operation); _i6 < _this$getRecursivelyR2.length; _i6++) {
197
+ var frag = _this$getRecursivelyR2[_i6];
198
+ usages = usages.concat(this.getVariableUsages(frag));
247
199
  }
248
200
 
249
201
  this._recursiveVariableUsages.set(operation, usages);
@@ -0,0 +1,126 @@
1
+ export { validate } from './validate';
2
+
3
+ export { ValidationContext, ValidationRule } from './ValidationContext';
4
+
5
+ export { specifiedRules } from './specifiedRules';
6
+
7
+ // Spec Section: "Field Selections on Objects, Interfaces, and Unions Types"
8
+ export {
9
+ FieldsOnCorrectType as FieldsOnCorrectTypeRule,
10
+ } from './rules/FieldsOnCorrectType';
11
+
12
+ // Spec Section: "Fragments on Composite Types"
13
+ export {
14
+ FragmentsOnCompositeTypes as FragmentsOnCompositeTypesRule,
15
+ } from './rules/FragmentsOnCompositeTypes';
16
+
17
+ // Spec Section: "Argument Names"
18
+ export {
19
+ KnownArgumentNames as KnownArgumentNamesRule,
20
+ } from './rules/KnownArgumentNames';
21
+
22
+ // Spec Section: "Directives Are Defined"
23
+ export {
24
+ KnownDirectives as KnownDirectivesRule,
25
+ } from './rules/KnownDirectives';
26
+
27
+ // Spec Section: "Fragment spread target defined"
28
+ export {
29
+ KnownFragmentNames as KnownFragmentNamesRule,
30
+ } from './rules/KnownFragmentNames';
31
+
32
+ // Spec Section: "Fragment Spread Type Existence"
33
+ export { KnownTypeNames as KnownTypeNamesRule } from './rules/KnownTypeNames';
34
+
35
+ // Spec Section: "Lone Anonymous Operation"
36
+ export {
37
+ LoneAnonymousOperation as LoneAnonymousOperationRule,
38
+ } from './rules/LoneAnonymousOperation';
39
+
40
+ // Spec Section: "Fragments must not form cycles"
41
+ export {
42
+ NoFragmentCycles as NoFragmentCyclesRule,
43
+ } from './rules/NoFragmentCycles';
44
+
45
+ // Spec Section: "All Variable Used Defined"
46
+ export {
47
+ NoUndefinedVariables as NoUndefinedVariablesRule,
48
+ } from './rules/NoUndefinedVariables';
49
+
50
+ // Spec Section: "Fragments must be used"
51
+ export {
52
+ NoUnusedFragments as NoUnusedFragmentsRule,
53
+ } from './rules/NoUnusedFragments';
54
+
55
+ // Spec Section: "All Variables Used"
56
+ export {
57
+ NoUnusedVariables as NoUnusedVariablesRule,
58
+ } from './rules/NoUnusedVariables';
59
+
60
+ // Spec Section: "Field Selection Merging"
61
+ export {
62
+ OverlappingFieldsCanBeMerged as OverlappingFieldsCanBeMergedRule,
63
+ } from './rules/OverlappingFieldsCanBeMerged';
64
+
65
+ // Spec Section: "Fragment spread is possible"
66
+ export {
67
+ PossibleFragmentSpreads as PossibleFragmentSpreadsRule,
68
+ } from './rules/PossibleFragmentSpreads';
69
+
70
+ // Spec Section: "Argument Optionality"
71
+ export {
72
+ ProvidedRequiredArguments as ProvidedRequiredArgumentsRule,
73
+ } from './rules/ProvidedRequiredArguments';
74
+
75
+ // Spec Section: "Leaf Field Selections"
76
+ export { ScalarLeafs as ScalarLeafsRule } from './rules/ScalarLeafs';
77
+
78
+ // Spec Section: "Subscriptions with Single Root Field"
79
+ export {
80
+ SingleFieldSubscriptions as SingleFieldSubscriptionsRule,
81
+ } from './rules/SingleFieldSubscriptions';
82
+
83
+ // Spec Section: "Argument Uniqueness"
84
+ export {
85
+ UniqueArgumentNames as UniqueArgumentNamesRule,
86
+ } from './rules/UniqueArgumentNames';
87
+
88
+ // Spec Section: "Directives Are Unique Per Location"
89
+ export {
90
+ UniqueDirectivesPerLocation as UniqueDirectivesPerLocationRule,
91
+ } from './rules/UniqueDirectivesPerLocation';
92
+
93
+ // Spec Section: "Fragment Name Uniqueness"
94
+ export {
95
+ UniqueFragmentNames as UniqueFragmentNamesRule,
96
+ } from './rules/UniqueFragmentNames';
97
+
98
+ // Spec Section: "Input Object Field Uniqueness"
99
+ export {
100
+ UniqueInputFieldNames as UniqueInputFieldNamesRule,
101
+ } from './rules/UniqueInputFieldNames';
102
+
103
+ // Spec Section: "Operation Name Uniqueness"
104
+ export {
105
+ UniqueOperationNames as UniqueOperationNamesRule,
106
+ } from './rules/UniqueOperationNames';
107
+
108
+ // Spec Section: "Variable Uniqueness"
109
+ export {
110
+ UniqueVariableNames as UniqueVariableNamesRule,
111
+ } from './rules/UniqueVariableNames';
112
+
113
+ // Spec Section: "Values Type Correctness"
114
+ export {
115
+ ValuesOfCorrectType as ValuesOfCorrectTypeRule,
116
+ } from './rules/ValuesOfCorrectType';
117
+
118
+ // Spec Section: "Variables are Input Types"
119
+ export {
120
+ VariablesAreInputTypes as VariablesAreInputTypesRule,
121
+ } from './rules/VariablesAreInputTypes';
122
+
123
+ // Spec Section: "All Variable Usages Are Allowed"
124
+ export {
125
+ VariablesInAllowedPosition as VariablesInAllowedPositionRule,
126
+ } from './rules/VariablesInAllowedPosition';