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.
- package/build/api/config/input.d.ts +259 -77
- package/build/api/config/input.d.ts.map +1 -1
- package/build/api/config/input.js +2 -0
- package/build/api/config/input.js.map +1 -1
- package/build/api/config/normalized.d.ts +433 -143
- package/build/api/config/normalized.d.ts.map +1 -1
- package/build/api/config/normalized.js +47 -0
- package/build/api/config/normalized.js.map +1 -1
- package/build/api/config-template/template.d.ts +191 -121
- package/build/api/config-template/template.d.ts.map +1 -1
- package/build/api/config-template/template.js +18 -1
- package/build/api/config-template/template.js.map +1 -1
- package/build/api/examples/diagnostic/diagnostic.d.ts +0 -23
- package/build/api/examples/diagnostic/diagnostic.d.ts.map +1 -1
- package/build/api/examples/diagnostic/diagnostic.js +1 -3
- package/build/api/examples/diagnostic/diagnostic.js.map +1 -1
- package/build/api/examples/scanner.d.ts +27 -1
- package/build/api/examples/scanner.d.ts.map +1 -1
- package/build/api/examples/scanner.js +30 -17
- package/build/api/examples/scanner.js.map +1 -1
- package/build/api/examples/schemas/catalog.d.ts +56 -12
- package/build/api/examples/schemas/catalog.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.d.ts +54 -11
- package/build/api/examples/schemas/example/example.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.js +5 -0
- package/build/api/examples/schemas/example/example.js.map +1 -1
- package/build/api/reference/$.d.ts +4 -0
- package/build/api/reference/$.d.ts.map +1 -0
- package/build/api/reference/$.js +4 -0
- package/build/api/reference/$.js.map +1 -0
- package/build/api/reference/catalog.d.ts +69 -0
- package/build/api/reference/catalog.d.ts.map +1 -0
- package/build/api/reference/catalog.js +44 -0
- package/build/api/reference/catalog.js.map +1 -0
- package/build/api/reference/config.d.ts +616 -0
- package/build/api/reference/config.d.ts.map +1 -0
- package/build/api/reference/config.js +162 -0
- package/build/api/reference/config.js.map +1 -0
- package/build/api/reference/scanner.d.ts +26 -0
- package/build/api/reference/scanner.d.ts.map +1 -0
- package/build/api/reference/scanner.js +27 -0
- package/build/api/reference/scanner.js.map +1 -0
- package/build/api/schema/augmentations/$$.d.ts +7 -0
- package/build/api/schema/augmentations/$$.d.ts.map +1 -0
- package/build/api/schema/augmentations/$$.js +7 -0
- package/build/api/schema/augmentations/$$.js.map +1 -0
- package/build/api/schema/augmentations/$.d.ts +1 -1
- package/build/api/schema/augmentations/$.d.ts.map +1 -1
- package/build/api/schema/augmentations/$.js +1 -1
- package/build/api/schema/augmentations/$.js.map +1 -1
- package/build/api/schema/augmentations/apply.d.ts +29 -0
- package/build/api/schema/augmentations/apply.d.ts.map +1 -0
- package/build/api/schema/augmentations/apply.js +181 -0
- package/build/api/schema/augmentations/apply.js.map +1 -0
- package/build/api/schema/augmentations/augmentation.d.ts +31 -0
- package/build/api/schema/augmentations/augmentation.d.ts.map +1 -0
- package/build/api/schema/augmentations/augmentation.js +22 -0
- package/build/api/schema/augmentations/augmentation.js.map +1 -0
- package/build/api/schema/augmentations/config.d.ts +24 -0
- package/build/api/schema/augmentations/config.d.ts.map +1 -0
- package/build/api/schema/augmentations/config.js +9 -0
- package/build/api/schema/augmentations/config.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts +67 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.js +13 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts +45 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.js +17 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts +46 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.js +18 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts +46 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.js +18 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.js.map +1 -0
- package/build/api/schema/augmentations/input.d.ts +145 -0
- package/build/api/schema/augmentations/input.d.ts.map +1 -0
- package/build/api/schema/augmentations/input.js +191 -0
- package/build/api/schema/augmentations/input.js.map +1 -0
- package/build/api/schema/augmentations/placement.d.ts +8 -0
- package/build/api/schema/augmentations/placement.d.ts.map +1 -0
- package/build/api/schema/augmentations/placement.js +7 -0
- package/build/api/schema/augmentations/placement.js.map +1 -0
- package/build/api/schema/config-schema.d.ts +66 -66
- package/build/api/schema/config-schema.d.ts.map +1 -1
- package/build/api/schema/config-schema.js +2 -2
- package/build/api/schema/config-schema.js.map +1 -1
- package/build/api/schema/input-source/load.d.ts +2 -0
- package/build/api/schema/input-source/load.d.ts.map +1 -1
- package/build/api/schema/input-source/load.js.map +1 -1
- package/build/api/schema/input-sources/directory.d.ts +39 -39
- package/build/api/schema/input-sources/file.d.ts +39 -39
- package/build/api/schema/input-sources/introspection-file.d.ts +39 -39
- package/build/api/schema/input-sources/introspection.d.ts +39 -39
- package/build/api/schema/input-sources/memory.d.ts +39 -39
- package/build/api/schema/input-sources/versioned-directory.d.ts +79 -79
- package/build/api/schema/load.d.ts.map +1 -1
- package/build/api/schema/load.js +9 -2
- package/build/api/schema/load.js.map +1 -1
- package/build/lib/catalog/catalog.d.ts +1181 -1181
- package/build/lib/catalog/unversioned.d.ts +312 -312
- package/build/lib/catalog/versioned.d.ts +634 -634
- package/build/lib/change/change.d.ts +238 -238
- package/build/lib/document/document.d.ts +14 -8
- package/build/lib/document/document.d.ts.map +1 -1
- package/build/lib/document/versioned.d.ts +17 -10
- package/build/lib/document/versioned.d.ts.map +1 -1
- package/build/lib/grafaid/schema/KindMap/_.d.ts +1 -1
- package/build/lib/grafaid/schema/format-default-value.d.ts +11 -0
- package/build/lib/grafaid/schema/format-default-value.d.ts.map +1 -0
- package/build/lib/grafaid/schema/format-default-value.js +20 -0
- package/build/lib/grafaid/schema/format-default-value.js.map +1 -0
- package/build/lib/grafaid/schema/schema.d.ts +1 -0
- package/build/lib/grafaid/schema/schema.d.ts.map +1 -1
- package/build/lib/grafaid/schema/schema.js +1 -0
- package/build/lib/grafaid/schema/schema.js.map +1 -1
- package/build/lib/graphql-path/$$.d.ts +7 -13
- package/build/lib/graphql-path/$$.d.ts.map +1 -1
- package/build/lib/graphql-path/$$.js +7 -13
- package/build/lib/graphql-path/$$.js.map +1 -1
- package/build/lib/graphql-path/definition.d.ts +104 -94
- package/build/lib/graphql-path/definition.d.ts.map +1 -1
- package/build/lib/graphql-path/definition.js +126 -125
- package/build/lib/graphql-path/definition.js.map +1 -1
- package/build/lib/graphql-path/query.d.ts +25 -57
- package/build/lib/graphql-path/query.d.ts.map +1 -1
- package/build/lib/graphql-path/query.js +15 -93
- package/build/lib/graphql-path/query.js.map +1 -1
- package/build/lib/graphql-path/schema.d.ts +49 -0
- package/build/lib/graphql-path/schema.d.ts.map +1 -0
- package/build/lib/graphql-path/schema.js +89 -0
- package/build/lib/graphql-path/schema.js.map +1 -0
- package/build/lib/graphql-path/types.d.ts +76 -28
- package/build/lib/graphql-path/types.d.ts.map +1 -1
- package/build/lib/graphql-path/types.js +101 -2
- package/build/lib/graphql-path/types.js.map +1 -1
- package/build/lib/revision/revision.d.ts +1170 -1170
- package/build/lib/schema/schema.d.ts +708 -708
- package/build/lib/schema/unversioned.d.ts +1092 -1092
- package/build/lib/schema/versioned.d.ts +634 -634
- package/build/lib/semver/official-release.d.ts +10 -10
- package/build/lib/semver/pre-release.d.ts +10 -10
- package/build/lib/semver/semver.d.ts +50 -50
- package/build/lib/version-coverage/version-coverage.d.ts +43 -11
- package/build/lib/version-coverage/version-coverage.d.ts.map +1 -1
- package/build/lib/version-coverage/version-coverage.js +40 -6
- package/build/lib/version-coverage/version-coverage.js.map +1 -1
- package/build/template/components/ArgumentAnnotation.d.ts +2 -1
- package/build/template/components/ArgumentAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentAnnotation.js +14 -4
- package/build/template/components/ArgumentAnnotation.js.map +1 -1
- package/build/template/components/ArgumentListAnnotation.d.ts +1 -0
- package/build/template/components/ArgumentListAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentListAnnotation.js +21 -8
- package/build/template/components/ArgumentListAnnotation.js.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.d.ts.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.js +0 -1
- package/build/template/components/Changelog/groups/FieldArgument.js.map +1 -1
- package/build/template/components/CodeBlock.d.ts.map +1 -1
- package/build/template/components/CodeBlock.js +1 -1
- package/build/template/components/CodeBlock.js.map +1 -1
- package/build/template/components/Description.js +1 -1
- package/build/template/components/Description.js.map +1 -1
- package/build/template/components/ExampleLink.d.ts.map +1 -1
- package/build/template/components/ExampleLink.js +2 -1
- package/build/template/components/ExampleLink.js.map +1 -1
- package/build/template/components/Field.d.ts +2 -0
- package/build/template/components/Field.d.ts.map +1 -1
- package/build/template/components/Field.js +42 -4
- package/build/template/components/Field.js.map +1 -1
- package/build/template/components/FieldList.d.ts +2 -1
- package/build/template/components/FieldList.d.ts.map +1 -1
- package/build/template/components/FieldList.js +14 -3
- package/build/template/components/FieldList.js.map +1 -1
- package/build/template/components/FieldListSection.d.ts.map +1 -1
- package/build/template/components/FieldListSection.js +6 -1
- package/build/template/components/FieldListSection.js.map +1 -1
- package/build/template/components/GraphQLDocument.d.ts.map +1 -1
- package/build/template/components/GraphQLDocument.js +2 -1
- package/build/template/components/GraphQLDocument.js.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts +2 -0
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js +4 -3
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts +2 -2
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.js +17 -12
- package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
- package/build/template/components/IAPIndicator.d.ts +12 -0
- package/build/template/components/IAPIndicator.d.ts.map +1 -0
- package/build/template/components/IAPIndicator.js +21 -0
- package/build/template/components/IAPIndicator.js.map +1 -0
- package/build/template/components/Link.d.ts +1 -2
- package/build/template/components/Link.d.ts.map +1 -1
- package/build/template/components/Link.js +5 -2
- package/build/template/components/Link.js.map +1 -1
- package/build/template/components/NamedType.d.ts.map +1 -1
- package/build/template/components/NamedType.js +9 -5
- package/build/template/components/NamedType.js.map +1 -1
- package/build/template/components/ReferenceLink.d.ts +2 -2
- package/build/template/components/ReferenceLink.d.ts.map +1 -1
- package/build/template/components/ReferenceLink.js +5 -3
- package/build/template/components/ReferenceLink.js.map +1 -1
- package/build/template/components/TypeAnnotation.d.ts +2 -0
- package/build/template/components/TypeAnnotation.d.ts.map +1 -1
- package/build/template/components/TypeAnnotation.js +4 -4
- package/build/template/components/TypeAnnotation.js.map +1 -1
- package/build/template/components/ViewModeToggle.d.ts +3 -0
- package/build/template/components/ViewModeToggle.d.ts.map +1 -0
- package/build/template/components/ViewModeToggle.js +9 -0
- package/build/template/components/ViewModeToggle.js.map +1 -0
- package/build/template/components/graphql/type-link.d.ts +2 -0
- package/build/template/components/graphql/type-link.d.ts.map +1 -1
- package/build/template/components/graphql/type-link.js +15 -3
- package/build/template/components/graphql/type-link.js.map +1 -1
- package/build/template/components/home/PlaygroundPreview.d.ts.map +1 -1
- package/build/template/components/home/PlaygroundPreview.js +3 -2
- package/build/template/components/home/PlaygroundPreview.js.map +1 -1
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.js +18 -5
- package/build/template/components/sidebar/SidebarItem.js.map +1 -1
- package/build/template/contexts/ReferenceConfigContext.d.ts +16 -0
- package/build/template/contexts/ReferenceConfigContext.d.ts.map +1 -0
- package/build/template/contexts/ReferenceConfigContext.js +14 -0
- package/build/template/contexts/ReferenceConfigContext.js.map +1 -0
- package/build/template/contexts/ViewModeContext.d.ts +14 -0
- package/build/template/contexts/ViewModeContext.d.ts.map +1 -0
- package/build/template/contexts/ViewModeContext.js +40 -0
- package/build/template/contexts/ViewModeContext.js.map +1 -0
- package/build/template/hooks/use-examples.d.ts +4 -1
- package/build/template/hooks/use-examples.d.ts.map +1 -1
- package/build/template/hooks/useAlignedColumns.d.ts +10 -0
- package/build/template/hooks/useAlignedColumns.d.ts.map +1 -0
- package/build/template/hooks/useAlignedColumns.js +17 -0
- package/build/template/hooks/useAlignedColumns.js.map +1 -0
- package/build/template/routes/changelog/ChangelogSidebar.d.ts +2 -2
- package/build/template/routes/changelog/ChangelogSidebar.d.ts.map +1 -1
- package/build/template/routes/changelog/ChangelogSidebar.js +4 -4
- package/build/template/routes/changelog/ChangelogSidebar.js.map +1 -1
- package/build/template/routes/examples/_.d.ts +12 -3
- package/build/template/routes/examples/_.d.ts.map +1 -1
- package/build/template/routes/examples/_index.d.ts +8 -2
- package/build/template/routes/examples/_index.d.ts.map +1 -1
- package/build/template/routes/examples/name.d.ts +12 -3
- package/build/template/routes/examples/name.d.ts.map +1 -1
- package/build/template/routes/examples/name.js +6 -2
- package/build/template/routes/examples/name.js.map +1 -1
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/reference.js +37 -10
- package/build/template/routes/reference.js.map +1 -1
- package/build/template/stores/changelog.d.ts +39 -39
- package/build/vite/plugins/core.d.ts.map +1 -1
- package/build/vite/plugins/core.js +6 -0
- package/build/vite/plugins/core.js.map +1 -1
- package/build/vite/plugins/examples.d.ts.map +1 -1
- package/build/vite/plugins/examples.js +10 -3
- package/build/vite/plugins/examples.js.map +1 -1
- package/build/vite/plugins/index.d.ts +1 -0
- package/build/vite/plugins/index.d.ts.map +1 -1
- package/build/vite/plugins/index.js +1 -0
- package/build/vite/plugins/index.js.map +1 -1
- package/build/vite/plugins/navbar.d.ts.map +1 -1
- package/build/vite/plugins/navbar.js +3 -1
- package/build/vite/plugins/navbar.js.map +1 -1
- package/build/vite/plugins/reference.d.ts +19 -0
- package/build/vite/plugins/reference.d.ts.map +1 -0
- package/build/vite/plugins/reference.js +96 -0
- package/build/vite/plugins/reference.js.map +1 -0
- package/build/vite/plugins/schemas.d.ts.map +1 -1
- package/build/vite/plugins/schemas.js +38 -2
- package/build/vite/plugins/schemas.js.map +1 -1
- package/package.json +1 -1
- package/src/api/config/input.ts +2 -0
- package/src/api/config/normalized.ts +54 -0
- package/src/api/config-template/template.ts +18 -1
- package/src/api/examples/diagnostic/diagnostic.ts +0 -3
- package/src/api/examples/scanner.test.ts +83 -0
- package/src/api/examples/scanner.ts +31 -21
- package/src/api/examples/schemas/example/example.ts +6 -0
- package/src/api/reference/$.ts +3 -0
- package/src/api/reference/catalog.ts +55 -0
- package/src/api/reference/config.ts +193 -0
- package/src/api/reference/scanner.ts +53 -0
- package/src/api/schema/augmentations/$$.ts +6 -0
- package/src/api/schema/augmentations/$.ts +1 -1
- package/src/api/schema/augmentations/apply.test.ts +89 -0
- package/src/api/schema/augmentations/apply.ts +277 -0
- package/src/api/schema/augmentations/augmentation.ts +24 -0
- package/src/api/schema/augmentations/config.ts +11 -0
- package/src/api/schema/augmentations/diagnostics/diagnostic.ts +20 -0
- package/src/api/schema/augmentations/diagnostics/duplicate-version.ts +20 -0
- package/src/api/schema/augmentations/diagnostics/invalid-path.ts +21 -0
- package/src/api/schema/augmentations/diagnostics/version-mismatch.ts +21 -0
- package/src/api/schema/augmentations/input.test.ts +144 -0
- package/src/api/schema/augmentations/input.ts +215 -0
- package/src/api/schema/augmentations/placement.ts +11 -0
- package/src/api/schema/config-schema.ts +2 -2
- package/src/api/schema/input-source/load.ts +2 -0
- package/src/api/schema/load.ts +19 -2
- package/src/lib/grafaid/schema/format-default-value.ts +22 -0
- package/src/lib/grafaid/schema/schema.ts +2 -0
- package/src/lib/graphql-path/$$.ts +7 -13
- package/src/lib/graphql-path/$.test.ts +175 -0
- package/src/lib/graphql-path/definition.ts +162 -162
- package/src/lib/graphql-path/query.ts +15 -98
- package/src/lib/graphql-path/schema.ts +136 -0
- package/src/lib/graphql-path/types.ts +108 -28
- package/src/lib/version-coverage/version-coverage.ts +48 -6
- package/src/template/components/ArgumentAnnotation.tsx +58 -9
- package/src/template/components/ArgumentListAnnotation.tsx +50 -17
- package/src/template/components/Changelog/groups/FieldArgument.tsx +0 -1
- package/src/template/components/CodeBlock.tsx +1 -0
- package/src/template/components/Description.tsx +1 -1
- package/src/template/components/ExampleLink.tsx +2 -1
- package/src/template/components/Field.tsx +148 -20
- package/src/template/components/FieldList.tsx +28 -13
- package/src/template/components/FieldListSection.tsx +12 -2
- package/src/template/components/GraphQLDocument.tsx +2 -0
- package/src/template/components/GraphQLInteractive/GraphQLInteractive.tsx +6 -1
- package/src/template/components/GraphQLInteractive/lib/parser.ts +16 -3
- package/src/template/components/IAPIndicator.tsx +73 -0
- package/src/template/components/Link.tsx +9 -3
- package/src/template/components/NamedType.tsx +54 -28
- package/src/template/components/ReferenceLink.tsx +16 -10
- package/src/template/components/TypeAnnotation.tsx +17 -5
- package/src/template/components/ViewModeToggle.tsx +27 -0
- package/src/template/components/graphql/type-link.tsx +34 -3
- package/src/template/components/home/PlaygroundPreview.tsx +3 -0
- package/src/template/components/sidebar/SidebarItem.tsx +21 -5
- package/src/template/contexts/ReferenceConfigContext.tsx +37 -0
- package/src/template/contexts/ViewModeContext.tsx +64 -0
- package/src/template/hooks/useAlignedColumns.ts +19 -0
- package/src/template/routes/changelog/ChangelogSidebar.tsx +4 -4
- package/src/template/routes/examples/name.tsx +13 -1
- package/src/template/routes/reference.tsx +67 -23
- package/src/types/virtual-modules.d.ts +5 -0
- package/src/vite/plugins/core.ts +6 -0
- package/src/vite/plugins/examples.ts +12 -2
- package/src/vite/plugins/index.ts +1 -0
- package/src/vite/plugins/navbar.ts +4 -1
- package/src/vite/plugins/reference.ts +130 -0
- package/src/vite/plugins/schemas.ts +51 -2
- package/build/api/examples/diagnostic/unused-default.d.ts +0 -49
- package/build/api/examples/diagnostic/unused-default.d.ts.map +0 -1
- package/build/api/examples/diagnostic/unused-default.js +0 -19
- package/build/api/examples/diagnostic/unused-default.js.map +0 -1
- package/build/api/schema/augmentations/augmentations/description.d.ts +0 -26
- package/build/api/schema/augmentations/augmentations/description.d.ts.map +0 -1
- package/build/api/schema/augmentations/augmentations/description.js +0 -55
- package/build/api/schema/augmentations/augmentations/description.js.map +0 -1
- package/build/api/schema/augmentations/schema-augmentation.d.ts +0 -20
- package/build/api/schema/augmentations/schema-augmentation.d.ts.map +0 -1
- package/build/api/schema/augmentations/schema-augmentation.js +0 -22
- package/build/api/schema/augmentations/schema-augmentation.js.map +0 -1
- package/build/api/schema/augmentations/target.d.ts +0 -25
- package/build/api/schema/augmentations/target.d.ts.map +0 -1
- package/build/api/schema/augmentations/target.js +0 -39
- package/build/api/schema/augmentations/target.js.map +0 -1
- package/build/lib/graphql-path/constructors.d.ts +0 -57
- package/build/lib/graphql-path/constructors.d.ts.map +0 -1
- package/build/lib/graphql-path/constructors.js +0 -73
- package/build/lib/graphql-path/constructors.js.map +0 -1
- package/build/template/components/ArgumentList.d.ts +0 -6
- package/build/template/components/ArgumentList.d.ts.map +0 -1
- package/build/template/components/ArgumentList.js +0 -9
- package/build/template/components/ArgumentList.js.map +0 -1
- package/src/api/examples/diagnostic/unused-default.ts +0 -22
- package/src/api/schema/augmentations/augmentations/description.ts +0 -69
- package/src/api/schema/augmentations/schema-augmentation.ts +0 -32
- package/src/api/schema/augmentations/target.ts +0 -61
- package/src/lib/graphql-path/constructors.ts +0 -81
- 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
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
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(
|
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
|
// /**
|
package/src/api/schema/load.ts
CHANGED
@@ -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.
|
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.
|
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
|
+
}
|
@@ -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
|
-
* //
|
26
|
-
* const queryPath = GraphQLPath.Query.
|
27
|
-
*
|
28
|
-
*
|
29
|
-
*
|
30
|
-
*
|
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'
|