@contember/graphql-json 0.0.0-bootstrap → 2.2.0-alpha.20

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 (710) hide show
  1. package/README.md +120 -0
  2. package/dist/development/index.cjs +123 -0
  3. package/dist/development/index.cjs.map +1 -0
  4. package/dist/development/index.js +123 -0
  5. package/dist/development/index.js.map +1 -0
  6. package/dist/development/src/execution/collectFields.cjs +138 -0
  7. package/dist/development/src/execution/collectFields.cjs.map +1 -0
  8. package/dist/development/src/execution/collectFields.js +138 -0
  9. package/dist/development/src/execution/collectFields.js.map +1 -0
  10. package/dist/development/src/execution/complete.cjs +340 -0
  11. package/dist/development/src/execution/complete.cjs.map +1 -0
  12. package/dist/development/src/execution/complete.js +340 -0
  13. package/dist/development/src/execution/complete.js.map +1 -0
  14. package/dist/development/src/execution/context.cjs +93 -0
  15. package/dist/development/src/execution/context.cjs.map +1 -0
  16. package/dist/development/src/execution/context.js +93 -0
  17. package/dist/development/src/execution/context.js.map +1 -0
  18. package/dist/development/src/execution/directives.cjs +49 -0
  19. package/dist/development/src/execution/directives.cjs.map +1 -0
  20. package/dist/development/src/execution/directives.js +49 -0
  21. package/dist/development/src/execution/directives.js.map +1 -0
  22. package/dist/development/src/execution/execute.cjs +128 -0
  23. package/dist/development/src/execution/execute.cjs.map +1 -0
  24. package/dist/development/src/execution/execute.js +128 -0
  25. package/dist/development/src/execution/execute.js.map +1 -0
  26. package/dist/development/src/execution/fields.cjs +156 -0
  27. package/dist/development/src/execution/fields.cjs.map +1 -0
  28. package/dist/development/src/execution/fields.js +156 -0
  29. package/dist/development/src/execution/fields.js.map +1 -0
  30. package/dist/development/src/execution/introspectionResolvers.cjs +85 -0
  31. package/dist/development/src/execution/introspectionResolvers.cjs.map +1 -0
  32. package/dist/development/src/execution/introspectionResolvers.js +86 -0
  33. package/dist/development/src/execution/introspectionResolvers.js.map +1 -0
  34. package/dist/development/src/execution/values.cjs +371 -0
  35. package/dist/development/src/execution/values.cjs.map +1 -0
  36. package/dist/development/src/execution/values.js +371 -0
  37. package/dist/development/src/execution/values.js.map +1 -0
  38. package/dist/development/src/introspection/resolvers.cjs +432 -0
  39. package/dist/development/src/introspection/resolvers.cjs.map +1 -0
  40. package/dist/development/src/introspection/resolvers.js +432 -0
  41. package/dist/development/src/introspection/resolvers.js.map +1 -0
  42. package/dist/development/src/introspection/types.cjs +267 -0
  43. package/dist/development/src/introspection/types.cjs.map +1 -0
  44. package/dist/development/src/introspection/types.js +267 -0
  45. package/dist/development/src/introspection/types.js.map +1 -0
  46. package/dist/development/src/scalars/builtIn.cjs +260 -0
  47. package/dist/development/src/scalars/builtIn.cjs.map +1 -0
  48. package/dist/development/src/scalars/builtIn.js +260 -0
  49. package/dist/development/src/scalars/builtIn.js.map +1 -0
  50. package/dist/development/src/schema/buildSchema.cjs +235 -0
  51. package/dist/development/src/schema/buildSchema.cjs.map +1 -0
  52. package/dist/development/src/schema/buildSchema.js +235 -0
  53. package/dist/development/src/schema/buildSchema.js.map +1 -0
  54. package/dist/development/src/types/resolvers.cjs +15 -0
  55. package/dist/development/src/types/resolvers.cjs.map +1 -0
  56. package/dist/development/src/types/resolvers.js +15 -0
  57. package/dist/development/src/types/resolvers.js.map +1 -0
  58. package/dist/development/src/types/schema.cjs +184 -0
  59. package/dist/development/src/types/schema.cjs.map +1 -0
  60. package/dist/development/src/types/schema.js +184 -0
  61. package/dist/development/src/types/schema.js.map +1 -0
  62. package/dist/development/src/utils/enumValues.cjs +49 -0
  63. package/dist/development/src/utils/enumValues.cjs.map +1 -0
  64. package/dist/development/src/utils/enumValues.js +49 -0
  65. package/dist/development/src/utils/enumValues.js.map +1 -0
  66. package/dist/development/src/utils/helpers.cjs +122 -0
  67. package/dist/development/src/utils/helpers.cjs.map +1 -0
  68. package/dist/development/src/utils/helpers.js +122 -0
  69. package/dist/development/src/utils/helpers.js.map +1 -0
  70. package/dist/development/src/utils/path.cjs +17 -0
  71. package/dist/development/src/utils/path.cjs.map +1 -0
  72. package/dist/development/src/utils/path.js +17 -0
  73. package/dist/development/src/utils/path.js.map +1 -0
  74. package/dist/development/src/utils/schemaInterner.cjs +297 -0
  75. package/dist/development/src/utils/schemaInterner.cjs.map +1 -0
  76. package/dist/development/src/utils/schemaInterner.js +297 -0
  77. package/dist/development/src/utils/schemaInterner.js.map +1 -0
  78. package/dist/development/src/utils/toGraphQLJsSchema.cjs +130 -0
  79. package/dist/development/src/utils/toGraphQLJsSchema.cjs.map +1 -0
  80. package/dist/development/src/utils/toGraphQLJsSchema.js +130 -0
  81. package/dist/development/src/utils/toGraphQLJsSchema.js.map +1 -0
  82. package/dist/development/src/utils/typeRef.cjs +246 -0
  83. package/dist/development/src/utils/typeRef.cjs.map +1 -0
  84. package/dist/development/src/utils/typeRef.js +246 -0
  85. package/dist/development/src/utils/typeRef.js.map +1 -0
  86. package/dist/development/src/validation/TypeInfo.cjs +309 -0
  87. package/dist/development/src/validation/TypeInfo.cjs.map +1 -0
  88. package/dist/development/src/validation/TypeInfo.js +309 -0
  89. package/dist/development/src/validation/TypeInfo.js.map +1 -0
  90. package/dist/development/src/validation/ValidationContext.cjs +170 -0
  91. package/dist/development/src/validation/ValidationContext.cjs.map +1 -0
  92. package/dist/development/src/validation/ValidationContext.js +170 -0
  93. package/dist/development/src/validation/ValidationContext.js.map +1 -0
  94. package/dist/development/src/validation/helpers.cjs +233 -0
  95. package/dist/development/src/validation/helpers.cjs.map +1 -0
  96. package/dist/development/src/validation/helpers.js +233 -0
  97. package/dist/development/src/validation/helpers.js.map +1 -0
  98. package/dist/development/src/validation/rules/ExecutableDefinitionsRule.cjs +25 -0
  99. package/dist/development/src/validation/rules/ExecutableDefinitionsRule.cjs.map +1 -0
  100. package/dist/development/src/validation/rules/ExecutableDefinitionsRule.js +25 -0
  101. package/dist/development/src/validation/rules/ExecutableDefinitionsRule.js.map +1 -0
  102. package/dist/development/src/validation/rules/FieldsOnCorrectTypeRule.cjs +80 -0
  103. package/dist/development/src/validation/rules/FieldsOnCorrectTypeRule.cjs.map +1 -0
  104. package/dist/development/src/validation/rules/FieldsOnCorrectTypeRule.js +80 -0
  105. package/dist/development/src/validation/rules/FieldsOnCorrectTypeRule.js.map +1 -0
  106. package/dist/development/src/validation/rules/FragmentsOnCompositeTypesRule.cjs +39 -0
  107. package/dist/development/src/validation/rules/FragmentsOnCompositeTypesRule.cjs.map +1 -0
  108. package/dist/development/src/validation/rules/FragmentsOnCompositeTypesRule.js +39 -0
  109. package/dist/development/src/validation/rules/FragmentsOnCompositeTypesRule.js.map +1 -0
  110. package/dist/development/src/validation/rules/KnownArgumentNamesRule.cjs +62 -0
  111. package/dist/development/src/validation/rules/KnownArgumentNamesRule.cjs.map +1 -0
  112. package/dist/development/src/validation/rules/KnownArgumentNamesRule.js +62 -0
  113. package/dist/development/src/validation/rules/KnownArgumentNamesRule.js.map +1 -0
  114. package/dist/development/src/validation/rules/KnownDirectivesRule.cjs +99 -0
  115. package/dist/development/src/validation/rules/KnownDirectivesRule.cjs.map +1 -0
  116. package/dist/development/src/validation/rules/KnownDirectivesRule.js +99 -0
  117. package/dist/development/src/validation/rules/KnownDirectivesRule.js.map +1 -0
  118. package/dist/development/src/validation/rules/KnownFragmentNamesRule.cjs +18 -0
  119. package/dist/development/src/validation/rules/KnownFragmentNamesRule.cjs.map +1 -0
  120. package/dist/development/src/validation/rules/KnownFragmentNamesRule.js +18 -0
  121. package/dist/development/src/validation/rules/KnownFragmentNamesRule.js.map +1 -0
  122. package/dist/development/src/validation/rules/KnownTypeNamesRule.cjs +36 -0
  123. package/dist/development/src/validation/rules/KnownTypeNamesRule.cjs.map +1 -0
  124. package/dist/development/src/validation/rules/KnownTypeNamesRule.js +36 -0
  125. package/dist/development/src/validation/rules/KnownTypeNamesRule.js.map +1 -0
  126. package/dist/development/src/validation/rules/LoneAnonymousOperationRule.cjs +25 -0
  127. package/dist/development/src/validation/rules/LoneAnonymousOperationRule.cjs.map +1 -0
  128. package/dist/development/src/validation/rules/LoneAnonymousOperationRule.js +25 -0
  129. package/dist/development/src/validation/rules/LoneAnonymousOperationRule.js.map +1 -0
  130. package/dist/development/src/validation/rules/MaxIntrospectionDepthRule.cjs +51 -0
  131. package/dist/development/src/validation/rules/MaxIntrospectionDepthRule.cjs.map +1 -0
  132. package/dist/development/src/validation/rules/MaxIntrospectionDepthRule.js +51 -0
  133. package/dist/development/src/validation/rules/MaxIntrospectionDepthRule.js.map +1 -0
  134. package/dist/development/src/validation/rules/NoFragmentCyclesRule.cjs +68 -0
  135. package/dist/development/src/validation/rules/NoFragmentCyclesRule.cjs.map +1 -0
  136. package/dist/development/src/validation/rules/NoFragmentCyclesRule.js +68 -0
  137. package/dist/development/src/validation/rules/NoFragmentCyclesRule.js.map +1 -0
  138. package/dist/development/src/validation/rules/NoUndefinedVariablesRule.cjs +28 -0
  139. package/dist/development/src/validation/rules/NoUndefinedVariablesRule.cjs.map +1 -0
  140. package/dist/development/src/validation/rules/NoUndefinedVariablesRule.js +28 -0
  141. package/dist/development/src/validation/rules/NoUndefinedVariablesRule.js.map +1 -0
  142. package/dist/development/src/validation/rules/NoUnusedFragmentsRule.cjs +39 -0
  143. package/dist/development/src/validation/rules/NoUnusedFragmentsRule.cjs.map +1 -0
  144. package/dist/development/src/validation/rules/NoUnusedFragmentsRule.js +39 -0
  145. package/dist/development/src/validation/rules/NoUnusedFragmentsRule.js.map +1 -0
  146. package/dist/development/src/validation/rules/NoUnusedVariablesRule.cjs +36 -0
  147. package/dist/development/src/validation/rules/NoUnusedVariablesRule.cjs.map +1 -0
  148. package/dist/development/src/validation/rules/NoUnusedVariablesRule.js +36 -0
  149. package/dist/development/src/validation/rules/NoUnusedVariablesRule.js.map +1 -0
  150. package/dist/development/src/validation/rules/OverlappingFieldsCanBeMergedRule.cjs +326 -0
  151. package/dist/development/src/validation/rules/OverlappingFieldsCanBeMergedRule.cjs.map +1 -0
  152. package/dist/development/src/validation/rules/OverlappingFieldsCanBeMergedRule.js +326 -0
  153. package/dist/development/src/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -0
  154. package/dist/development/src/validation/rules/PossibleFragmentSpreadsRule.cjs +71 -0
  155. package/dist/development/src/validation/rules/PossibleFragmentSpreadsRule.cjs.map +1 -0
  156. package/dist/development/src/validation/rules/PossibleFragmentSpreadsRule.js +71 -0
  157. package/dist/development/src/validation/rules/PossibleFragmentSpreadsRule.js.map +1 -0
  158. package/dist/development/src/validation/rules/ProvidedRequiredArgumentsRule.cjs +88 -0
  159. package/dist/development/src/validation/rules/ProvidedRequiredArgumentsRule.cjs.map +1 -0
  160. package/dist/development/src/validation/rules/ProvidedRequiredArgumentsRule.js +88 -0
  161. package/dist/development/src/validation/rules/ProvidedRequiredArgumentsRule.js.map +1 -0
  162. package/dist/development/src/validation/rules/ScalarLeafsRule.cjs +46 -0
  163. package/dist/development/src/validation/rules/ScalarLeafsRule.cjs.map +1 -0
  164. package/dist/development/src/validation/rules/ScalarLeafsRule.js +46 -0
  165. package/dist/development/src/validation/rules/ScalarLeafsRule.js.map +1 -0
  166. package/dist/development/src/validation/rules/SingleFieldSubscriptionsRule.cjs +51 -0
  167. package/dist/development/src/validation/rules/SingleFieldSubscriptionsRule.cjs.map +1 -0
  168. package/dist/development/src/validation/rules/SingleFieldSubscriptionsRule.js +51 -0
  169. package/dist/development/src/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -0
  170. package/dist/development/src/validation/rules/UniqueArgumentNamesRule.cjs +34 -0
  171. package/dist/development/src/validation/rules/UniqueArgumentNamesRule.cjs.map +1 -0
  172. package/dist/development/src/validation/rules/UniqueArgumentNamesRule.js +34 -0
  173. package/dist/development/src/validation/rules/UniqueArgumentNamesRule.js.map +1 -0
  174. package/dist/development/src/validation/rules/UniqueDirectivesPerLocationRule.cjs +51 -0
  175. package/dist/development/src/validation/rules/UniqueDirectivesPerLocationRule.cjs.map +1 -0
  176. package/dist/development/src/validation/rules/UniqueDirectivesPerLocationRule.js +51 -0
  177. package/dist/development/src/validation/rules/UniqueDirectivesPerLocationRule.js.map +1 -0
  178. package/dist/development/src/validation/rules/UniqueFragmentNamesRule.cjs +28 -0
  179. package/dist/development/src/validation/rules/UniqueFragmentNamesRule.cjs.map +1 -0
  180. package/dist/development/src/validation/rules/UniqueFragmentNamesRule.js +28 -0
  181. package/dist/development/src/validation/rules/UniqueFragmentNamesRule.js.map +1 -0
  182. package/dist/development/src/validation/rules/UniqueInputFieldNamesRule.cjs +37 -0
  183. package/dist/development/src/validation/rules/UniqueInputFieldNamesRule.cjs.map +1 -0
  184. package/dist/development/src/validation/rules/UniqueInputFieldNamesRule.js +37 -0
  185. package/dist/development/src/validation/rules/UniqueInputFieldNamesRule.js.map +1 -0
  186. package/dist/development/src/validation/rules/UniqueOperationNamesRule.cjs +30 -0
  187. package/dist/development/src/validation/rules/UniqueOperationNamesRule.cjs.map +1 -0
  188. package/dist/development/src/validation/rules/UniqueOperationNamesRule.js +30 -0
  189. package/dist/development/src/validation/rules/UniqueOperationNamesRule.js.map +1 -0
  190. package/dist/development/src/validation/rules/UniqueVariableNamesRule.cjs +27 -0
  191. package/dist/development/src/validation/rules/UniqueVariableNamesRule.cjs.map +1 -0
  192. package/dist/development/src/validation/rules/UniqueVariableNamesRule.js +27 -0
  193. package/dist/development/src/validation/rules/UniqueVariableNamesRule.js.map +1 -0
  194. package/dist/development/src/validation/rules/ValuesOfCorrectTypeRule.cjs +123 -0
  195. package/dist/development/src/validation/rules/ValuesOfCorrectTypeRule.cjs.map +1 -0
  196. package/dist/development/src/validation/rules/ValuesOfCorrectTypeRule.js +123 -0
  197. package/dist/development/src/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -0
  198. package/dist/development/src/validation/rules/VariablesAreInputTypesRule.cjs +29 -0
  199. package/dist/development/src/validation/rules/VariablesAreInputTypesRule.cjs.map +1 -0
  200. package/dist/development/src/validation/rules/VariablesAreInputTypesRule.js +29 -0
  201. package/dist/development/src/validation/rules/VariablesAreInputTypesRule.js.map +1 -0
  202. package/dist/development/src/validation/rules/VariablesInAllowedPositionRule.cjs +63 -0
  203. package/dist/development/src/validation/rules/VariablesInAllowedPositionRule.cjs.map +1 -0
  204. package/dist/development/src/validation/rules/VariablesInAllowedPositionRule.js +63 -0
  205. package/dist/development/src/validation/rules/VariablesInAllowedPositionRule.js.map +1 -0
  206. package/dist/development/src/validation/sortValueNode.cjs +71 -0
  207. package/dist/development/src/validation/sortValueNode.cjs.map +1 -0
  208. package/dist/development/src/validation/sortValueNode.js +71 -0
  209. package/dist/development/src/validation/sortValueNode.js.map +1 -0
  210. package/dist/development/src/validation/specifiedRules.cjs +87 -0
  211. package/dist/development/src/validation/specifiedRules.cjs.map +1 -0
  212. package/dist/development/src/validation/specifiedRules.js +87 -0
  213. package/dist/development/src/validation/specifiedRules.js.map +1 -0
  214. package/dist/development/src/validation/validate.cjs +53 -0
  215. package/dist/development/src/validation/validate.cjs.map +1 -0
  216. package/dist/development/src/validation/validate.js +53 -0
  217. package/dist/development/src/validation/validate.js.map +1 -0
  218. package/dist/production/index.cjs +123 -0
  219. package/dist/production/index.cjs.map +1 -0
  220. package/dist/production/index.js +123 -0
  221. package/dist/production/index.js.map +1 -0
  222. package/dist/production/src/execution/collectFields.cjs +138 -0
  223. package/dist/production/src/execution/collectFields.cjs.map +1 -0
  224. package/dist/production/src/execution/collectFields.js +138 -0
  225. package/dist/production/src/execution/collectFields.js.map +1 -0
  226. package/dist/production/src/execution/complete.cjs +340 -0
  227. package/dist/production/src/execution/complete.cjs.map +1 -0
  228. package/dist/production/src/execution/complete.js +340 -0
  229. package/dist/production/src/execution/complete.js.map +1 -0
  230. package/dist/production/src/execution/context.cjs +93 -0
  231. package/dist/production/src/execution/context.cjs.map +1 -0
  232. package/dist/production/src/execution/context.js +93 -0
  233. package/dist/production/src/execution/context.js.map +1 -0
  234. package/dist/production/src/execution/directives.cjs +49 -0
  235. package/dist/production/src/execution/directives.cjs.map +1 -0
  236. package/dist/production/src/execution/directives.js +49 -0
  237. package/dist/production/src/execution/directives.js.map +1 -0
  238. package/dist/production/src/execution/execute.cjs +128 -0
  239. package/dist/production/src/execution/execute.cjs.map +1 -0
  240. package/dist/production/src/execution/execute.js +128 -0
  241. package/dist/production/src/execution/execute.js.map +1 -0
  242. package/dist/production/src/execution/fields.cjs +156 -0
  243. package/dist/production/src/execution/fields.cjs.map +1 -0
  244. package/dist/production/src/execution/fields.js +156 -0
  245. package/dist/production/src/execution/fields.js.map +1 -0
  246. package/dist/production/src/execution/introspectionResolvers.cjs +85 -0
  247. package/dist/production/src/execution/introspectionResolvers.cjs.map +1 -0
  248. package/dist/production/src/execution/introspectionResolvers.js +86 -0
  249. package/dist/production/src/execution/introspectionResolvers.js.map +1 -0
  250. package/dist/production/src/execution/values.cjs +371 -0
  251. package/dist/production/src/execution/values.cjs.map +1 -0
  252. package/dist/production/src/execution/values.js +371 -0
  253. package/dist/production/src/execution/values.js.map +1 -0
  254. package/dist/production/src/introspection/resolvers.cjs +432 -0
  255. package/dist/production/src/introspection/resolvers.cjs.map +1 -0
  256. package/dist/production/src/introspection/resolvers.js +432 -0
  257. package/dist/production/src/introspection/resolvers.js.map +1 -0
  258. package/dist/production/src/introspection/types.cjs +267 -0
  259. package/dist/production/src/introspection/types.cjs.map +1 -0
  260. package/dist/production/src/introspection/types.js +267 -0
  261. package/dist/production/src/introspection/types.js.map +1 -0
  262. package/dist/production/src/scalars/builtIn.cjs +260 -0
  263. package/dist/production/src/scalars/builtIn.cjs.map +1 -0
  264. package/dist/production/src/scalars/builtIn.js +260 -0
  265. package/dist/production/src/scalars/builtIn.js.map +1 -0
  266. package/dist/production/src/schema/buildSchema.cjs +235 -0
  267. package/dist/production/src/schema/buildSchema.cjs.map +1 -0
  268. package/dist/production/src/schema/buildSchema.js +235 -0
  269. package/dist/production/src/schema/buildSchema.js.map +1 -0
  270. package/dist/production/src/types/resolvers.cjs +15 -0
  271. package/dist/production/src/types/resolvers.cjs.map +1 -0
  272. package/dist/production/src/types/resolvers.js +15 -0
  273. package/dist/production/src/types/resolvers.js.map +1 -0
  274. package/dist/production/src/types/schema.cjs +184 -0
  275. package/dist/production/src/types/schema.cjs.map +1 -0
  276. package/dist/production/src/types/schema.js +184 -0
  277. package/dist/production/src/types/schema.js.map +1 -0
  278. package/dist/production/src/utils/enumValues.cjs +49 -0
  279. package/dist/production/src/utils/enumValues.cjs.map +1 -0
  280. package/dist/production/src/utils/enumValues.js +49 -0
  281. package/dist/production/src/utils/enumValues.js.map +1 -0
  282. package/dist/production/src/utils/helpers.cjs +122 -0
  283. package/dist/production/src/utils/helpers.cjs.map +1 -0
  284. package/dist/production/src/utils/helpers.js +122 -0
  285. package/dist/production/src/utils/helpers.js.map +1 -0
  286. package/dist/production/src/utils/path.cjs +17 -0
  287. package/dist/production/src/utils/path.cjs.map +1 -0
  288. package/dist/production/src/utils/path.js +17 -0
  289. package/dist/production/src/utils/path.js.map +1 -0
  290. package/dist/production/src/utils/schemaInterner.cjs +297 -0
  291. package/dist/production/src/utils/schemaInterner.cjs.map +1 -0
  292. package/dist/production/src/utils/schemaInterner.js +297 -0
  293. package/dist/production/src/utils/schemaInterner.js.map +1 -0
  294. package/dist/production/src/utils/toGraphQLJsSchema.cjs +130 -0
  295. package/dist/production/src/utils/toGraphQLJsSchema.cjs.map +1 -0
  296. package/dist/production/src/utils/toGraphQLJsSchema.js +130 -0
  297. package/dist/production/src/utils/toGraphQLJsSchema.js.map +1 -0
  298. package/dist/production/src/utils/typeRef.cjs +246 -0
  299. package/dist/production/src/utils/typeRef.cjs.map +1 -0
  300. package/dist/production/src/utils/typeRef.js +246 -0
  301. package/dist/production/src/utils/typeRef.js.map +1 -0
  302. package/dist/production/src/validation/TypeInfo.cjs +309 -0
  303. package/dist/production/src/validation/TypeInfo.cjs.map +1 -0
  304. package/dist/production/src/validation/TypeInfo.js +309 -0
  305. package/dist/production/src/validation/TypeInfo.js.map +1 -0
  306. package/dist/production/src/validation/ValidationContext.cjs +170 -0
  307. package/dist/production/src/validation/ValidationContext.cjs.map +1 -0
  308. package/dist/production/src/validation/ValidationContext.js +170 -0
  309. package/dist/production/src/validation/ValidationContext.js.map +1 -0
  310. package/dist/production/src/validation/helpers.cjs +233 -0
  311. package/dist/production/src/validation/helpers.cjs.map +1 -0
  312. package/dist/production/src/validation/helpers.js +233 -0
  313. package/dist/production/src/validation/helpers.js.map +1 -0
  314. package/dist/production/src/validation/rules/ExecutableDefinitionsRule.cjs +25 -0
  315. package/dist/production/src/validation/rules/ExecutableDefinitionsRule.cjs.map +1 -0
  316. package/dist/production/src/validation/rules/ExecutableDefinitionsRule.js +25 -0
  317. package/dist/production/src/validation/rules/ExecutableDefinitionsRule.js.map +1 -0
  318. package/dist/production/src/validation/rules/FieldsOnCorrectTypeRule.cjs +80 -0
  319. package/dist/production/src/validation/rules/FieldsOnCorrectTypeRule.cjs.map +1 -0
  320. package/dist/production/src/validation/rules/FieldsOnCorrectTypeRule.js +80 -0
  321. package/dist/production/src/validation/rules/FieldsOnCorrectTypeRule.js.map +1 -0
  322. package/dist/production/src/validation/rules/FragmentsOnCompositeTypesRule.cjs +39 -0
  323. package/dist/production/src/validation/rules/FragmentsOnCompositeTypesRule.cjs.map +1 -0
  324. package/dist/production/src/validation/rules/FragmentsOnCompositeTypesRule.js +39 -0
  325. package/dist/production/src/validation/rules/FragmentsOnCompositeTypesRule.js.map +1 -0
  326. package/dist/production/src/validation/rules/KnownArgumentNamesRule.cjs +62 -0
  327. package/dist/production/src/validation/rules/KnownArgumentNamesRule.cjs.map +1 -0
  328. package/dist/production/src/validation/rules/KnownArgumentNamesRule.js +62 -0
  329. package/dist/production/src/validation/rules/KnownArgumentNamesRule.js.map +1 -0
  330. package/dist/production/src/validation/rules/KnownDirectivesRule.cjs +99 -0
  331. package/dist/production/src/validation/rules/KnownDirectivesRule.cjs.map +1 -0
  332. package/dist/production/src/validation/rules/KnownDirectivesRule.js +99 -0
  333. package/dist/production/src/validation/rules/KnownDirectivesRule.js.map +1 -0
  334. package/dist/production/src/validation/rules/KnownFragmentNamesRule.cjs +18 -0
  335. package/dist/production/src/validation/rules/KnownFragmentNamesRule.cjs.map +1 -0
  336. package/dist/production/src/validation/rules/KnownFragmentNamesRule.js +18 -0
  337. package/dist/production/src/validation/rules/KnownFragmentNamesRule.js.map +1 -0
  338. package/dist/production/src/validation/rules/KnownTypeNamesRule.cjs +36 -0
  339. package/dist/production/src/validation/rules/KnownTypeNamesRule.cjs.map +1 -0
  340. package/dist/production/src/validation/rules/KnownTypeNamesRule.js +36 -0
  341. package/dist/production/src/validation/rules/KnownTypeNamesRule.js.map +1 -0
  342. package/dist/production/src/validation/rules/LoneAnonymousOperationRule.cjs +25 -0
  343. package/dist/production/src/validation/rules/LoneAnonymousOperationRule.cjs.map +1 -0
  344. package/dist/production/src/validation/rules/LoneAnonymousOperationRule.js +25 -0
  345. package/dist/production/src/validation/rules/LoneAnonymousOperationRule.js.map +1 -0
  346. package/dist/production/src/validation/rules/MaxIntrospectionDepthRule.cjs +51 -0
  347. package/dist/production/src/validation/rules/MaxIntrospectionDepthRule.cjs.map +1 -0
  348. package/dist/production/src/validation/rules/MaxIntrospectionDepthRule.js +51 -0
  349. package/dist/production/src/validation/rules/MaxIntrospectionDepthRule.js.map +1 -0
  350. package/dist/production/src/validation/rules/NoFragmentCyclesRule.cjs +68 -0
  351. package/dist/production/src/validation/rules/NoFragmentCyclesRule.cjs.map +1 -0
  352. package/dist/production/src/validation/rules/NoFragmentCyclesRule.js +68 -0
  353. package/dist/production/src/validation/rules/NoFragmentCyclesRule.js.map +1 -0
  354. package/dist/production/src/validation/rules/NoUndefinedVariablesRule.cjs +28 -0
  355. package/dist/production/src/validation/rules/NoUndefinedVariablesRule.cjs.map +1 -0
  356. package/dist/production/src/validation/rules/NoUndefinedVariablesRule.js +28 -0
  357. package/dist/production/src/validation/rules/NoUndefinedVariablesRule.js.map +1 -0
  358. package/dist/production/src/validation/rules/NoUnusedFragmentsRule.cjs +39 -0
  359. package/dist/production/src/validation/rules/NoUnusedFragmentsRule.cjs.map +1 -0
  360. package/dist/production/src/validation/rules/NoUnusedFragmentsRule.js +39 -0
  361. package/dist/production/src/validation/rules/NoUnusedFragmentsRule.js.map +1 -0
  362. package/dist/production/src/validation/rules/NoUnusedVariablesRule.cjs +36 -0
  363. package/dist/production/src/validation/rules/NoUnusedVariablesRule.cjs.map +1 -0
  364. package/dist/production/src/validation/rules/NoUnusedVariablesRule.js +36 -0
  365. package/dist/production/src/validation/rules/NoUnusedVariablesRule.js.map +1 -0
  366. package/dist/production/src/validation/rules/OverlappingFieldsCanBeMergedRule.cjs +326 -0
  367. package/dist/production/src/validation/rules/OverlappingFieldsCanBeMergedRule.cjs.map +1 -0
  368. package/dist/production/src/validation/rules/OverlappingFieldsCanBeMergedRule.js +326 -0
  369. package/dist/production/src/validation/rules/OverlappingFieldsCanBeMergedRule.js.map +1 -0
  370. package/dist/production/src/validation/rules/PossibleFragmentSpreadsRule.cjs +71 -0
  371. package/dist/production/src/validation/rules/PossibleFragmentSpreadsRule.cjs.map +1 -0
  372. package/dist/production/src/validation/rules/PossibleFragmentSpreadsRule.js +71 -0
  373. package/dist/production/src/validation/rules/PossibleFragmentSpreadsRule.js.map +1 -0
  374. package/dist/production/src/validation/rules/ProvidedRequiredArgumentsRule.cjs +88 -0
  375. package/dist/production/src/validation/rules/ProvidedRequiredArgumentsRule.cjs.map +1 -0
  376. package/dist/production/src/validation/rules/ProvidedRequiredArgumentsRule.js +88 -0
  377. package/dist/production/src/validation/rules/ProvidedRequiredArgumentsRule.js.map +1 -0
  378. package/dist/production/src/validation/rules/ScalarLeafsRule.cjs +46 -0
  379. package/dist/production/src/validation/rules/ScalarLeafsRule.cjs.map +1 -0
  380. package/dist/production/src/validation/rules/ScalarLeafsRule.js +46 -0
  381. package/dist/production/src/validation/rules/ScalarLeafsRule.js.map +1 -0
  382. package/dist/production/src/validation/rules/SingleFieldSubscriptionsRule.cjs +51 -0
  383. package/dist/production/src/validation/rules/SingleFieldSubscriptionsRule.cjs.map +1 -0
  384. package/dist/production/src/validation/rules/SingleFieldSubscriptionsRule.js +51 -0
  385. package/dist/production/src/validation/rules/SingleFieldSubscriptionsRule.js.map +1 -0
  386. package/dist/production/src/validation/rules/UniqueArgumentNamesRule.cjs +34 -0
  387. package/dist/production/src/validation/rules/UniqueArgumentNamesRule.cjs.map +1 -0
  388. package/dist/production/src/validation/rules/UniqueArgumentNamesRule.js +34 -0
  389. package/dist/production/src/validation/rules/UniqueArgumentNamesRule.js.map +1 -0
  390. package/dist/production/src/validation/rules/UniqueDirectivesPerLocationRule.cjs +51 -0
  391. package/dist/production/src/validation/rules/UniqueDirectivesPerLocationRule.cjs.map +1 -0
  392. package/dist/production/src/validation/rules/UniqueDirectivesPerLocationRule.js +51 -0
  393. package/dist/production/src/validation/rules/UniqueDirectivesPerLocationRule.js.map +1 -0
  394. package/dist/production/src/validation/rules/UniqueFragmentNamesRule.cjs +28 -0
  395. package/dist/production/src/validation/rules/UniqueFragmentNamesRule.cjs.map +1 -0
  396. package/dist/production/src/validation/rules/UniqueFragmentNamesRule.js +28 -0
  397. package/dist/production/src/validation/rules/UniqueFragmentNamesRule.js.map +1 -0
  398. package/dist/production/src/validation/rules/UniqueInputFieldNamesRule.cjs +37 -0
  399. package/dist/production/src/validation/rules/UniqueInputFieldNamesRule.cjs.map +1 -0
  400. package/dist/production/src/validation/rules/UniqueInputFieldNamesRule.js +37 -0
  401. package/dist/production/src/validation/rules/UniqueInputFieldNamesRule.js.map +1 -0
  402. package/dist/production/src/validation/rules/UniqueOperationNamesRule.cjs +30 -0
  403. package/dist/production/src/validation/rules/UniqueOperationNamesRule.cjs.map +1 -0
  404. package/dist/production/src/validation/rules/UniqueOperationNamesRule.js +30 -0
  405. package/dist/production/src/validation/rules/UniqueOperationNamesRule.js.map +1 -0
  406. package/dist/production/src/validation/rules/UniqueVariableNamesRule.cjs +27 -0
  407. package/dist/production/src/validation/rules/UniqueVariableNamesRule.cjs.map +1 -0
  408. package/dist/production/src/validation/rules/UniqueVariableNamesRule.js +27 -0
  409. package/dist/production/src/validation/rules/UniqueVariableNamesRule.js.map +1 -0
  410. package/dist/production/src/validation/rules/ValuesOfCorrectTypeRule.cjs +123 -0
  411. package/dist/production/src/validation/rules/ValuesOfCorrectTypeRule.cjs.map +1 -0
  412. package/dist/production/src/validation/rules/ValuesOfCorrectTypeRule.js +123 -0
  413. package/dist/production/src/validation/rules/ValuesOfCorrectTypeRule.js.map +1 -0
  414. package/dist/production/src/validation/rules/VariablesAreInputTypesRule.cjs +29 -0
  415. package/dist/production/src/validation/rules/VariablesAreInputTypesRule.cjs.map +1 -0
  416. package/dist/production/src/validation/rules/VariablesAreInputTypesRule.js +29 -0
  417. package/dist/production/src/validation/rules/VariablesAreInputTypesRule.js.map +1 -0
  418. package/dist/production/src/validation/rules/VariablesInAllowedPositionRule.cjs +63 -0
  419. package/dist/production/src/validation/rules/VariablesInAllowedPositionRule.cjs.map +1 -0
  420. package/dist/production/src/validation/rules/VariablesInAllowedPositionRule.js +63 -0
  421. package/dist/production/src/validation/rules/VariablesInAllowedPositionRule.js.map +1 -0
  422. package/dist/production/src/validation/sortValueNode.cjs +71 -0
  423. package/dist/production/src/validation/sortValueNode.cjs.map +1 -0
  424. package/dist/production/src/validation/sortValueNode.js +71 -0
  425. package/dist/production/src/validation/sortValueNode.js.map +1 -0
  426. package/dist/production/src/validation/specifiedRules.cjs +87 -0
  427. package/dist/production/src/validation/specifiedRules.cjs.map +1 -0
  428. package/dist/production/src/validation/specifiedRules.js +87 -0
  429. package/dist/production/src/validation/specifiedRules.js.map +1 -0
  430. package/dist/production/src/validation/validate.cjs +53 -0
  431. package/dist/production/src/validation/validate.cjs.map +1 -0
  432. package/dist/production/src/validation/validate.js +53 -0
  433. package/dist/production/src/validation/validate.js.map +1 -0
  434. package/dist/tests/buildSchema.test.d.ts +2 -0
  435. package/dist/tests/buildSchema.test.d.ts.map +1 -0
  436. package/dist/tests/builtInScalars.test.d.ts +2 -0
  437. package/dist/tests/builtInScalars.test.d.ts.map +1 -0
  438. package/dist/tests/coercion.test.d.ts +2 -0
  439. package/dist/tests/coercion.test.d.ts.map +1 -0
  440. package/dist/tests/compat/abstract.test.d.ts +7 -0
  441. package/dist/tests/compat/abstract.test.d.ts.map +1 -0
  442. package/dist/tests/compat/adapter.d.ts +216 -0
  443. package/dist/tests/compat/adapter.d.ts.map +1 -0
  444. package/dist/tests/compat/directives.test.d.ts +7 -0
  445. package/dist/tests/compat/directives.test.d.ts.map +1 -0
  446. package/dist/tests/compat/executor.test.d.ts +7 -0
  447. package/dist/tests/compat/executor.test.d.ts.map +1 -0
  448. package/dist/tests/compat/lists.test.d.ts +7 -0
  449. package/dist/tests/compat/lists.test.d.ts.map +1 -0
  450. package/dist/tests/compat/nonnull.test.d.ts +7 -0
  451. package/dist/tests/compat/nonnull.test.d.ts.map +1 -0
  452. package/dist/tests/compat/testUtils.d.ts +30 -0
  453. package/dist/tests/compat/testUtils.d.ts.map +1 -0
  454. package/dist/tests/completedResult.test.d.ts +2 -0
  455. package/dist/tests/completedResult.test.d.ts.map +1 -0
  456. package/dist/tests/deprecatedInputValues.test.d.ts +2 -0
  457. package/dist/tests/deprecatedInputValues.test.d.ts.map +1 -0
  458. package/dist/tests/execute.test.d.ts +2 -0
  459. package/dist/tests/execute.test.d.ts.map +1 -0
  460. package/dist/tests/fieldErrors.test.d.ts +2 -0
  461. package/dist/tests/fieldErrors.test.d.ts.map +1 -0
  462. package/dist/tests/getArgumentValues.test.d.ts +2 -0
  463. package/dist/tests/getArgumentValues.test.d.ts.map +1 -0
  464. package/dist/tests/inspect.test.d.ts +2 -0
  465. package/dist/tests/inspect.test.d.ts.map +1 -0
  466. package/dist/tests/introspection.test.d.ts +2 -0
  467. package/dist/tests/introspection.test.d.ts.map +1 -0
  468. package/dist/tests/introspectionOrder.test.d.ts +2 -0
  469. package/dist/tests/introspectionOrder.test.d.ts.map +1 -0
  470. package/dist/tests/memoization.test.d.ts +2 -0
  471. package/dist/tests/memoization.test.d.ts.map +1 -0
  472. package/dist/tests/operationSelection.test.d.ts +2 -0
  473. package/dist/tests/operationSelection.test.d.ts.map +1 -0
  474. package/dist/tests/prototypeNames.test.d.ts +2 -0
  475. package/dist/tests/prototypeNames.test.d.ts.map +1 -0
  476. package/dist/tests/resolverLayers.test.d.ts +2 -0
  477. package/dist/tests/resolverLayers.test.d.ts.map +1 -0
  478. package/dist/tests/scalarParsers.test.d.ts +2 -0
  479. package/dist/tests/scalarParsers.test.d.ts.map +1 -0
  480. package/dist/tests/schemaInterner.test.d.ts +2 -0
  481. package/dist/tests/schemaInterner.test.d.ts.map +1 -0
  482. package/dist/tests/tsconfig.tsbuildinfo +1 -0
  483. package/dist/tests/typedContext.test.d.ts +2 -0
  484. package/dist/tests/typedContext.test.d.ts.map +1 -0
  485. package/dist/tests/validation/graphqlJsDifferential.test.d.ts +2 -0
  486. package/dist/tests/validation/graphqlJsDifferential.test.d.ts.map +1 -0
  487. package/dist/tests/validation/rules/MaxIntrospectionDepthRule.test.d.ts +2 -0
  488. package/dist/tests/validation/rules/MaxIntrospectionDepthRule.test.d.ts.map +1 -0
  489. package/dist/tests/validation/rules/NoUnusedVariablesRule.test.d.ts +2 -0
  490. package/dist/tests/validation/rules/NoUnusedVariablesRule.test.d.ts.map +1 -0
  491. package/dist/tests/validation/rules/OverlappingFieldsCanBeMergedRule.test.d.ts +2 -0
  492. package/dist/tests/validation/rules/OverlappingFieldsCanBeMergedRule.test.d.ts.map +1 -0
  493. package/dist/tests/validation/rules/SingleFieldSubscriptionsRule.test.d.ts +2 -0
  494. package/dist/tests/validation/rules/SingleFieldSubscriptionsRule.test.d.ts.map +1 -0
  495. package/dist/tests/validation/rules/differential.test.d.ts +2 -0
  496. package/dist/tests/validation/rules/differential.test.d.ts.map +1 -0
  497. package/dist/tests/validation/rules/harness.d.ts +10 -0
  498. package/dist/tests/validation/rules/harness.d.ts.map +1 -0
  499. package/dist/tests/validation/validate.test.d.ts +2 -0
  500. package/dist/tests/validation/validate.test.d.ts.map +1 -0
  501. package/dist/types/execution/collectFields.d.ts +16 -0
  502. package/dist/types/execution/collectFields.d.ts.map +1 -0
  503. package/dist/types/execution/complete.d.ts +24 -0
  504. package/dist/types/execution/complete.d.ts.map +1 -0
  505. package/dist/types/execution/context.d.ts +23 -0
  506. package/dist/types/execution/context.d.ts.map +1 -0
  507. package/dist/types/execution/directives.d.ts +9 -0
  508. package/dist/types/execution/directives.d.ts.map +1 -0
  509. package/dist/types/execution/execute.d.ts +15 -0
  510. package/dist/types/execution/execute.d.ts.map +1 -0
  511. package/dist/types/execution/fields.d.ts +26 -0
  512. package/dist/types/execution/fields.d.ts.map +1 -0
  513. package/dist/types/execution/introspectionResolvers.d.ts +13 -0
  514. package/dist/types/execution/introspectionResolvers.d.ts.map +1 -0
  515. package/dist/types/execution/values.d.ts +17 -0
  516. package/dist/types/execution/values.d.ts.map +1 -0
  517. package/dist/types/index.d.ts +26 -0
  518. package/dist/types/index.d.ts.map +1 -0
  519. package/dist/types/introspection/index.d.ts +10 -0
  520. package/dist/types/introspection/index.d.ts.map +1 -0
  521. package/dist/types/introspection/resolvers.d.ts +141 -0
  522. package/dist/types/introspection/resolvers.d.ts.map +1 -0
  523. package/dist/types/introspection/types.d.ts +80 -0
  524. package/dist/types/introspection/types.d.ts.map +1 -0
  525. package/dist/types/scalars/builtIn.d.ts +42 -0
  526. package/dist/types/scalars/builtIn.d.ts.map +1 -0
  527. package/dist/types/schema/buildSchema.d.ts +14 -0
  528. package/dist/types/schema/buildSchema.d.ts.map +1 -0
  529. package/dist/types/tsconfig.tsbuildinfo +1 -0
  530. package/dist/types/types/execution.d.ts +72 -0
  531. package/dist/types/types/execution.d.ts.map +1 -0
  532. package/dist/types/types/resolvers.d.ts +82 -0
  533. package/dist/types/types/resolvers.d.ts.map +1 -0
  534. package/dist/types/types/schema.d.ts +227 -0
  535. package/dist/types/types/schema.d.ts.map +1 -0
  536. package/dist/types/utils/enumValues.d.ts +18 -0
  537. package/dist/types/utils/enumValues.d.ts.map +1 -0
  538. package/dist/types/utils/helpers.d.ts +45 -0
  539. package/dist/types/utils/helpers.d.ts.map +1 -0
  540. package/dist/types/utils/path.d.ts +17 -0
  541. package/dist/types/utils/path.d.ts.map +1 -0
  542. package/dist/types/utils/schemaInterner.d.ts +54 -0
  543. package/dist/types/utils/schemaInterner.d.ts.map +1 -0
  544. package/dist/types/utils/toGraphQLJsSchema.d.ts +5 -0
  545. package/dist/types/utils/toGraphQLJsSchema.d.ts.map +1 -0
  546. package/dist/types/utils/typeRef.d.ts +61 -0
  547. package/dist/types/utils/typeRef.d.ts.map +1 -0
  548. package/dist/types/validation/TypeInfo.d.ts +57 -0
  549. package/dist/types/validation/TypeInfo.d.ts.map +1 -0
  550. package/dist/types/validation/ValidationContext.d.ts +59 -0
  551. package/dist/types/validation/ValidationContext.d.ts.map +1 -0
  552. package/dist/types/validation/helpers.d.ts +47 -0
  553. package/dist/types/validation/helpers.d.ts.map +1 -0
  554. package/dist/types/validation/rules/ExecutableDefinitionsRule.d.ts +13 -0
  555. package/dist/types/validation/rules/ExecutableDefinitionsRule.d.ts.map +1 -0
  556. package/dist/types/validation/rules/FieldsOnCorrectTypeRule.d.ts +12 -0
  557. package/dist/types/validation/rules/FieldsOnCorrectTypeRule.d.ts.map +1 -0
  558. package/dist/types/validation/rules/FragmentsOnCompositeTypesRule.d.ts +13 -0
  559. package/dist/types/validation/rules/FragmentsOnCompositeTypesRule.d.ts.map +1 -0
  560. package/dist/types/validation/rules/KnownArgumentNamesRule.d.ts +12 -0
  561. package/dist/types/validation/rules/KnownArgumentNamesRule.d.ts.map +1 -0
  562. package/dist/types/validation/rules/KnownDirectivesRule.d.ts +12 -0
  563. package/dist/types/validation/rules/KnownDirectivesRule.d.ts.map +1 -0
  564. package/dist/types/validation/rules/KnownFragmentNamesRule.d.ts +12 -0
  565. package/dist/types/validation/rules/KnownFragmentNamesRule.d.ts.map +1 -0
  566. package/dist/types/validation/rules/KnownTypeNamesRule.d.ts +12 -0
  567. package/dist/types/validation/rules/KnownTypeNamesRule.d.ts.map +1 -0
  568. package/dist/types/validation/rules/LoneAnonymousOperationRule.d.ts +12 -0
  569. package/dist/types/validation/rules/LoneAnonymousOperationRule.d.ts.map +1 -0
  570. package/dist/types/validation/rules/MaxIntrospectionDepthRule.d.ts +12 -0
  571. package/dist/types/validation/rules/MaxIntrospectionDepthRule.d.ts.map +1 -0
  572. package/dist/types/validation/rules/NoFragmentCyclesRule.d.ts +13 -0
  573. package/dist/types/validation/rules/NoFragmentCyclesRule.d.ts.map +1 -0
  574. package/dist/types/validation/rules/NoUndefinedVariablesRule.d.ts +12 -0
  575. package/dist/types/validation/rules/NoUndefinedVariablesRule.d.ts.map +1 -0
  576. package/dist/types/validation/rules/NoUnusedFragmentsRule.d.ts +12 -0
  577. package/dist/types/validation/rules/NoUnusedFragmentsRule.d.ts.map +1 -0
  578. package/dist/types/validation/rules/NoUnusedVariablesRule.d.ts +12 -0
  579. package/dist/types/validation/rules/NoUnusedVariablesRule.d.ts.map +1 -0
  580. package/dist/types/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts +16 -0
  581. package/dist/types/validation/rules/OverlappingFieldsCanBeMergedRule.d.ts.map +1 -0
  582. package/dist/types/validation/rules/PossibleFragmentSpreadsRule.d.ts +13 -0
  583. package/dist/types/validation/rules/PossibleFragmentSpreadsRule.d.ts.map +1 -0
  584. package/dist/types/validation/rules/ProvidedRequiredArgumentsRule.d.ts +12 -0
  585. package/dist/types/validation/rules/ProvidedRequiredArgumentsRule.d.ts.map +1 -0
  586. package/dist/types/validation/rules/ScalarLeafsRule.d.ts +12 -0
  587. package/dist/types/validation/rules/ScalarLeafsRule.d.ts.map +1 -0
  588. package/dist/types/validation/rules/SingleFieldSubscriptionsRule.d.ts +12 -0
  589. package/dist/types/validation/rules/SingleFieldSubscriptionsRule.d.ts.map +1 -0
  590. package/dist/types/validation/rules/UniqueArgumentNamesRule.d.ts +12 -0
  591. package/dist/types/validation/rules/UniqueArgumentNamesRule.d.ts.map +1 -0
  592. package/dist/types/validation/rules/UniqueDirectivesPerLocationRule.d.ts +12 -0
  593. package/dist/types/validation/rules/UniqueDirectivesPerLocationRule.d.ts.map +1 -0
  594. package/dist/types/validation/rules/UniqueFragmentNamesRule.d.ts +11 -0
  595. package/dist/types/validation/rules/UniqueFragmentNamesRule.d.ts.map +1 -0
  596. package/dist/types/validation/rules/UniqueInputFieldNamesRule.d.ts +12 -0
  597. package/dist/types/validation/rules/UniqueInputFieldNamesRule.d.ts.map +1 -0
  598. package/dist/types/validation/rules/UniqueOperationNamesRule.d.ts +11 -0
  599. package/dist/types/validation/rules/UniqueOperationNamesRule.d.ts.map +1 -0
  600. package/dist/types/validation/rules/UniqueVariableNamesRule.d.ts +11 -0
  601. package/dist/types/validation/rules/UniqueVariableNamesRule.d.ts.map +1 -0
  602. package/dist/types/validation/rules/ValuesOfCorrectTypeRule.d.ts +12 -0
  603. package/dist/types/validation/rules/ValuesOfCorrectTypeRule.d.ts.map +1 -0
  604. package/dist/types/validation/rules/VariablesAreInputTypesRule.d.ts +12 -0
  605. package/dist/types/validation/rules/VariablesAreInputTypesRule.d.ts.map +1 -0
  606. package/dist/types/validation/rules/VariablesInAllowedPositionRule.d.ts +11 -0
  607. package/dist/types/validation/rules/VariablesInAllowedPositionRule.d.ts.map +1 -0
  608. package/dist/types/validation/sortValueNode.d.ts +10 -0
  609. package/dist/types/validation/sortValueNode.d.ts.map +1 -0
  610. package/dist/types/validation/specifiedRules.d.ts +42 -0
  611. package/dist/types/validation/specifiedRules.d.ts.map +1 -0
  612. package/dist/types/validation/typeFromAST.d.ts +6 -0
  613. package/dist/types/validation/typeFromAST.d.ts.map +1 -0
  614. package/dist/types/validation/validate.d.ts +46 -0
  615. package/dist/types/validation/validate.d.ts.map +1 -0
  616. package/package.json +39 -1
  617. package/src/execution/collectFields.ts +220 -0
  618. package/src/execution/complete.ts +528 -0
  619. package/src/execution/context.ts +124 -0
  620. package/src/execution/directives.ts +76 -0
  621. package/src/execution/execute.ts +204 -0
  622. package/src/execution/fields.ts +256 -0
  623. package/src/execution/introspectionResolvers.ts +120 -0
  624. package/src/execution/values.ts +478 -0
  625. package/src/index.ts +145 -0
  626. package/src/introspection/index.ts +40 -0
  627. package/src/introspection/resolvers.ts +591 -0
  628. package/src/introspection/types.ts +319 -0
  629. package/src/scalars/builtIn.ts +316 -0
  630. package/src/schema/buildSchema.ts +322 -0
  631. package/src/tsconfig.json +6 -0
  632. package/src/types/execution.ts +94 -0
  633. package/src/types/resolvers.ts +119 -0
  634. package/src/types/schema.ts +346 -0
  635. package/src/utils/enumValues.ts +64 -0
  636. package/src/utils/helpers.ts +200 -0
  637. package/src/utils/path.ts +33 -0
  638. package/src/utils/schemaInterner.ts +362 -0
  639. package/src/utils/toGraphQLJsSchema.ts +164 -0
  640. package/src/utils/typeRef.ts +309 -0
  641. package/src/validation/TypeInfo.ts +390 -0
  642. package/src/validation/ValidationContext.ts +239 -0
  643. package/src/validation/helpers.ts +341 -0
  644. package/src/validation/rules/ExecutableDefinitionsRule.ts +40 -0
  645. package/src/validation/rules/FieldsOnCorrectTypeRule.ts +127 -0
  646. package/src/validation/rules/FragmentsOnCompositeTypesRule.ts +49 -0
  647. package/src/validation/rules/KnownArgumentNamesRule.ts +82 -0
  648. package/src/validation/rules/KnownDirectivesRule.ts +119 -0
  649. package/src/validation/rules/KnownFragmentNamesRule.ts +26 -0
  650. package/src/validation/rules/KnownTypeNamesRule.ts +51 -0
  651. package/src/validation/rules/LoneAnonymousOperationRule.ts +34 -0
  652. package/src/validation/rules/MaxIntrospectionDepthRule.ts +83 -0
  653. package/src/validation/rules/NoFragmentCyclesRule.ts +98 -0
  654. package/src/validation/rules/NoUndefinedVariablesRule.ts +39 -0
  655. package/src/validation/rules/NoUnusedFragmentsRule.ts +49 -0
  656. package/src/validation/rules/NoUnusedVariablesRule.ts +49 -0
  657. package/src/validation/rules/OverlappingFieldsCanBeMergedRule.ts +512 -0
  658. package/src/validation/rules/PossibleFragmentSpreadsRule.ts +118 -0
  659. package/src/validation/rules/ProvidedRequiredArgumentsRule.ts +105 -0
  660. package/src/validation/rules/ScalarLeafsRule.ts +58 -0
  661. package/src/validation/rules/SingleFieldSubscriptionsRule.ts +64 -0
  662. package/src/validation/rules/UniqueArgumentNamesRule.ts +47 -0
  663. package/src/validation/rules/UniqueDirectivesPerLocationRule.ts +72 -0
  664. package/src/validation/rules/UniqueFragmentNamesRule.ts +36 -0
  665. package/src/validation/rules/UniqueInputFieldNamesRule.ts +46 -0
  666. package/src/validation/rules/UniqueOperationNamesRule.ts +38 -0
  667. package/src/validation/rules/UniqueVariableNamesRule.ts +36 -0
  668. package/src/validation/rules/ValuesOfCorrectTypeRule.ts +158 -0
  669. package/src/validation/rules/VariablesAreInputTypesRule.ts +39 -0
  670. package/src/validation/rules/VariablesInAllowedPositionRule.ts +96 -0
  671. package/src/validation/sortValueNode.ts +85 -0
  672. package/src/validation/specifiedRules.ts +126 -0
  673. package/src/validation/typeFromAST.ts +5 -0
  674. package/src/validation/validate.ts +112 -0
  675. package/tests/buildSchema.test.ts +398 -0
  676. package/tests/builtInScalars.test.ts +74 -0
  677. package/tests/coercion.test.ts +88 -0
  678. package/tests/compat/abstract.test.ts +717 -0
  679. package/tests/compat/adapter.ts +779 -0
  680. package/tests/compat/directives.test.ts +310 -0
  681. package/tests/compat/executor.test.ts +774 -0
  682. package/tests/compat/lists.test.ts +244 -0
  683. package/tests/compat/nonnull.test.ts +463 -0
  684. package/tests/compat/testUtils.ts +134 -0
  685. package/tests/completedResult.test.ts +125 -0
  686. package/tests/deprecatedInputValues.test.ts +39 -0
  687. package/tests/execute.test.ts +1945 -0
  688. package/tests/fieldErrors.test.ts +146 -0
  689. package/tests/getArgumentValues.test.ts +109 -0
  690. package/tests/inspect.test.ts +44 -0
  691. package/tests/introspection.test.ts +563 -0
  692. package/tests/introspectionOrder.test.ts +92 -0
  693. package/tests/memoization.test.ts +80 -0
  694. package/tests/operationSelection.test.ts +57 -0
  695. package/tests/prototypeNames.test.ts +176 -0
  696. package/tests/resolverLayers.test.ts +32 -0
  697. package/tests/scalarParsers.test.ts +111 -0
  698. package/tests/schemaInterner.test.ts +132 -0
  699. package/tests/tsconfig.json +9 -0
  700. package/tests/typedContext.test.ts +87 -0
  701. package/tests/validation/graphqlJsDifferential.test.ts +171 -0
  702. package/tests/validation/rules/MaxIntrospectionDepthRule.test.ts +557 -0
  703. package/tests/validation/rules/NoUnusedVariablesRule.test.ts +236 -0
  704. package/tests/validation/rules/OverlappingFieldsCanBeMergedRule.test.ts +1191 -0
  705. package/tests/validation/rules/SingleFieldSubscriptionsRule.test.ts +298 -0
  706. package/tests/validation/rules/differential.test.ts +264 -0
  707. package/tests/validation/rules/harness.ts +157 -0
  708. package/tests/validation/validate.test.ts +904 -0
  709. package/tsconfig.json +8 -0
  710. package/tsconfig.settings.json +3 -0
