polen 0.11.0-next.24 → 0.11.0-next.26

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 (375) hide show
  1. package/build/api/config/input.d.ts +259 -77
  2. package/build/api/config/input.d.ts.map +1 -1
  3. package/build/api/config/input.js +2 -0
  4. package/build/api/config/input.js.map +1 -1
  5. package/build/api/config/normalized.d.ts +433 -143
  6. package/build/api/config/normalized.d.ts.map +1 -1
  7. package/build/api/config/normalized.js +47 -0
  8. package/build/api/config/normalized.js.map +1 -1
  9. package/build/api/config-template/template.d.ts +191 -121
  10. package/build/api/config-template/template.d.ts.map +1 -1
  11. package/build/api/config-template/template.js +18 -1
  12. package/build/api/config-template/template.js.map +1 -1
  13. package/build/api/examples/diagnostic/diagnostic.d.ts +0 -23
  14. package/build/api/examples/diagnostic/diagnostic.d.ts.map +1 -1
  15. package/build/api/examples/diagnostic/diagnostic.js +1 -3
  16. package/build/api/examples/diagnostic/diagnostic.js.map +1 -1
  17. package/build/api/examples/scanner.d.ts +27 -1
  18. package/build/api/examples/scanner.d.ts.map +1 -1
  19. package/build/api/examples/scanner.js +30 -17
  20. package/build/api/examples/scanner.js.map +1 -1
  21. package/build/api/examples/schemas/catalog.d.ts +56 -12
  22. package/build/api/examples/schemas/catalog.d.ts.map +1 -1
  23. package/build/api/examples/schemas/example/example.d.ts +54 -11
  24. package/build/api/examples/schemas/example/example.d.ts.map +1 -1
  25. package/build/api/examples/schemas/example/example.js +5 -0
  26. package/build/api/examples/schemas/example/example.js.map +1 -1
  27. package/build/api/reference/$.d.ts +4 -0
  28. package/build/api/reference/$.d.ts.map +1 -0
  29. package/build/api/reference/$.js +4 -0
  30. package/build/api/reference/$.js.map +1 -0
  31. package/build/api/reference/catalog.d.ts +69 -0
  32. package/build/api/reference/catalog.d.ts.map +1 -0
  33. package/build/api/reference/catalog.js +44 -0
  34. package/build/api/reference/catalog.js.map +1 -0
  35. package/build/api/reference/config.d.ts +616 -0
  36. package/build/api/reference/config.d.ts.map +1 -0
  37. package/build/api/reference/config.js +162 -0
  38. package/build/api/reference/config.js.map +1 -0
  39. package/build/api/reference/scanner.d.ts +26 -0
  40. package/build/api/reference/scanner.d.ts.map +1 -0
  41. package/build/api/reference/scanner.js +27 -0
  42. package/build/api/reference/scanner.js.map +1 -0
  43. package/build/api/schema/augmentations/$$.d.ts +7 -0
  44. package/build/api/schema/augmentations/$$.d.ts.map +1 -0
  45. package/build/api/schema/augmentations/$$.js +7 -0
  46. package/build/api/schema/augmentations/$$.js.map +1 -0
  47. package/build/api/schema/augmentations/$.d.ts +1 -1
  48. package/build/api/schema/augmentations/$.d.ts.map +1 -1
  49. package/build/api/schema/augmentations/$.js +1 -1
  50. package/build/api/schema/augmentations/$.js.map +1 -1
  51. package/build/api/schema/augmentations/apply.d.ts +29 -0
  52. package/build/api/schema/augmentations/apply.d.ts.map +1 -0
  53. package/build/api/schema/augmentations/apply.js +181 -0
  54. package/build/api/schema/augmentations/apply.js.map +1 -0
  55. package/build/api/schema/augmentations/augmentation.d.ts +31 -0
  56. package/build/api/schema/augmentations/augmentation.d.ts.map +1 -0
  57. package/build/api/schema/augmentations/augmentation.js +22 -0
  58. package/build/api/schema/augmentations/augmentation.js.map +1 -0
  59. package/build/api/schema/augmentations/config.d.ts +24 -0
  60. package/build/api/schema/augmentations/config.d.ts.map +1 -0
  61. package/build/api/schema/augmentations/config.js +9 -0
  62. package/build/api/schema/augmentations/config.js.map +1 -0
  63. package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts +67 -0
  64. package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts.map +1 -0
  65. package/build/api/schema/augmentations/diagnostics/diagnostic.js +13 -0
  66. package/build/api/schema/augmentations/diagnostics/diagnostic.js.map +1 -0
  67. package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts +45 -0
  68. package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts.map +1 -0
  69. package/build/api/schema/augmentations/diagnostics/duplicate-version.js +17 -0
  70. package/build/api/schema/augmentations/diagnostics/duplicate-version.js.map +1 -0
  71. package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts +46 -0
  72. package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts.map +1 -0
  73. package/build/api/schema/augmentations/diagnostics/invalid-path.js +18 -0
  74. package/build/api/schema/augmentations/diagnostics/invalid-path.js.map +1 -0
  75. package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts +46 -0
  76. package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts.map +1 -0
  77. package/build/api/schema/augmentations/diagnostics/version-mismatch.js +18 -0
  78. package/build/api/schema/augmentations/diagnostics/version-mismatch.js.map +1 -0
  79. package/build/api/schema/augmentations/input.d.ts +145 -0
  80. package/build/api/schema/augmentations/input.d.ts.map +1 -0
  81. package/build/api/schema/augmentations/input.js +191 -0
  82. package/build/api/schema/augmentations/input.js.map +1 -0
  83. package/build/api/schema/augmentations/placement.d.ts +8 -0
  84. package/build/api/schema/augmentations/placement.d.ts.map +1 -0
  85. package/build/api/schema/augmentations/placement.js +7 -0
  86. package/build/api/schema/augmentations/placement.js.map +1 -0
  87. package/build/api/schema/config-schema.d.ts +66 -66
  88. package/build/api/schema/config-schema.d.ts.map +1 -1
  89. package/build/api/schema/config-schema.js +2 -2
  90. package/build/api/schema/config-schema.js.map +1 -1
  91. package/build/api/schema/input-source/load.d.ts +2 -0
  92. package/build/api/schema/input-source/load.d.ts.map +1 -1
  93. package/build/api/schema/input-source/load.js.map +1 -1
  94. package/build/api/schema/input-sources/directory.d.ts +39 -39
  95. package/build/api/schema/input-sources/file.d.ts +39 -39
  96. package/build/api/schema/input-sources/introspection-file.d.ts +39 -39
  97. package/build/api/schema/input-sources/introspection.d.ts +39 -39
  98. package/build/api/schema/input-sources/memory.d.ts +39 -39
  99. package/build/api/schema/input-sources/versioned-directory.d.ts +79 -79
  100. package/build/api/schema/load.d.ts.map +1 -1
  101. package/build/api/schema/load.js +9 -2
  102. package/build/api/schema/load.js.map +1 -1
  103. package/build/lib/catalog/catalog.d.ts +1181 -1181
  104. package/build/lib/catalog/unversioned.d.ts +312 -312
  105. package/build/lib/catalog/versioned.d.ts +634 -634
  106. package/build/lib/change/change.d.ts +238 -238
  107. package/build/lib/document/document.d.ts +14 -8
  108. package/build/lib/document/document.d.ts.map +1 -1
  109. package/build/lib/document/versioned.d.ts +17 -10
  110. package/build/lib/document/versioned.d.ts.map +1 -1
  111. package/build/lib/grafaid/schema/KindMap/_.d.ts +1 -1
  112. package/build/lib/grafaid/schema/format-default-value.d.ts +11 -0
  113. package/build/lib/grafaid/schema/format-default-value.d.ts.map +1 -0
  114. package/build/lib/grafaid/schema/format-default-value.js +20 -0
  115. package/build/lib/grafaid/schema/format-default-value.js.map +1 -0
  116. package/build/lib/grafaid/schema/schema.d.ts +1 -0
  117. package/build/lib/grafaid/schema/schema.d.ts.map +1 -1
  118. package/build/lib/grafaid/schema/schema.js +1 -0
  119. package/build/lib/grafaid/schema/schema.js.map +1 -1
  120. package/build/lib/graphql-path/$$.d.ts +7 -13
  121. package/build/lib/graphql-path/$$.d.ts.map +1 -1
  122. package/build/lib/graphql-path/$$.js +7 -13
  123. package/build/lib/graphql-path/$$.js.map +1 -1
  124. package/build/lib/graphql-path/definition.d.ts +104 -94
  125. package/build/lib/graphql-path/definition.d.ts.map +1 -1
  126. package/build/lib/graphql-path/definition.js +126 -125
  127. package/build/lib/graphql-path/definition.js.map +1 -1
  128. package/build/lib/graphql-path/query.d.ts +25 -57
  129. package/build/lib/graphql-path/query.d.ts.map +1 -1
  130. package/build/lib/graphql-path/query.js +15 -93
  131. package/build/lib/graphql-path/query.js.map +1 -1
  132. package/build/lib/graphql-path/schema.d.ts +49 -0
  133. package/build/lib/graphql-path/schema.d.ts.map +1 -0
  134. package/build/lib/graphql-path/schema.js +89 -0
  135. package/build/lib/graphql-path/schema.js.map +1 -0
  136. package/build/lib/graphql-path/types.d.ts +76 -28
  137. package/build/lib/graphql-path/types.d.ts.map +1 -1
  138. package/build/lib/graphql-path/types.js +101 -2
  139. package/build/lib/graphql-path/types.js.map +1 -1
  140. package/build/lib/revision/revision.d.ts +1170 -1170
  141. package/build/lib/schema/schema.d.ts +708 -708
  142. package/build/lib/schema/unversioned.d.ts +1092 -1092
  143. package/build/lib/schema/versioned.d.ts +634 -634
  144. package/build/lib/semver/official-release.d.ts +10 -10
  145. package/build/lib/semver/pre-release.d.ts +10 -10
  146. package/build/lib/semver/semver.d.ts +50 -50
  147. package/build/lib/version-coverage/version-coverage.d.ts +43 -11
  148. package/build/lib/version-coverage/version-coverage.d.ts.map +1 -1
  149. package/build/lib/version-coverage/version-coverage.js +40 -6
  150. package/build/lib/version-coverage/version-coverage.js.map +1 -1
  151. package/build/template/components/ArgumentAnnotation.d.ts +2 -1
  152. package/build/template/components/ArgumentAnnotation.d.ts.map +1 -1
  153. package/build/template/components/ArgumentAnnotation.js +14 -4
  154. package/build/template/components/ArgumentAnnotation.js.map +1 -1
  155. package/build/template/components/ArgumentListAnnotation.d.ts +1 -0
  156. package/build/template/components/ArgumentListAnnotation.d.ts.map +1 -1
  157. package/build/template/components/ArgumentListAnnotation.js +21 -8
  158. package/build/template/components/ArgumentListAnnotation.js.map +1 -1
  159. package/build/template/components/Changelog/groups/FieldArgument.d.ts.map +1 -1
  160. package/build/template/components/Changelog/groups/FieldArgument.js +0 -1
  161. package/build/template/components/Changelog/groups/FieldArgument.js.map +1 -1
  162. package/build/template/components/CodeBlock.d.ts.map +1 -1
  163. package/build/template/components/CodeBlock.js +1 -1
  164. package/build/template/components/CodeBlock.js.map +1 -1
  165. package/build/template/components/Description.js +1 -1
  166. package/build/template/components/Description.js.map +1 -1
  167. package/build/template/components/ExampleLink.d.ts.map +1 -1
  168. package/build/template/components/ExampleLink.js +2 -1
  169. package/build/template/components/ExampleLink.js.map +1 -1
  170. package/build/template/components/Field.d.ts +2 -0
  171. package/build/template/components/Field.d.ts.map +1 -1
  172. package/build/template/components/Field.js +42 -4
  173. package/build/template/components/Field.js.map +1 -1
  174. package/build/template/components/FieldList.d.ts +2 -1
  175. package/build/template/components/FieldList.d.ts.map +1 -1
  176. package/build/template/components/FieldList.js +14 -3
  177. package/build/template/components/FieldList.js.map +1 -1
  178. package/build/template/components/FieldListSection.d.ts.map +1 -1
  179. package/build/template/components/FieldListSection.js +6 -1
  180. package/build/template/components/FieldListSection.js.map +1 -1
  181. package/build/template/components/GraphQLDocument.d.ts.map +1 -1
  182. package/build/template/components/GraphQLDocument.js +2 -1
  183. package/build/template/components/GraphQLDocument.js.map +1 -1
  184. package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts +2 -0
  185. package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts.map +1 -1
  186. package/build/template/components/GraphQLInteractive/GraphQLInteractive.js +4 -3
  187. package/build/template/components/GraphQLInteractive/GraphQLInteractive.js.map +1 -1
  188. package/build/template/components/GraphQLInteractive/lib/parser.d.ts +2 -2
  189. package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
  190. package/build/template/components/GraphQLInteractive/lib/parser.js +17 -12
  191. package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
  192. package/build/template/components/IAPIndicator.d.ts +12 -0
  193. package/build/template/components/IAPIndicator.d.ts.map +1 -0
  194. package/build/template/components/IAPIndicator.js +21 -0
  195. package/build/template/components/IAPIndicator.js.map +1 -0
  196. package/build/template/components/Link.d.ts +1 -2
  197. package/build/template/components/Link.d.ts.map +1 -1
  198. package/build/template/components/Link.js +5 -2
  199. package/build/template/components/Link.js.map +1 -1
  200. package/build/template/components/NamedType.d.ts.map +1 -1
  201. package/build/template/components/NamedType.js +9 -5
  202. package/build/template/components/NamedType.js.map +1 -1
  203. package/build/template/components/ReferenceLink.d.ts +2 -2
  204. package/build/template/components/ReferenceLink.d.ts.map +1 -1
  205. package/build/template/components/ReferenceLink.js +5 -3
  206. package/build/template/components/ReferenceLink.js.map +1 -1
  207. package/build/template/components/TypeAnnotation.d.ts +2 -0
  208. package/build/template/components/TypeAnnotation.d.ts.map +1 -1
  209. package/build/template/components/TypeAnnotation.js +4 -4
  210. package/build/template/components/TypeAnnotation.js.map +1 -1
  211. package/build/template/components/ViewModeToggle.d.ts +3 -0
  212. package/build/template/components/ViewModeToggle.d.ts.map +1 -0
  213. package/build/template/components/ViewModeToggle.js +9 -0
  214. package/build/template/components/ViewModeToggle.js.map +1 -0
  215. package/build/template/components/graphql/type-link.d.ts +2 -0
  216. package/build/template/components/graphql/type-link.d.ts.map +1 -1
  217. package/build/template/components/graphql/type-link.js +15 -3
  218. package/build/template/components/graphql/type-link.js.map +1 -1
  219. package/build/template/components/home/PlaygroundPreview.d.ts.map +1 -1
  220. package/build/template/components/home/PlaygroundPreview.js +3 -2
  221. package/build/template/components/home/PlaygroundPreview.js.map +1 -1
  222. package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
  223. package/build/template/components/sidebar/SidebarItem.js +18 -5
  224. package/build/template/components/sidebar/SidebarItem.js.map +1 -1
  225. package/build/template/contexts/ReferenceConfigContext.d.ts +16 -0
  226. package/build/template/contexts/ReferenceConfigContext.d.ts.map +1 -0
  227. package/build/template/contexts/ReferenceConfigContext.js +14 -0
  228. package/build/template/contexts/ReferenceConfigContext.js.map +1 -0
  229. package/build/template/contexts/ViewModeContext.d.ts +14 -0
  230. package/build/template/contexts/ViewModeContext.d.ts.map +1 -0
  231. package/build/template/contexts/ViewModeContext.js +40 -0
  232. package/build/template/contexts/ViewModeContext.js.map +1 -0
  233. package/build/template/hooks/use-examples.d.ts +4 -1
  234. package/build/template/hooks/use-examples.d.ts.map +1 -1
  235. package/build/template/hooks/useAlignedColumns.d.ts +10 -0
  236. package/build/template/hooks/useAlignedColumns.d.ts.map +1 -0
  237. package/build/template/hooks/useAlignedColumns.js +17 -0
  238. package/build/template/hooks/useAlignedColumns.js.map +1 -0
  239. package/build/template/routes/changelog/ChangelogSidebar.d.ts +2 -2
  240. package/build/template/routes/changelog/ChangelogSidebar.d.ts.map +1 -1
  241. package/build/template/routes/changelog/ChangelogSidebar.js +4 -4
  242. package/build/template/routes/changelog/ChangelogSidebar.js.map +1 -1
  243. package/build/template/routes/examples/_.d.ts +12 -3
  244. package/build/template/routes/examples/_.d.ts.map +1 -1
  245. package/build/template/routes/examples/_index.d.ts +8 -2
  246. package/build/template/routes/examples/_index.d.ts.map +1 -1
  247. package/build/template/routes/examples/name.d.ts +12 -3
  248. package/build/template/routes/examples/name.d.ts.map +1 -1
  249. package/build/template/routes/examples/name.js +6 -2
  250. package/build/template/routes/examples/name.js.map +1 -1
  251. package/build/template/routes/reference.d.ts.map +1 -1
  252. package/build/template/routes/reference.js +37 -10
  253. package/build/template/routes/reference.js.map +1 -1
  254. package/build/template/stores/changelog.d.ts +39 -39
  255. package/build/vite/plugins/core.d.ts.map +1 -1
  256. package/build/vite/plugins/core.js +6 -0
  257. package/build/vite/plugins/core.js.map +1 -1
  258. package/build/vite/plugins/examples.d.ts.map +1 -1
  259. package/build/vite/plugins/examples.js +10 -3
  260. package/build/vite/plugins/examples.js.map +1 -1
  261. package/build/vite/plugins/index.d.ts +1 -0
  262. package/build/vite/plugins/index.d.ts.map +1 -1
  263. package/build/vite/plugins/index.js +1 -0
  264. package/build/vite/plugins/index.js.map +1 -1
  265. package/build/vite/plugins/navbar.d.ts.map +1 -1
  266. package/build/vite/plugins/navbar.js +3 -1
  267. package/build/vite/plugins/navbar.js.map +1 -1
  268. package/build/vite/plugins/reference.d.ts +19 -0
  269. package/build/vite/plugins/reference.d.ts.map +1 -0
  270. package/build/vite/plugins/reference.js +96 -0
  271. package/build/vite/plugins/reference.js.map +1 -0
  272. package/build/vite/plugins/schemas.d.ts.map +1 -1
  273. package/build/vite/plugins/schemas.js +38 -2
  274. package/build/vite/plugins/schemas.js.map +1 -1
  275. package/package.json +1 -1
  276. package/src/api/config/input.ts +2 -0
  277. package/src/api/config/normalized.ts +54 -0
  278. package/src/api/config-template/template.ts +18 -1
  279. package/src/api/examples/diagnostic/diagnostic.ts +0 -3
  280. package/src/api/examples/scanner.test.ts +83 -0
  281. package/src/api/examples/scanner.ts +31 -21
  282. package/src/api/examples/schemas/example/example.ts +6 -0
  283. package/src/api/reference/$.ts +3 -0
  284. package/src/api/reference/catalog.ts +55 -0
  285. package/src/api/reference/config.ts +193 -0
  286. package/src/api/reference/scanner.ts +53 -0
  287. package/src/api/schema/augmentations/$$.ts +6 -0
  288. package/src/api/schema/augmentations/$.ts +1 -1
  289. package/src/api/schema/augmentations/apply.test.ts +89 -0
  290. package/src/api/schema/augmentations/apply.ts +277 -0
  291. package/src/api/schema/augmentations/augmentation.ts +24 -0
  292. package/src/api/schema/augmentations/config.ts +11 -0
  293. package/src/api/schema/augmentations/diagnostics/diagnostic.ts +20 -0
  294. package/src/api/schema/augmentations/diagnostics/duplicate-version.ts +20 -0
  295. package/src/api/schema/augmentations/diagnostics/invalid-path.ts +21 -0
  296. package/src/api/schema/augmentations/diagnostics/version-mismatch.ts +21 -0
  297. package/src/api/schema/augmentations/input.test.ts +144 -0
  298. package/src/api/schema/augmentations/input.ts +215 -0
  299. package/src/api/schema/augmentations/placement.ts +11 -0
  300. package/src/api/schema/config-schema.ts +2 -2
  301. package/src/api/schema/input-source/load.ts +2 -0
  302. package/src/api/schema/load.ts +19 -2
  303. package/src/lib/grafaid/schema/format-default-value.ts +22 -0
  304. package/src/lib/grafaid/schema/schema.ts +2 -0
  305. package/src/lib/graphql-path/$$.ts +7 -13
  306. package/src/lib/graphql-path/$.test.ts +175 -0
  307. package/src/lib/graphql-path/definition.ts +162 -162
  308. package/src/lib/graphql-path/query.ts +15 -98
  309. package/src/lib/graphql-path/schema.ts +136 -0
  310. package/src/lib/graphql-path/types.ts +108 -28
  311. package/src/lib/version-coverage/version-coverage.ts +48 -6
  312. package/src/template/components/ArgumentAnnotation.tsx +58 -9
  313. package/src/template/components/ArgumentListAnnotation.tsx +50 -17
  314. package/src/template/components/Changelog/groups/FieldArgument.tsx +0 -1
  315. package/src/template/components/CodeBlock.tsx +1 -0
  316. package/src/template/components/Description.tsx +1 -1
  317. package/src/template/components/ExampleLink.tsx +2 -1
  318. package/src/template/components/Field.tsx +148 -20
  319. package/src/template/components/FieldList.tsx +28 -13
  320. package/src/template/components/FieldListSection.tsx +12 -2
  321. package/src/template/components/GraphQLDocument.tsx +2 -0
  322. package/src/template/components/GraphQLInteractive/GraphQLInteractive.tsx +6 -1
  323. package/src/template/components/GraphQLInteractive/lib/parser.ts +16 -3
  324. package/src/template/components/IAPIndicator.tsx +73 -0
  325. package/src/template/components/Link.tsx +9 -3
  326. package/src/template/components/NamedType.tsx +54 -28
  327. package/src/template/components/ReferenceLink.tsx +16 -10
  328. package/src/template/components/TypeAnnotation.tsx +17 -5
  329. package/src/template/components/ViewModeToggle.tsx +27 -0
  330. package/src/template/components/graphql/type-link.tsx +34 -3
  331. package/src/template/components/home/PlaygroundPreview.tsx +3 -0
  332. package/src/template/components/sidebar/SidebarItem.tsx +21 -5
  333. package/src/template/contexts/ReferenceConfigContext.tsx +37 -0
  334. package/src/template/contexts/ViewModeContext.tsx +64 -0
  335. package/src/template/hooks/useAlignedColumns.ts +19 -0
  336. package/src/template/routes/changelog/ChangelogSidebar.tsx +4 -4
  337. package/src/template/routes/examples/name.tsx +13 -1
  338. package/src/template/routes/reference.tsx +67 -23
  339. package/src/types/virtual-modules.d.ts +5 -0
  340. package/src/vite/plugins/core.ts +6 -0
  341. package/src/vite/plugins/examples.ts +12 -2
  342. package/src/vite/plugins/index.ts +1 -0
  343. package/src/vite/plugins/navbar.ts +4 -1
  344. package/src/vite/plugins/reference.ts +130 -0
  345. package/src/vite/plugins/schemas.ts +51 -2
  346. package/build/api/examples/diagnostic/unused-default.d.ts +0 -49
  347. package/build/api/examples/diagnostic/unused-default.d.ts.map +0 -1
  348. package/build/api/examples/diagnostic/unused-default.js +0 -19
  349. package/build/api/examples/diagnostic/unused-default.js.map +0 -1
  350. package/build/api/schema/augmentations/augmentations/description.d.ts +0 -26
  351. package/build/api/schema/augmentations/augmentations/description.d.ts.map +0 -1
  352. package/build/api/schema/augmentations/augmentations/description.js +0 -55
  353. package/build/api/schema/augmentations/augmentations/description.js.map +0 -1
  354. package/build/api/schema/augmentations/schema-augmentation.d.ts +0 -20
  355. package/build/api/schema/augmentations/schema-augmentation.d.ts.map +0 -1
  356. package/build/api/schema/augmentations/schema-augmentation.js +0 -22
  357. package/build/api/schema/augmentations/schema-augmentation.js.map +0 -1
  358. package/build/api/schema/augmentations/target.d.ts +0 -25
  359. package/build/api/schema/augmentations/target.d.ts.map +0 -1
  360. package/build/api/schema/augmentations/target.js +0 -39
  361. package/build/api/schema/augmentations/target.js.map +0 -1
  362. package/build/lib/graphql-path/constructors.d.ts +0 -57
  363. package/build/lib/graphql-path/constructors.d.ts.map +0 -1
  364. package/build/lib/graphql-path/constructors.js +0 -73
  365. package/build/lib/graphql-path/constructors.js.map +0 -1
  366. package/build/template/components/ArgumentList.d.ts +0 -6
  367. package/build/template/components/ArgumentList.d.ts.map +0 -1
  368. package/build/template/components/ArgumentList.js +0 -9
  369. package/build/template/components/ArgumentList.js.map +0 -1
  370. package/src/api/examples/diagnostic/unused-default.ts +0 -22
  371. package/src/api/schema/augmentations/augmentations/description.ts +0 -69
  372. package/src/api/schema/augmentations/schema-augmentation.ts +0 -32
  373. package/src/api/schema/augmentations/target.ts +0 -61
  374. package/src/lib/graphql-path/constructors.ts +0 -81
  375. package/src/template/components/ArgumentList.tsx +0 -22