@@ -0,0 +1,319 @@
1
+ /**
2
+ * Introspection type definitions
3
+ *
4
+ * These types are added to the schema at execution time when introspection queries
5
+ * are detected (__schema or __type meta-fields).
6
+ */
7
+
8
+ import { type Directive, type Schema, type Type, TypeKind, TypePattern } from '../types/schema.js'
9
+
10
+ /**
11
+ * __TypeKind enum values as defined by the GraphQL spec
12
+ */
13
+ export const IntrospectionTypeKind = {
14
+ SCALAR: 'SCALAR',
15
+ OBJECT: 'OBJECT',
16
+ INTERFACE: 'INTERFACE',
17
+ UNION: 'UNION',
18
+ ENUM: 'ENUM',
19
+ INPUT_OBJECT: 'INPUT_OBJECT',
20
+ LIST: 'LIST',
21
+ NON_NULL: 'NON_NULL',
22
+ } as const
23
+
24
+ export type IntrospectionTypeKindValue = typeof IntrospectionTypeKind[keyof typeof IntrospectionTypeKind]
25
+
26
+ /**
27
+ * __DirectiveLocation enum values as defined by the GraphQL spec
28
+ */
29
+ export const DirectiveLocation = {
30
+ // Executable locations
31
+ QUERY: 'QUERY',
32
+ MUTATION: 'MUTATION',
33
+ SUBSCRIPTION: 'SUBSCRIPTION',
34
+ FIELD: 'FIELD',
35
+ FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',
36
+ FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',
37
+ INLINE_FRAGMENT: 'INLINE_FRAGMENT',
38
+ VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',
39
+ // Type system locations
40
+ SCHEMA: 'SCHEMA',
41
+ SCALAR: 'SCALAR',
42
+ OBJECT: 'OBJECT',
43
+ FIELD_DEFINITION: 'FIELD_DEFINITION',
44
+ ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',
45
+ INTERFACE: 'INTERFACE',
46
+ UNION: 'UNION',
47
+ ENUM: 'ENUM',
48
+ ENUM_VALUE: 'ENUM_VALUE',
49
+ INPUT_OBJECT: 'INPUT_OBJECT',
50
+ INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION',
51
+ } as const
52
+
53
+ export type DirectiveLocationValue = typeof DirectiveLocation[keyof typeof DirectiveLocation]
54
+
55
+ /**
56
+ * Introspection types in compact JSON format
57
+ *
58
+ * These are the 8 introspection types defined by the GraphQL specification:
59
+ * - __Schema
60
+ * - __Type
61
+ * - __Field
62
+ * - __InputValue
63
+ * - __EnumValue
64
+ * - __Directive
65
+ * - __TypeKind (enum)
66
+ * - __DirectiveLocation (enum)
67
+ */
68
+ export const introspectionTypes: Record<string, Type> = {
69
+ // __Schema type
70
+ __Schema: [
71
+ TypeKind.OBJECT,
72
+ {
73
+ description: [[TypePattern.T, 'String'], null],
74
+ types: [[TypePattern.L_NN_T_NN, '__Type'], null, 'A list of all types supported by this server.'],
75
+ queryType: [[TypePattern.T_NN, '__Type'], null, 'The type that query operations will be rooted at.'],
76
+ mutationType: [[TypePattern.T, '__Type'], null, 'If this server supports mutation, the type that mutation operations will be rooted at.'],
77
+ subscriptionType: [
78
+ [TypePattern.T, '__Type'],
79
+ null,
80
+ 'If this server support subscription, the type that subscription operations will be rooted at.',
81
+ ],
82
+ directives: [[TypePattern.L_NN_T_NN, '__Directive'], null, 'A list of all directives supported by this server.'],
83
+ },
84
+ [],
85
+ 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.',
86
+ ],
87
+
88
+ // __Type type
89
+ __Type: [
90
+ TypeKind.OBJECT,
91
+ {
92
+ kind: [[TypePattern.T_NN, '__TypeKind'], null],
93
+ name: [[TypePattern.T, 'String'], null],
94
+ description: [[TypePattern.T, 'String'], null],
95
+ specifiedByURL: [[TypePattern.T, 'String'], null],
96
+ fields: [
97
+ [TypePattern.L_T_NN, '__Field'],
98
+ { includeDeprecated: [[TypePattern.T, 'Boolean'], false] },
99
+ ],
100
+ interfaces: [[TypePattern.L_T_NN, '__Type'], null],
101
+ possibleTypes: [[TypePattern.L_T_NN, '__Type'], null],
102
+ enumValues: [
103
+ [TypePattern.L_T_NN, '__EnumValue'],
104
+ { includeDeprecated: [[TypePattern.T, 'Boolean'], false] },
105
+ ],
106
+ inputFields: [
107
+ [TypePattern.L_T_NN, '__InputValue'],
108
+ { includeDeprecated: [[TypePattern.T, 'Boolean'], false] },
109
+ ],
110
+ ofType: [[TypePattern.T, '__Type'], null],
111
+ isOneOf: [[TypePattern.T, 'Boolean'], null],
112
+ },
113
+ [],
114
+ 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.',
115
+ ],
116
+
117
+ // __Field type
118
+ __Field: [
119
+ TypeKind.OBJECT,
120
+ {
121
+ name: [[TypePattern.T_NN, 'String'], null],
122
+ description: [[TypePattern.T, 'String'], null],
123
+ args: [
124
+ [TypePattern.L_NN_T_NN, '__InputValue'],
125
+ { includeDeprecated: [[TypePattern.T, 'Boolean'], false] },
126
+ ],
127
+ type: [[TypePattern.T_NN, '__Type'], null],
128
+ isDeprecated: [[TypePattern.T_NN, 'Boolean'], null],
129
+ deprecationReason: [[TypePattern.T, 'String'], null],
130
+ },
131
+ [],
132
+ 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.',
133
+ ],
134
+
135
+ // __InputValue type
136
+ __InputValue: [
137
+ TypeKind.OBJECT,
138
+ {
139
+ name: [[TypePattern.T_NN, 'String'], null],
140
+ description: [[TypePattern.T, 'String'], null],
141
+ type: [[TypePattern.T_NN, '__Type'], null],
142
+ defaultValue: [[TypePattern.T, 'String'], null, 'A GraphQL-formatted string representing the default value for this input value.'],
143
+ isDeprecated: [[TypePattern.T_NN, 'Boolean'], null],
144
+ deprecationReason: [[TypePattern.T, 'String'], null],
145
+ },
146
+ [],
147
+ 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.',
148
+ ],
149
+
150
+ // __EnumValue type
151
+ __EnumValue: [
152
+ TypeKind.OBJECT,
153
+ {
154
+ name: [[TypePattern.T_NN, 'String'], null],
155
+ description: [[TypePattern.T, 'String'], null],
156
+ isDeprecated: [[TypePattern.T_NN, 'Boolean'], null],
157
+ deprecationReason: [[TypePattern.T, 'String'], null],
158
+ },
159
+ [],
160
+ 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.',
161
+ ],
162
+
163
+ // __Directive type
164
+ __Directive: [
165
+ TypeKind.OBJECT,
166
+ {
167
+ name: [[TypePattern.T_NN, 'String'], null],
168
+ description: [[TypePattern.T, 'String'], null],
169
+ isRepeatable: [[TypePattern.T_NN, 'Boolean'], null],
170
+ locations: [[TypePattern.L_NN_T_NN, '__DirectiveLocation'], null],
171
+ args: [
172
+ [TypePattern.L_NN_T_NN, '__InputValue'],
173
+ { includeDeprecated: [[TypePattern.T, 'Boolean'], false] },
174
+ ],
175
+ },
176
+ [],
177
+ "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",
178
+ ],
179
+
180
+ // __TypeKind enum
181
+ __TypeKind: [
182
+ TypeKind.ENUM,
183
+ {
184
+ SCALAR: [undefined, 'Indicates this type is a scalar.'],
185
+ OBJECT: [undefined, 'Indicates this type is an object. `fields` and `interfaces` are valid fields.'],
186
+ INTERFACE: [undefined, 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.'],
187
+ UNION: [undefined, 'Indicates this type is a union. `possibleTypes` is a valid field.'],
188
+ ENUM: [undefined, 'Indicates this type is an enum. `enumValues` is a valid field.'],
189
+ INPUT_OBJECT: [undefined, 'Indicates this type is an input object. `inputFields` is a valid field.'],
190
+ LIST: [undefined, 'Indicates this type is a list. `ofType` is a valid field.'],
191
+ NON_NULL: [undefined, 'Indicates this type is a non-null. `ofType` is a valid field.'],
192
+ },
193
+ 'An enum describing what kind of type a given `__Type` is.',
194
+ ],
195
+
196
+ // __DirectiveLocation enum
197
+ __DirectiveLocation: [
198
+ TypeKind.ENUM,
199
+ {
200
+ QUERY: [undefined, 'Location adjacent to a query operation.'],
201
+ MUTATION: [undefined, 'Location adjacent to a mutation operation.'],
202
+ SUBSCRIPTION: [undefined, 'Location adjacent to a subscription operation.'],
203
+ FIELD: [undefined, 'Location adjacent to a field.'],
204
+ FRAGMENT_DEFINITION: [undefined, 'Location adjacent to a fragment definition.'],
205
+ FRAGMENT_SPREAD: [undefined, 'Location adjacent to a fragment spread.'],
206
+ INLINE_FRAGMENT: [undefined, 'Location adjacent to an inline fragment.'],
207
+ VARIABLE_DEFINITION: [undefined, 'Location adjacent to a variable definition.'],
208
+ SCHEMA: [undefined, 'Location adjacent to a schema definition.'],
209
+ SCALAR: [undefined, 'Location adjacent to a scalar definition.'],
210
+ OBJECT: [undefined, 'Location adjacent to an object type definition.'],
211
+ FIELD_DEFINITION: [undefined, 'Location adjacent to a field definition.'],
212
+ ARGUMENT_DEFINITION: [undefined, 'Location adjacent to an argument definition.'],
213
+ INTERFACE: [undefined, 'Location adjacent to an interface definition.'],
214
+ UNION: [undefined, 'Location adjacent to a union definition.'],
215
+ ENUM: [undefined, 'Location adjacent to an enum definition.'],
216
+ ENUM_VALUE: [undefined, 'Location adjacent to an enum value definition.'],
217
+ INPUT_OBJECT: [undefined, 'Location adjacent to an input object type definition.'],
218
+ INPUT_FIELD_DEFINITION: [undefined, 'Location adjacent to an input object field definition.'],
219
+ },
220
+ 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.',
221
+ ],
222
+ }
223
+
224
+ /**
225
+ * The directives graphql-js specifies, in its `specifiedDirectives` order
226
+ */
227
+ export const builtInDirectives: Record<'include' | 'skip' | 'deprecated' | 'specifiedBy' | 'oneOf', Directive> = {
228
+ include: [
229
+ { if: [[TypePattern.T_NN, 'Boolean'], undefined, 'Included when true.'] },
230
+ ['FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT'],
231
+ false,
232
+ 'Directs the executor to include this field or fragment only when the `if` argument is true.',
233
+ ],
234
+ skip: [
235
+ { if: [[TypePattern.T_NN, 'Boolean'], undefined, 'Skipped when true.'] },
236
+ ['FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT'],
237
+ false,
238
+ 'Directs the executor to skip this field or fragment when the `if` argument is true.',
239
+ ],
240
+ deprecated: [
241
+ {
242
+ reason: [
243
+ [TypePattern.T, 'String'],
244
+ 'No longer supported',
245
+ 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).',
246
+ ],
247
+ },
248
+ ['FIELD_DEFINITION', 'ARGUMENT_DEFINITION', 'INPUT_FIELD_DEFINITION', 'ENUM_VALUE'],
249
+ false,
250
+ 'Marks an element of a GraphQL schema as no longer supported.',
251
+ ],
252
+ specifiedBy: [
253
+ { url: [[TypePattern.T_NN, 'String'], undefined, 'The URL that specifies the behavior of this scalar.'] },
254
+ ['SCALAR'],
255
+ false,
256
+ 'Exposes a URL that specifies the behavior of this scalar.',
257
+ ],
258
+ oneOf: [
259
+ {},
260
+ ['INPUT_OBJECT'],
261
+ false,
262
+ 'Indicates exactly one field must be supplied and this field must not be `null`.',
263
+ ],
264
+ }
265
+
266
+ const schemaDirectivesCache = new WeakMap<Schema, Record<string, Directive>>()
267
+
268
+ /**
269
+ * The directives of a schema in graphql-js order: those the schema defines, then the specified ones it does not redefine.
270
+ * Memoized per `schema` object.
271
+ */
272
+ export function getSchemaDirectives(schema: Schema): Record<string, Directive> {
273
+ const schemaDirectives = schema.d
274
+ if (!schemaDirectives) {
275
+ return builtInDirectives
276
+ }
277
+ let directives = schemaDirectivesCache.get(schema)
278
+ if (!directives) {
279
+ directives = { ...schemaDirectives }
280
+ for (const [name, directive] of Object.entries(builtInDirectives)) {
281
+ if (!Object.prototype.hasOwnProperty.call(schemaDirectives, name)) {
282
+ directives[name] = directive
283
+ }
284
+ }
285
+ schemaDirectivesCache.set(schema, directives)
286
+ }
287
+ return directives
288
+ }
289
+
290
+ /**
291
+ * Check if a type name is an introspection type
292
+ */
293
+ export function isIntrospectionType(typeName: string): boolean {
294
+ return typeName.startsWith('__')
295
+ }
296
+
297
+ const schemaWithIntrospectionCache = new WeakMap<Schema, Schema>()
298
+
299
+ const includesIntrospectionTypes = (schema: Schema): boolean => Object.entries(introspectionTypes).every(([name, type]) => schema.t[name] === type)
300
+
301
+ /**
302
+ * Get the schema with introspection types merged in, memoized per `schema` object - validation and execution call it per request.
303
+ * A schema that already holds them is returned as is, so it needs no per-schema copy of its type map.
304
+ * The schema is treated as immutable once passed in.
305
+ */
306
+ export function getSchemaWithIntrospection(schema: Schema): Schema {
307
+ let merged = schemaWithIntrospectionCache.get(schema)
308
+ if (!merged) {
309
+ merged = includesIntrospectionTypes(schema) ? schema : {
310
+ ...schema,
311
+ t: {
312
+ ...schema.t,
313
+ ...introspectionTypes,
314
+ },
315
+ }
316
+ schemaWithIntrospectionCache.set(schema, merged)
317
+ }
318
+ return merged
319
+ }
@@ -0,0 +1,316 @@
1
+ /**
2
+ * Built-in scalar implementations
3
+ */
4
+
5
+ import { GraphQLError, Kind, print } from 'graphql'
6
+ import type { ValueNode } from 'graphql'
7
+ import type { ScalarImplementation, ScalarMap } from '../types/resolvers.js'
8
+ import { type ScalarType, TypeKind } from '../types/schema.js'
9
+ import { inspect, isObjectLike } from '../utils/helpers.js'
10
+
11
+ // GraphQL Int limits (32-bit signed integer)
12
+ const GRAPHQL_MAX_INT = 2147483647
13
+ const GRAPHQL_MIN_INT = -2147483648
14
+
15
+ /**
16
+ * Serialize object value (handles valueOf)
17
+ */
18
+ function serializeObject(outputValue: unknown): unknown {
19
+ if (isObjectLike(outputValue)) {
20
+ const valueOf = outputValue.valueOf
21
+ if (typeof valueOf === 'function') {
22
+ const valueOfResult: unknown = valueOf.call(outputValue)
23
+ if (!isObjectLike(valueOfResult)) {
24
+ return valueOfResult
25
+ }
26
+ }
27
+ const toJSON = outputValue.toJSON
28
+ if (typeof toJSON === 'function') {
29
+ return toJSON.call(outputValue)
30
+ }
31
+ }
32
+ return outputValue
33
+ }
34
+
35
+ /**
36
+ * Int scalar
37
+ */
38
+ export const GraphQLIntScalar: ScalarImplementation = {
39
+ serialize(outputValue: unknown): number {
40
+ const coercedValue = serializeObject(outputValue)
41
+
42
+ if (typeof coercedValue === 'boolean') {
43
+ return coercedValue ? 1 : 0
44
+ }
45
+
46
+ let num = coercedValue
47
+ if (typeof coercedValue === 'string' && coercedValue !== '') {
48
+ num = Number(coercedValue)
49
+ }
50
+
51
+ if (typeof num !== 'number' || !Number.isInteger(num)) {
52
+ throw new GraphQLError(
53
+ `Int cannot represent non-integer value: ${inspect(coercedValue)}`,
54
+ )
55
+ }
56
+ if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {
57
+ throw new GraphQLError(
58
+ 'Int cannot represent non 32-bit signed integer value: ' + inspect(coercedValue),
59
+ )
60
+ }
61
+ return num
62
+ },
63
+
64
+ parseValue(inputValue: unknown): number {
65
+ if (typeof inputValue !== 'number' || !Number.isInteger(inputValue)) {
66
+ throw new GraphQLError(
67
+ `Int cannot represent non-integer value: ${inspect(inputValue)}`,
68
+ )
69
+ }
70
+ if (inputValue > GRAPHQL_MAX_INT || inputValue < GRAPHQL_MIN_INT) {
71
+ throw new GraphQLError(
72
+ `Int cannot represent non 32-bit signed integer value: ${inputValue}`,
73
+ )
74
+ }
75
+ return inputValue
76
+ },
77
+
78
+ parseLiteral(valueNode: ValueNode): number {
79
+ if (valueNode.kind !== Kind.INT) {
80
+ throw new GraphQLError(
81
+ `Int cannot represent non-integer value: ${print(valueNode)}`,
82
+ { nodes: valueNode },
83
+ )
84
+ }
85
+ const num = parseInt(valueNode.value, 10)
86
+ if (num > GRAPHQL_MAX_INT || num < GRAPHQL_MIN_INT) {
87
+ throw new GraphQLError(
88
+ `Int cannot represent non 32-bit signed integer value: ${valueNode.value}`,
89
+ { nodes: valueNode },
90
+ )
91
+ }
92
+ return num
93
+ },
94
+ }
95
+
96
+ /**
97
+ * Float scalar
98
+ */
99
+ export const GraphQLFloatScalar: ScalarImplementation = {
100
+ serialize(outputValue: unknown): number {
101
+ const coercedValue = serializeObject(outputValue)
102
+
103
+ if (typeof coercedValue === 'boolean') {
104
+ return coercedValue ? 1 : 0
105
+ }
106
+
107
+ let num = coercedValue
108
+ if (typeof coercedValue === 'string' && coercedValue !== '') {
109
+ num = Number(coercedValue)
110
+ }
111
+
112
+ if (typeof num !== 'number' || !Number.isFinite(num)) {
113
+ throw new GraphQLError(
114
+ `Float cannot represent non numeric value: ${inspect(coercedValue)}`,
115
+ )
116
+ }
117
+ return num
118
+ },
119
+
120
+ parseValue(inputValue: unknown): number {
121
+ if (typeof inputValue !== 'number' || !Number.isFinite(inputValue)) {
122
+ throw new GraphQLError(
123
+ `Float cannot represent non numeric value: ${inspect(inputValue)}`,
124
+ )
125
+ }
126
+ return inputValue
127
+ },
128
+
129
+ parseLiteral(valueNode: ValueNode): number {
130
+ if (valueNode.kind !== Kind.FLOAT && valueNode.kind !== Kind.INT) {
131
+ throw new GraphQLError(
132
+ `Float cannot represent non numeric value: ${print(valueNode)}`,
133
+ { nodes: valueNode },
134
+ )
135
+ }
136
+ return parseFloat(valueNode.value)
137
+ },
138
+ }
139
+
140
+ /**
141
+ * String scalar
142
+ */
143
+ export const GraphQLStringScalar: ScalarImplementation = {
144
+ serialize(outputValue: unknown): string {
145
+ const coercedValue = serializeObject(outputValue)
146
+
147
+ if (typeof coercedValue === 'string') {
148
+ return coercedValue
149
+ }
150
+ if (typeof coercedValue === 'boolean') {
151
+ return coercedValue ? 'true' : 'false'
152
+ }
153
+ if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) {
154
+ return String(coercedValue)
155
+ }
156
+ throw new GraphQLError(
157
+ `String cannot represent value: ${inspect(outputValue)}`,
158
+ )
159
+ },
160
+
161
+ parseValue(inputValue: unknown): string {
162
+ if (typeof inputValue !== 'string') {
163
+ throw new GraphQLError(
164
+ `String cannot represent a non string value: ${inspect(inputValue)}`,
165
+ )
166
+ }
167
+ return inputValue
168
+ },
169
+
170
+ parseLiteral(valueNode: ValueNode): string {
171
+ if (valueNode.kind !== Kind.STRING) {
172
+ throw new GraphQLError(
173
+ `String cannot represent a non string value: ${print(valueNode)}`,
174
+ { nodes: valueNode },
175
+ )
176
+ }
177
+ return valueNode.value
178
+ },
179
+ }
180
+
181
+ /**
182
+ * Boolean scalar
183
+ */
184
+ export const GraphQLBooleanScalar: ScalarImplementation = {
185
+ serialize(outputValue: unknown): boolean {
186
+ const coercedValue = serializeObject(outputValue)
187
+
188
+ if (typeof coercedValue === 'boolean') {
189
+ return coercedValue
190
+ }
191
+ if (typeof coercedValue === 'number' && Number.isFinite(coercedValue)) {
192
+ return coercedValue !== 0
193
+ }
194
+ throw new GraphQLError(
195
+ `Boolean cannot represent a non boolean value: ${inspect(coercedValue)}`,
196
+ )
197
+ },
198
+
199
+ parseValue(inputValue: unknown): boolean {
200
+ if (typeof inputValue !== 'boolean') {
201
+ throw new GraphQLError(
202
+ `Boolean cannot represent a non boolean value: ${inspect(inputValue)}`,
203
+ )
204
+ }
205
+ return inputValue
206
+ },
207
+
208
+ parseLiteral(valueNode: ValueNode): boolean {
209
+ if (valueNode.kind !== Kind.BOOLEAN) {
210
+ throw new GraphQLError(
211
+ `Boolean cannot represent a non boolean value: ${print(valueNode)}`,
212
+ { nodes: valueNode },
213
+ )
214
+ }
215
+ return valueNode.value
216
+ },
217
+ }
218
+
219
+ /**
220
+ * ID scalar
221
+ */
222
+ export const GraphQLIDScalar: ScalarImplementation = {
223
+ serialize(outputValue: unknown): string {
224
+ const coercedValue = serializeObject(outputValue)
225
+
226
+ if (typeof coercedValue === 'string') {
227
+ return coercedValue
228
+ }
229
+ if (typeof coercedValue === 'number' && Number.isInteger(coercedValue)) {
230
+ return String(coercedValue)
231
+ }
232
+ throw new GraphQLError(
233
+ `ID cannot represent value: ${inspect(outputValue)}`,
234
+ )
235
+ },
236
+
237
+ parseValue(inputValue: unknown): string {
238
+ if (typeof inputValue === 'string') {
239
+ return inputValue
240
+ }
241
+ if (typeof inputValue === 'number' && Number.isInteger(inputValue)) {
242
+ return String(inputValue)
243
+ }
244
+ throw new GraphQLError(
245
+ `ID cannot represent value: ${inspect(inputValue)}`,
246
+ )
247
+ },
248
+
249
+ parseLiteral(valueNode: ValueNode): string {
250
+ if (valueNode.kind !== Kind.STRING && valueNode.kind !== Kind.INT) {
251
+ throw new GraphQLError(
252
+ `ID cannot represent a non-string and non-integer value: ${print(valueNode)}`,
253
+ { nodes: valueNode },
254
+ )
255
+ }
256
+ return valueNode.value
257
+ },
258
+ }
259
+
260
+ /**
261
+ * The scalar types graphql-js specifies, with their graphql-js descriptions, in its `specifiedScalarTypes` order
262
+ */
263
+ export const specifiedScalarTypes: Record<'String' | 'Int' | 'Float' | 'Boolean' | 'ID', ScalarType> = {
264
+ String: [
265
+ TypeKind.SCALAR,
266
+ 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.',
267
+ ],
268
+ Int: [
269
+ TypeKind.SCALAR,
270
+ 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.',
271
+ ],
272
+ Float: [
273
+ TypeKind.SCALAR,
274
+ 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).',
275
+ ],
276
+ Boolean: [TypeKind.SCALAR, 'The `Boolean` scalar type represents `true` or `false`.'],
277
+ ID: [
278
+ TypeKind.SCALAR,
279
+ 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',
280
+ ],
281
+ }
282
+
283
+ /**
284
+ * Whether the name is one of the scalars graphql-js specifies
285
+ */
286
+ export function isSpecifiedScalarTypeName(name: string): name is keyof typeof specifiedScalarTypes {
287
+ return Object.prototype.hasOwnProperty.call(specifiedScalarTypes, name)
288
+ }
289
+
290
+ /**
291
+ * Built-in scalar map
292
+ */
293
+ export const builtInScalars: ScalarMap = {
294
+ Int: GraphQLIntScalar,
295
+ Float: GraphQLFloatScalar,
296
+ String: GraphQLStringScalar,
297
+ Boolean: GraphQLBooleanScalar,
298
+ ID: GraphQLIDScalar,
299
+ }
300
+
301
+ const scalarsWithBuiltInsCache = new WeakMap<ScalarMap, ScalarMap>()
302
+
303
+ /**
304
+ * Built-in scalars overridden by the given custom scalars, memoized per `scalars` object.
305
+ */
306
+ export function withBuiltInScalars(scalars?: ScalarMap): ScalarMap {
307
+ if (!scalars) {
308
+ return builtInScalars
309
+ }
310
+ let merged = scalarsWithBuiltInsCache.get(scalars)
311
+ if (!merged) {
312
+ merged = { ...builtInScalars, ...scalars }
313
+ scalarsWithBuiltInsCache.set(scalars, merged)
314
+ }
315
+ return merged
316
+ }