@@ -0,0 +1,20 @@
1
+ import { Diagnostic } from '#lib/diagnostic/$'
2
+ import { S } from '#lib/kit-temp/effect'
3
+
4
+ export const DiagnosticDuplicateVersion = Diagnostic.create({
5
+ source: 'schema-augmentations',
6
+ name: 'duplicate-version',
7
+ severity: 'error',
8
+ context: {
9
+ version: S.String,
10
+ firstPath: S.String,
11
+ duplicatePath: S.String,
12
+ },
13
+ }).annotations({
14
+ identifier: 'DiagnosticDuplicateVersion',
15
+ description: 'Same version is specified multiple times in augmentation configuration',
16
+ })
17
+
18
+ export const makeDiagnosticDuplicateVersion = Diagnostic.createMake(DiagnosticDuplicateVersion)
19
+
20
+ export type DiagnosticDuplicateVersion = S.Schema.Type<typeof DiagnosticDuplicateVersion>
@@ -0,0 +1,21 @@
1
+ import { Diagnostic } from '#lib/diagnostic/$'
2
+ import { S } from '#lib/kit-temp/effect'
3
+ import { Version } from '#lib/version/$'
4
+
5
+ export const DiagnosticInvalidPath = Diagnostic.create({
6
+ source: 'schema-augmentations',
7
+ name: 'invalid-path',
8
+ severity: 'error',
9
+ context: {
10
+ path: S.String,
11
+ version: S.optional(S.Union(Version.Version, S.Null)),
12
+ error: S.String,
13
+ },
14
+ }).annotations({
15
+ identifier: 'DiagnosticInvalidPath',
16
+ description: 'Augmentation references a non-existent type or field in the schema',
17
+ })
18
+
19
+ export const makeDiagnosticInvalidPath = Diagnostic.createMake(DiagnosticInvalidPath)
20
+
21
+ export type DiagnosticInvalidPath = S.Schema.Type<typeof DiagnosticInvalidPath>
@@ -0,0 +1,21 @@
1
+ import { Diagnostic } from '#lib/diagnostic/$'
2
+ import { S } from '#lib/kit-temp/effect'
3
+ import { Version } from '#lib/version/$'
4
+
5
+ export const DiagnosticVersionMismatch = Diagnostic.create({
6
+ source: 'schema-augmentations',
7
+ name: 'version-mismatch',
8
+ severity: 'error',
9
+ context: {
10
+ path: S.String,
11
+ requestedVersion: Version.Version,
12
+ availableVersions: S.Array(S.String),
13
+ },
14
+ }).annotations({
15
+ identifier: 'DiagnosticVersionMismatch',
16
+ description: 'Augmentation specifies a version that does not match any schema version',
17
+ })
18
+
19
+ export const makeDiagnosticVersionMismatch = Diagnostic.createMake(DiagnosticVersionMismatch)
20
+
21
+ export type DiagnosticVersionMismatch = S.Schema.Type<typeof DiagnosticVersionMismatch>
@@ -0,0 +1,144 @@
1
+ import { VersionCoverage } from '#lib/version-coverage'
2
+ import { Version } from '#lib/version/$'
3
+ import { HashMap, Option } from 'effect'
4
+ import { describe, expect, test } from 'vitest'
5
+ import { normalizeAugmentationInput } from './input.js'
6
+
7
+ describe('Description Augmentation Transform', () => {
8
+ test('transforms unversioned augmentation', () => {
9
+ const input = {
10
+ on: 'Query',
11
+ placement: 'before' as const,
12
+ content: 'Test content',
13
+ }
14
+
15
+ const result = normalizeAugmentationInput(input)
16
+ expect(result).not.toBeNull()
17
+
18
+ // Should have one unversioned entry
19
+ expect(HashMap.size(result!.versionAugmentations)).toBe(1)
20
+
21
+ // Check the entry exists by iterating
22
+ let foundUnversioned = false
23
+ for (const [coverage, config] of result!.versionAugmentations) {
24
+ if (VersionCoverage.isUnversioned(coverage)) {
25
+ foundUnversioned = true
26
+ expect(config.content).toBe('Test content')
27
+ expect(config.placement).toBe('before')
28
+ }
29
+ }
30
+ expect(foundUnversioned).toBe(true)
31
+ })
32
+
33
+ test('transforms versioned augmentation with defaults', () => {
34
+ const input = {
35
+ on: 'Pokemon',
36
+ placement: 'after' as const,
37
+ content: 'Default content',
38
+ versions: {
39
+ v1: { content: 'V1 content' },
40
+ v2: { content: 'V2 content', placement: 'before' as const },
41
+ },
42
+ }
43
+
44
+ const result = normalizeAugmentationInput(input)
45
+ expect(result).not.toBeNull()
46
+
47
+ // Should have two version entries (no unversioned when versions exist)
48
+ expect(HashMap.size(result!.versionAugmentations)).toBe(2)
49
+
50
+ // Check v1 - inherits placement from default
51
+ const v1 = Version.decodeSync('v1')
52
+ const v1Config = HashMap.get(
53
+ result!.versionAugmentations,
54
+ VersionCoverage.single(v1),
55
+ )
56
+ expect(Option.isSome(v1Config)).toBe(true)
57
+ if (Option.isSome(v1Config)) {
58
+ expect(v1Config.value.content).toBe('V1 content')
59
+ expect(v1Config.value.placement).toBe('after') // inherited
60
+ }
61
+
62
+ // Check v2 - overrides placement
63
+ const v2 = Version.decodeSync('v2')
64
+ const v2Config = HashMap.get(
65
+ result!.versionAugmentations,
66
+ VersionCoverage.single(v2),
67
+ )
68
+ expect(Option.isSome(v2Config)).toBe(true)
69
+ if (Option.isSome(v2Config)) {
70
+ expect(v2Config.value.content).toBe('V2 content')
71
+ expect(v2Config.value.placement).toBe('before') // overridden
72
+ }
73
+ })
74
+
75
+ test('transforms version-only augmentation', () => {
76
+ const input = {
77
+ versions: {
78
+ v2: {
79
+ on: 'Pokemon.stats',
80
+ content: 'V2 only content',
81
+ placement: 'after' as const,
82
+ },
83
+ },
84
+ }
85
+
86
+ const result = normalizeAugmentationInput(input)
87
+ expect(result).not.toBeNull()
88
+
89
+ // Should have one version entry
90
+ expect(HashMap.size(result!.versionAugmentations)).toBe(1)
91
+
92
+ const v2 = Version.decodeSync('v2')
93
+ const v2Config = HashMap.get(
94
+ result!.versionAugmentations,
95
+ VersionCoverage.single(v2),
96
+ )
97
+ expect(Option.isSome(v2Config)).toBe(true)
98
+ if (Option.isSome(v2Config)) {
99
+ expect(v2Config.value.content).toBe('V2 only content')
100
+ // v2Config.value.on is now a GraphQLPath.Definition.FieldDefinitionPath
101
+ // which is a tuple: [TypeSegment, FieldSegment]
102
+ expect(v2Config.value.on).toEqual([
103
+ { _tag: 'TypeSegment', type: 'Pokemon' },
104
+ { _tag: 'FieldSegment', field: 'stats' },
105
+ ])
106
+ }
107
+ })
108
+
109
+ test('returns null for invalid augmentation', () => {
110
+ const input = {
111
+ // Missing required fields and no versions
112
+ }
113
+
114
+ const result = normalizeAugmentationInput(input)
115
+ expect(result).toBeNull()
116
+ })
117
+
118
+ test('skips incomplete version entries', () => {
119
+ const input = {
120
+ on: 'Query',
121
+ // Missing placement and content at top level
122
+ versions: {
123
+ v1: { content: 'V1 content' }, // Missing placement, can't inherit
124
+ v2: {
125
+ content: 'V2 content',
126
+ placement: 'after' as const,
127
+ }, // Complete
128
+ },
129
+ }
130
+
131
+ const result = normalizeAugmentationInput(input)
132
+ expect(result).not.toBeNull()
133
+
134
+ // Should have only v2 (v1 is incomplete)
135
+ expect(HashMap.size(result!.versionAugmentations)).toBe(1)
136
+
137
+ const v2 = Version.decodeSync('v2')
138
+ const v2Config = HashMap.get(
139
+ result!.versionAugmentations,
140
+ VersionCoverage.single(v2),
141
+ )
142
+ expect(Option.isSome(v2Config)).toBe(true)
143
+ })
144
+ })
@@ -0,0 +1,215 @@
1
+ import type { Augmentation } from '#api/schema/augmentations/augmentation'
2
+ import type { AugmentationConfig } from '#api/schema/augmentations/config'
3
+ import { Placement } from '#api/schema/augmentations/placement'
4
+ import { GraphQLPath } from '#lib/graphql-path'
5
+ import { S } from '#lib/kit-temp/effect'
6
+ import { VersionCoverage } from '#lib/version-coverage'
7
+ import { Version } from '#lib/version/$'
8
+ import { HashMap } from 'effect'
9
+
10
+ /**
11
+ * Configuration for augmenting GraphQL schema descriptions.
12
+ *
13
+ * This schema supports two usage patterns:
14
+ *
15
+ * 1. **Unversioned augmentations** - Apply to all schema versions
16
+ * 2. **Version-specific augmentations** - Apply to specific schema versions with optional defaults
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // Unversioned - applies to all versions
21
+ * {
22
+ * on: 'Pokemon',
23
+ * placement: 'after',
24
+ * content: '**Note:** This type includes battle stats.'
25
+ * }
26
+ *
27
+ * // Version-specific with defaults
28
+ * {
29
+ * on: 'Pokemon', // Default for all versions
30
+ * placement: 'after', // Default for all versions
31
+ * content: 'Base Pokemon info.', // Default content
32
+ * versions: {
33
+ * '2': {
34
+ * content: 'Enhanced Pokemon with battle capabilities.' // Override for v2
35
+ * },
36
+ * '3': {
37
+ * on: 'BattlePokemon', // Different type in v3
38
+ * content: 'Battle-ready Pokemon with full stats.'
39
+ * }
40
+ * }
41
+ * }
42
+ * ```
43
+ *
44
+ * @remarks
45
+ * When using version-specific augmentations:
46
+ * - Top-level fields serve as defaults for all versions
47
+ * - Version-specific fields override defaults
48
+ * - A version entry must have complete configuration (after merging with defaults) to be valid
49
+ * - Invalid paths or missing types will generate build diagnostics rather than crashing
50
+ */
51
+ export const AugmentationInput = S.Struct({
52
+ /**
53
+ * GraphQL path to the type or field to augment.
54
+ *
55
+ * @example
56
+ * - Type path: `'Pokemon'`, `'Query'`, `'User'`
57
+ * - Field path: `'Pokemon.name'`, `'Query.users'`, `'Mutation.createUser'`
58
+ *
59
+ * @remarks
60
+ * If the specified path doesn't exist in the schema, a diagnostic error will be generated
61
+ * during the build process rather than causing a crash.
62
+ */
63
+ on: S.optional(S.String),
64
+
65
+ /**
66
+ * How to apply the augmentation content relative to existing description.
67
+ *
68
+ * - `'over'` - Replace the existing description entirely
69
+ * - `'before'` - Prepend content to the existing description
70
+ * - `'after'` - Append content to the existing description
71
+ *
72
+ * @default 'after'
73
+ */
74
+ placement: S.optional(Placement),
75
+
76
+ /**
77
+ * The content to add to the description.
78
+ *
79
+ * Supports full Markdown syntax including:
80
+ * - Bold/italic text
81
+ * - Code blocks and inline code
82
+ * - Links
83
+ * - Lists
84
+ * - Tables
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * content: `
89
+ * **Important:** This field requires authentication.
90
+ *
91
+ * Example query:
92
+ * \`\`\`graphql
93
+ * query {
94
+ * users(limit: 10) {
95
+ * id
96
+ * name
97
+ * }
98
+ * }
99
+ * \`\`\`
100
+ * `
101
+ * ```
102
+ */
103
+ content: S.optional(S.String),
104
+
105
+ /**
106
+ * Version-specific augmentation overrides.
107
+ *
108
+ * Keys are version identifiers (e.g., `'1'`, `'2'`, `'3'`).
109
+ * Values are partial augmentation configs that override top-level defaults.
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * versions: {
114
+ * '1': { content: 'Legacy API - see migration guide.' },
115
+ * '2': { content: 'Current stable API.' },
116
+ * '3': {
117
+ * on: 'NewTypeName', // Type renamed in v3
118
+ * content: 'Beta API - subject to change.'
119
+ * }
120
+ * }
121
+ * ```
122
+ *
123
+ * @remarks
124
+ * - Version keys must be valid numeric strings
125
+ * - Each version inherits top-level defaults
126
+ * - Invalid version identifiers will generate build diagnostics
127
+ * - Duplicate version keys will generate build diagnostics
128
+ */
129
+ versions: S.optional(
130
+ S.Record({
131
+ key: S.String,
132
+ value: S.Struct({
133
+ on: S.optional(S.String),
134
+ placement: S.optional(Placement),
135
+ content: S.optional(S.String),
136
+ }),
137
+ }),
138
+ ),
139
+ }).annotations({
140
+ identifier: 'AugmentationInput',
141
+ description: 'Configuration for augmenting GraphQL schema descriptions with version support',
142
+ })
143
+
144
+ export type AugmentationInput = S.Schema.Type<typeof AugmentationInput>
145
+
146
+ /**
147
+ * Transform user-facing input to normalized internal representation.
148
+ *
149
+ * Rules:
150
+ * 1. If no versions field → create single unversioned entry
151
+ * 2. If versions field exists:
152
+ * - Create version-specific entries for each version
153
+ * - If top-level defaults exist, they are used as fallbacks for version entries
154
+ * - If a version entry would be incomplete without defaults, skip it
155
+ */
156
+ export const normalizeAugmentationInput = (input: AugmentationInput): Augmentation | null => {
157
+ const map = HashMap.empty<VersionCoverage.VersionCoverage, AugmentationConfig>()
158
+
159
+ // Case 1: No versions field - create unversioned entry
160
+ if (!input.versions || Object.keys(input.versions).length === 0) {
161
+ // Must have complete top-level configuration
162
+ if (!input.on || !input.placement || !input.content) {
163
+ return null // Invalid: incomplete unversioned augmentation
164
+ }
165
+
166
+ const unversionedConfig: AugmentationConfig = {
167
+ on: GraphQLPath.Definition.decodeSync(input.on),
168
+ placement: input.placement,
169
+ content: input.content,
170
+ }
171
+
172
+ return {
173
+ versionAugmentations: HashMap.set(
174
+ map,
175
+ VersionCoverage.unversioned(),
176
+ unversionedConfig,
177
+ ),
178
+ }
179
+ }
180
+
181
+ // Case 2: Has versions field - create version-specific entries
182
+ let resultMap = map
183
+
184
+ // Process each version
185
+ for (const [versionStr, versionOverrides] of Object.entries(input.versions)) {
186
+ // Merge with top-level defaults
187
+ const onString = versionOverrides.on ?? input.on
188
+ const placement = versionOverrides.placement ?? input.placement
189
+ const content = versionOverrides.content ?? input.content
190
+
191
+ // Skip if incomplete after merging with defaults
192
+ if (!onString || !placement || !content) {
193
+ continue
194
+ }
195
+
196
+ const config: AugmentationConfig = {
197
+ on: GraphQLPath.Definition.decodeSync(onString),
198
+ placement,
199
+ content,
200
+ }
201
+ const version = Version.decodeSync(versionStr)
202
+ const coverage = VersionCoverage.single(version)
203
+
204
+ resultMap = HashMap.set(resultMap, coverage, config)
205
+ }
206
+
207
+ // If no valid version configurations were created, return null
208
+ if (HashMap.size(resultMap) === 0) {
209
+ return null
210
+ }
211
+
212
+ return {
213
+ versionAugmentations: resultMap,
214
+ }
215
+ }
@@ -0,0 +1,11 @@
1
+ import { S } from '#lib/kit-temp/effect'
2
+
3
+ export const Placement = S.Enums(
4
+ {
5
+ before: 'before',
6
+ after: 'after',
7
+ over: 'over',
8
+ } as const,
9
+ )
10
+
11
+ export type Placement = S.Schema.Type<typeof Placement>
@@ -1,4 +1,4 @@
1
- import { AugmentationSchema } from '#api/schema/augmentations/schema-augmentation'
1
+ import { Augmentations } from '#api/schema/augmentations/$'
2
2
  import { S } from '#lib/kit-temp/effect'
3
3
 
4
4
  // ============================================================================
@@ -364,7 +364,7 @@ export const ConfigSchema = S.Struct({
364
364
  * ]
365
365
  * ```
366
366
  */
367
- augmentations: S.optional(S.Array(AugmentationSchema)),
367
+ augmentations: S.optional(S.Array(Augmentations.AugmentationInput)),
368
368
  /**
369
369
  * Which data sources to use for loading schemas.
370
370
  *
@@ -1,4 +1,5 @@
1
1
  import { Config as PolenConfig } from '#api/config/$'
2
+ import type { Diagnostic } from '#api/schema/augmentations/diagnostics/diagnostic'
2
3
  import type { Config } from '#api/schema/config'
3
4
  import type { InputSource } from '#api/schema/input-source/input-source'
4
5
  import type { Catalog } from '#lib/catalog/$'
@@ -9,6 +10,7 @@ import type { Catalog } from '#lib/catalog/$'
9
10
  export interface LoadedCatalog {
10
11
  data: Catalog.Catalog | null
11
12
  source: InputSource
13
+ diagnostics?: Diagnostic[]
12
14
  // {
13
15
  // type: DataSourceType
14
16
  // /**
@@ -141,16 +141,33 @@ export const loadOrNull = (
141
141
  if (loadedSchema.data && config.schema?.augmentations) {
142
142
  const augmentations = config.schema.augmentations
143
143
  const catalog = loadedSchema.data as Catalog.Catalog
144
+ const allDiagnostics: Augmentations.Diagnostic[] = []
145
+
144
146
  Catalog.fold(
145
147
  (versioned) => {
146
148
  for (const schema of Catalog.Versioned.getAll(versioned)) {
147
- Augmentations.apply(schema.definition, augmentations)
149
+ const { diagnostics } = Augmentations.applyAll(
150
+ schema.definition,
151
+ augmentations,
152
+ schema.version,
153
+ )
154
+ allDiagnostics.push(...diagnostics)
148
155
  }
149
156
  },
150
157
  (unversioned) => {
151
- Augmentations.apply(unversioned.schema.definition, augmentations)
158
+ const { diagnostics } = Augmentations.applyAll(
159
+ unversioned.schema.definition,
160
+ augmentations,
161
+ null,
162
+ )
163
+ allDiagnostics.push(...diagnostics)
152
164
  },
153
165
  )(catalog)
166
+
167
+ // Add diagnostics to loaded schema if any were generated
168
+ if (allDiagnostics.length > 0) {
169
+ loadedSchema.diagnostics = allDiagnostics
170
+ }
154
171
  }
155
172
 
156
173
  return loadedSchema
@@ -0,0 +1,22 @@
1
+ import { astFromValue, print } from 'graphql'
2
+ import type { GraphQLInputType } from 'graphql'
3
+
4
+ /**
5
+ * Formats a GraphQL default value into a string representation.
6
+ * Returns just the value part (e.g., "20", "true", '"hello"')
7
+ *
8
+ * @param value - The default value from a GraphQL argument or input field
9
+ * @param type - The GraphQL input type of the field
10
+ * @returns The formatted value string, or null if value is undefined
11
+ */
12
+ export const formatDefaultValue = (value: unknown, type: GraphQLInputType): string | null => {
13
+ if (value === undefined) return null
14
+
15
+ const ast = astFromValue(value, type)
16
+ if (!ast) {
17
+ // Fallback for edge cases where astFromValue fails
18
+ return JSON.stringify(value)
19
+ }
20
+
21
+ return print(ast)
22
+ }
@@ -51,6 +51,8 @@ export * as NodesLike from './nodes-like.js'
51
51
 
52
52
  export * from './read.js'
53
53
 
54
+ export * from './format-default-value.js'
55
+
54
56
  import * as AST from './ast.js'
55
57
 
56
58
  export const empty: GraphQLSchema = buildASTSchema(AST.empty)
@@ -22,21 +22,15 @@
22
22
  * const encoded = GraphQLPath.Definition.encode(userNameFieldPath) // "User.name"
23
23
  * const decoded = GraphQLPath.Definition.decode("User.name") // field definition path
24
24
  *
25
- * // Create a query path
26
- * const queryPath = GraphQLPath.Query.builder()
27
- * .type('User')
28
- * .field('posts')
29
- * .type('Post')
30
- * .field('author')
31
- * .type('User')
32
- * .field('name')
33
- * .build()
34
- *
35
- * // Encode/decode query paths
36
- * const encodedQuery = GraphQLPath.Query.encode(queryPath) // "User.posts.Post.author.User.name"
37
- * const decodedQuery = GraphQLPath.Query.decode("User.posts.Post.author") // query path
25
+ * // Decode a query path from a string
26
+ * const queryPath = GraphQLPath.Query.decode("User.posts.Post.author.User.name")
27
+ * // Returns array of segments: [TypeSegment, FieldSegment, TypeSegment, FieldSegment, ...]
28
+ *
29
+ * // Encode query path segments to a string
30
+ * const encoded = GraphQLPath.Query.encode(queryPath) // "User.posts.Post.author.User.name"
38
31
  * ```
39
32
  */
40
33
 
41
34
  export * as Definition from './definition.js'
42
35
  export * as Query from './query.js'
36
+ export * as Schema from './schema.js'