From d19d3993abb68ff250bc7b22fa1f9b6fb5ba75c9 Mon Sep 17 00:00:00 2001 From: Jason Kuhrt Date: Sun, 15 Dec 2024 21:19:54 -0500 Subject: [PATCH] refactor: preset entrypoints (#1280) --- .github/workflows/pr.yml | 7 + eslint.config.js | 2 +- examples/$/graffle/_.ts | 10 + examples/$/graffle/__.ts | 2 + examples/$/graffle/modules/client.ts | 21 + examples/$/graffle/modules/data.ts | 4 + examples/$/graffle/modules/global.ts | 25 + .../$/graffle/modules/methods-document.ts | 20 + examples/$/graffle/modules/methods-root.ts | 167 ++ examples/$/graffle/modules/methods-select.ts | 145 ++ examples/$/graffle/modules/scalar.ts | 39 + .../graffle/modules/schema-driven-data-map.ts | 475 ++++ examples/$/graffle/modules/schema.ts | 1137 ++++++++++ examples/$/graffle/modules/select.ts | 108 + examples/$/graffle/modules/selection-sets.ts | 1953 +++++++++++++++++ .../10_transport-http/transport-http_abort.ts | 2 +- ...port-http_extension_fetch__custom-fetch.ts | 2 +- ...-http_extension_headers__dynamicHeaders.ts | 2 +- .../transport-http_headers_raw__headers.ts | 2 +- .../transport-http_method-get.ts | 2 +- .../10_transport-http/transport-http_raw.ts | 4 +- examples/20_output/output_default.ts | 2 +- examples/20_output/output_envelope.ts | 2 +- ...envelope_envelope-error__envelope-error.ts | 2 +- ...elope_error-throw__envelope-error-throw.ts | 2 +- .../output_preset__standard-graphql.ts | 2 +- examples/20_output/output_return-error.ts | 2 +- ...error-execution__return-error-execution.ts | 2 +- examples/30_gql/gql_gql-document-node.ts | 6 +- ...ent-node-typed__gql-document-node-typed.ts | 2 +- examples/30_gql/gql_gql-string.ts | 2 +- ..._gql-string_gql-typed__gql-string-typed.ts | 2 +- examples/35_custom-scalar/custom-scalar.ts | 2 +- examples/40_other/transport-memory.ts | 4 +- .../anyware_jump-start__jump-start.ts | 2 +- .../anyware_short-circuit__short-circuit.ts | 2 +- .../anyware_slot_slot-body__slot-body.ts | 2 +- ...ware_slot_slot-body__slot-search-params.ts | 2 +- .../anyware_slot_slot-fetch__slot-fetch.ts | 2 +- .../document-builder_alias.ts | 2 +- .../document-builder_arguments.ts | 6 +- .../document-builder_batch.ts | 2 +- .../document-builder_directive.ts | 2 +- .../document-builder_document.ts | 2 +- .../document-builder_interface.ts | 2 +- .../document-builder_root-field.ts | 2 +- .../document-builder_union.ts | 2 +- .../extension_introspection__introspection.ts | 4 +- .../extension_opentelemetry__opentelemetry.ts | 4 +- .../60_extension/extension_throws__throws.ts | 4 +- .../{preset_none.ts => preset_bare.ts} | 10 +- examples/65_preset/preset_minimal.ts | 8 +- ...tension_headers__dynamicHeaders.output.txt | 2 +- .../20_output/output_envelope.output.txt | 2 +- ...output_preset__standard-graphql.output.txt | 6 +- ...on_introspection__introspection.output.txt | 4 +- ...on_opentelemetry__opentelemetry.output.txt | 70 +- ...none.output.txt => preset_bare.output.txt} | 0 examples/package.json | 19 + examples/pnpm-lock.yaml | 328 +++ examples/tsconfig.json | 33 + package.json | 16 +- .../generate-docs.ts | 29 +- src/client/properties/gql/gql.test-d.ts | 6 +- src/entrypoints/_Graffle.ts | 2 +- src/entrypoints/presets/__GraffleBare.ts | 1 - src/entrypoints/presets/__GraffleBasic.ts | 1 - src/entrypoints/presets/__GraffleMinimal.ts | 1 - src/entrypoints/presets/_bare.ts | 5 + src/entrypoints/presets/_basic.ts | 29 + src/entrypoints/presets/_minimal.ts | 28 + src/entrypoints/presets/bare.ts | 6 +- src/entrypoints/presets/basic.ts | 30 +- src/entrypoints/presets/minimal.ts | 29 +- src/extensions/Upload/Upload.test.ts | 2 +- src/generator/generators/Client.ts | 2 +- src/generator/generators/Data.ts | 2 +- src/generator/generators/Scalar.ts | 2 +- src/generator/generators/Schema.ts | 2 +- src/generator/generators/Select.ts | 2 +- src/generator/generators/global.ts | 2 +- tests/_/helpers.ts | 4 +- tests/_/schemas/pokemon/schema.graphql | 129 ++ ...reset_none.test.ts => preset_bare.test.ts} | 6 +- tsconfig.json | 2 +- website/.vitepress/config.ts | 4 +- .../example-links/{none.md => bare.md} | 2 +- .../content/_snippets/example-links/preset.md | 2 +- .../{preset_none.md => preset_bare.md} | 2 +- .../examples/anyware/jump-start.detail.md | 6 + .../_snippets/examples/anyware/jump-start.md | 6 + .../examples/anyware/short-circuit.detail.md | 6 + .../examples/anyware/short-circuit.md | 6 + .../examples/anyware/slot-body.detail.md | 6 + .../_snippets/examples/anyware/slot-body.md | 6 + .../examples/anyware/slot-fetch.detail.md | 6 + .../_snippets/examples/anyware/slot-fetch.md | 6 + .../anyware/slot-search-params.detail.md | 6 + .../examples/anyware/slot-search-params.md | 6 + .../custom-scalar/custom-scalar.detail.md | 6 + .../examples/custom-scalar/custom-scalar.md | 6 + .../examples/document-builder/alias.detail.md | 6 + .../examples/document-builder/alias.md | 6 + .../document-builder/arguments.detail.md | 10 +- .../examples/document-builder/arguments.md | 10 +- .../examples/document-builder/batch.detail.md | 6 + .../examples/document-builder/batch.md | 6 + .../document-builder/directive.detail.md | 6 + .../examples/document-builder/directive.md | 6 + .../document-builder/document.detail.md | 6 + .../examples/document-builder/document.md | 6 + .../document-builder/interface.detail.md | 6 + .../examples/document-builder/interface.md | 6 + .../document-builder/root-field.detail.md | 6 + .../examples/document-builder/root-field.md | 6 + .../examples/document-builder/union.detail.md | 6 + .../examples/document-builder/union.md | 6 + .../extension/introspection.detail.md | 10 +- .../examples/extension/introspection.md | 10 +- .../extension/opentelemetry.detail.md | 76 +- .../examples/extension/opentelemetry.md | 76 +- .../examples/extension/throws.detail.md | 6 + .../_snippets/examples/extension/throws.md | 6 + .../gql/gql-document-node-typed.detail.md | 8 +- .../examples/gql/gql-document-node-typed.md | 8 +- .../examples/gql/gql-document-node.detail.md | 10 +- .../examples/gql/gql-document-node.md | 10 +- .../examples/gql/gql-string-typed.detail.md | 6 + .../examples/gql/gql-string-typed.md | 6 + .../examples/gql/gql-string.detail.md | 6 + .../_snippets/examples/gql/gql-string.md | 6 + .../examples/other/transport-memory.detail.md | 10 +- .../examples/other/transport-memory.md | 10 +- .../examples/output/default.detail.md | 6 + .../_snippets/examples/output/default.md | 6 + .../output/envelope-error-throw.detail.md | 6 + .../examples/output/envelope-error-throw.md | 6 + .../examples/output/envelope-error.detail.md | 6 + .../examples/output/envelope-error.md | 6 + .../examples/output/envelope.detail.md | 8 +- .../_snippets/examples/output/envelope.md | 8 +- .../output/return-error-execution.detail.md | 6 + .../examples/output/return-error-execution.md | 6 + .../examples/output/return-error.detail.md | 6 + .../_snippets/examples/output/return-error.md | 6 + .../output/standard-graphql.detail.md | 12 +- .../examples/output/standard-graphql.md | 12 +- .../preset/{none.detail.md => bare.detail.md} | 18 +- .../examples/preset/{none.md => bare.md} | 18 +- .../examples/preset/minimal.detail.md | 12 +- .../_snippets/examples/preset/minimal.md | 12 +- .../examples/transport-http/abort.detail.md | 6 + .../examples/transport-http/abort.md | 6 + .../transport-http/custom-fetch.detail.md | 6 + .../examples/transport-http/custom-fetch.md | 6 + .../transport-http/dynamic-headers.detail.md | 8 +- .../transport-http/dynamic-headers.md | 8 +- .../examples/transport-http/headers.detail.md | 6 + .../examples/transport-http/headers.md | 6 + .../transport-http/method-get.detail.md | 6 + .../examples/transport-http/method-get.md | 6 + .../examples/transport-http/raw.detail.md | 6 + .../_snippets/examples/transport-http/raw.md | 6 + .../examples/10_transport-http/abort.md | 6 + .../10_transport-http/custom-fetch.md | 6 + .../10_transport-http/dynamic-headers.md | 8 +- .../examples/10_transport-http/headers.md | 6 + .../examples/10_transport-http/method-get.md | 6 + .../content/examples/10_transport-http/raw.md | 6 + website/content/examples/20_output/default.md | 6 + .../20_output/envelope-error-throw.md | 6 + .../examples/20_output/envelope-error.md | 6 + .../content/examples/20_output/envelope.md | 8 +- .../20_output/return-error-execution.md | 6 + .../examples/20_output/return-error.md | 6 + .../examples/20_output/standard-graphql.md | 12 +- .../30_gql/gql-document-node-typed.md | 8 +- .../examples/30_gql/gql-document-node.md | 10 +- .../examples/30_gql/gql-string-typed.md | 6 + website/content/examples/30_gql/gql-string.md | 6 + .../35_custom-scalar/custom-scalar.md | 6 + .../examples/40_other/transport-memory.md | 10 +- .../content/examples/50_anyware/jump-start.md | 6 + .../examples/50_anyware/short-circuit.md | 6 + .../content/examples/50_anyware/slot-body.md | 6 + .../content/examples/50_anyware/slot-fetch.md | 6 + .../examples/50_anyware/slot-search-params.md | 6 + .../examples/55_document-builder/alias.md | 6 + .../examples/55_document-builder/arguments.md | 10 +- .../examples/55_document-builder/batch.md | 6 + .../examples/55_document-builder/directive.md | 6 + .../examples/55_document-builder/document.md | 6 + .../examples/55_document-builder/interface.md | 6 + .../55_document-builder/root-field.md | 6 + .../examples/55_document-builder/union.md | 6 + .../examples/60_extension/introspection.md | 10 +- .../examples/60_extension/opentelemetry.md | 76 +- .../content/examples/60_extension/throws.md | 6 + .../examples/65_preset/{none.md => bare.md} | 18 +- website/content/examples/65_preset/minimal.md | 12 +- .../graffle/modules/{Client.ts => client.ts} | 0 website/graffle/modules/{Data.ts => data.ts} | 0 .../graffle/modules/{Global.ts => global.ts} | 0 .../graffle/modules/{Scalar.ts => scalar.ts} | 0 .../graffle/modules/{Schema.ts => schema.ts} | 0 .../graffle/modules/{Select.ts => select.ts} | 0 website/package.json | 6 +- website/pnpm-lock.yaml | 149 +- 208 files changed, 5815 insertions(+), 387 deletions(-) create mode 100644 examples/$/graffle/_.ts create mode 100644 examples/$/graffle/__.ts create mode 100644 examples/$/graffle/modules/client.ts create mode 100644 examples/$/graffle/modules/data.ts create mode 100644 examples/$/graffle/modules/global.ts create mode 100644 examples/$/graffle/modules/methods-document.ts create mode 100644 examples/$/graffle/modules/methods-root.ts create mode 100644 examples/$/graffle/modules/methods-select.ts create mode 100644 examples/$/graffle/modules/scalar.ts create mode 100644 examples/$/graffle/modules/schema-driven-data-map.ts create mode 100644 examples/$/graffle/modules/schema.ts create mode 100644 examples/$/graffle/modules/select.ts create mode 100644 examples/$/graffle/modules/selection-sets.ts rename examples/65_preset/{preset_none.ts => preset_bare.ts} (81%) rename examples/__outputs__/65_preset/{preset_none.output.txt => preset_bare.output.txt} (100%) create mode 100644 examples/package.json create mode 100644 examples/pnpm-lock.yaml create mode 100644 examples/tsconfig.json delete mode 100644 src/entrypoints/presets/__GraffleBare.ts delete mode 100644 src/entrypoints/presets/__GraffleBasic.ts delete mode 100644 src/entrypoints/presets/__GraffleMinimal.ts create mode 100644 src/entrypoints/presets/_bare.ts create mode 100644 src/entrypoints/presets/_basic.ts create mode 100644 src/entrypoints/presets/_minimal.ts create mode 100644 tests/_/schemas/pokemon/schema.graphql rename tests/examples/65_preset/{preset_none.test.ts => preset_bare.test.ts} (85%) rename website/content/_snippets/example-links/{none.md => bare.md} (52%) rename website/content/_snippets/example-links/{preset_none.md => preset_bare.md} (52%) rename website/content/_snippets/examples/preset/{none.detail.md => bare.detail.md} (64%) rename website/content/_snippets/examples/preset/{none.md => bare.md} (64%) rename website/content/examples/65_preset/{none.md => bare.md} (68%) rename website/graffle/modules/{Client.ts => client.ts} (100%) rename website/graffle/modules/{Data.ts => data.ts} (100%) rename website/graffle/modules/{Global.ts => global.ts} (100%) rename website/graffle/modules/{Scalar.ts => scalar.ts} (100%) rename website/graffle/modules/{Schema.ts => schema.ts} (100%) rename website/graffle/modules/{Select.ts => select.ts} (100%) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 54cd53b35..fd634b979 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,6 +13,10 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup + - run: pnpm build + - name: Install Examples Dependencies + working-directory: examples + run: pnpm install - run: pnpm check:lint publint: runs-on: ubuntu-latest @@ -81,6 +85,9 @@ jobs: with: node-version: ${{ matrix.node }} - run: pnpm build + - name: Install Examples Dependencies + working-directory: examples + run: pnpm install - run: pnpm test:examples -- --environment ${{ matrix.environment }} test-e2e: runs-on: ubuntu-latest diff --git a/eslint.config.js b/eslint.config.js index adf7ca50d..8870ad62a 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -16,7 +16,7 @@ export default tsEslint.config({ 'src/layers/1_Schema/Hybrid/types/Scalar/Scalar.ts', // There is an ESLint error that goes away when ignored leading to a circular issue of either lint error or unused lint disable. '**/$/**/*', 'legacy/**/*', - 'build/**/*', + '**/build/**/*', 'website/**/*', ], extends: configPrisma, diff --git a/examples/$/graffle/_.ts b/examples/$/graffle/_.ts new file mode 100644 index 000000000..122d02128 --- /dev/null +++ b/examples/$/graffle/_.ts @@ -0,0 +1,10 @@ +// We import the global module for good measure although it is not clear it is always needed. +// It at least helps with Twoslash wherein without this import here Twoslash will not include the global module. +// In real TypeScript projects it seems the global module is included automatically. But there could be certain tsconfig +// setups where this still indeed does help. +import './modules/global.js' + +export { create } from './modules/client.js' +export { schemaDrivenDataMap as schemaMap } from './modules/schema-driven-data-map.js' +export { Select } from './modules/select.js' +export * as SelectionSets from './modules/selection-sets.js' diff --git a/examples/$/graffle/__.ts b/examples/$/graffle/__.ts new file mode 100644 index 000000000..25eb596de --- /dev/null +++ b/examples/$/graffle/__.ts @@ -0,0 +1,2 @@ +export * as Graffle from './_.js' +export { schemaDrivenDataMap as schemaMap } from './modules/schema-driven-data-map.js' diff --git a/examples/$/graffle/modules/client.ts b/examples/$/graffle/modules/client.ts new file mode 100644 index 000000000..2825419df --- /dev/null +++ b/examples/$/graffle/modules/client.ts @@ -0,0 +1,21 @@ +import { TransportHttp } from 'graffle/extensions/transport-http' +import * as $$Utilities from 'graffle/utilities-for-generated' +import * as $$Data from './data.js' +import * as $$Scalar from './scalar.js' +import * as $$SchemaDrivenDataMap from './schema-driven-data-map.js' + +const context = $$Utilities.useReducer( + { + ...$$Utilities.Context.States.contextEmpty, + name: $$Data.Name, + schemaMap: $$SchemaDrivenDataMap.schemaDrivenDataMap, + scalars: $$Scalar.$registry, + }, + TransportHttp({ + url: $$Data.defaultSchemaUrl, + }), +) + +export const create = $$Utilities.createConstructorWithContext( + context, +) diff --git a/examples/$/graffle/modules/data.ts b/examples/$/graffle/modules/data.ts new file mode 100644 index 000000000..c63a2cc53 --- /dev/null +++ b/examples/$/graffle/modules/data.ts @@ -0,0 +1,4 @@ +export const Name = `default` +export type Name = 'default' + +export const defaultSchemaUrl = new URL('http://localhost:3000/graphql') diff --git a/examples/$/graffle/modules/global.ts b/examples/$/graffle/modules/global.ts new file mode 100644 index 000000000..33f0d1dc1 --- /dev/null +++ b/examples/$/graffle/modules/global.ts @@ -0,0 +1,25 @@ +import * as $$Data from './data.js' +import * as $$MethodsDocument from './methods-document.js' +import * as $$MethodsRoot from './methods-root.js' +import * as $$MethodsSelect from './methods-select.js' +import * as $$Schema from './schema.js' + +declare global { + export namespace GraffleGlobal { + export interface Clients { + default: { + name: $$Data.Name + schema: $$Schema.Schema + interfaces: { + MethodsSelect: $$MethodsSelect.$MethodsSelect + Document: $$MethodsDocument.BuilderMethodsDocumentFn + Root: $$MethodsRoot.BuilderMethodsRootFn + } + /** + * http://localhost:3000/graphql + */ + defaultSchemaUrl: string + } + } + } +} diff --git a/examples/$/graffle/modules/methods-document.ts b/examples/$/graffle/modules/methods-document.ts new file mode 100644 index 000000000..9bb35d9f7 --- /dev/null +++ b/examples/$/graffle/modules/methods-document.ts @@ -0,0 +1,20 @@ +import type * as $$Utilities from 'graffle/utilities-for-generated' +import * as $$Schema from './schema.js' +import * as $$SelectionSets from './selection-sets.js' + +export interface Document<$Context extends $$Utilities.Context> { + <$Document>( + document: $$Utilities.ExactNonEmpty<$Document, $$SelectionSets.$Document<$Context['scalars']>>, + ): $$Utilities.DocumentRunner< + $Context, + $$Schema.Schema, + // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as + // Satisfying the constraint on the DocumentRunner type. + $Document + > +} + +export interface BuilderMethodsDocumentFn extends $$Utilities.TypeFunction { + // @ts-expect-error parameter is Untyped. + return: Document +} diff --git a/examples/$/graffle/modules/methods-root.ts b/examples/$/graffle/modules/methods-root.ts new file mode 100644 index 000000000..203886885 --- /dev/null +++ b/examples/$/graffle/modules/methods-root.ts @@ -0,0 +1,167 @@ +import type { InferResult } from 'graffle/schema' +import type * as $$Utilities from 'graffle/utilities-for-generated' +import * as $$Schema from './schema.js' +import * as $$SelectionSets from './selection-sets.js' + +export interface QueryMethods<$Context extends $$Utilities.Context> { + $batch: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutput< + $Context, + InferResult.OperationQuery<$$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']>> + > + > + > + __typename: $$Utilities.ClientTransports.PreflightCheck< + $Context, + () => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + { __typename: 'Query' }, + '__typename' + > + > + > + + battles: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query.battles<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationQuery<{ battles: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + 'battles' + > + > + > + + beings: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query.beings<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationQuery<{ beings: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + 'beings' + > + > + > + + pokemonByName: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query.pokemonByName<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationQuery<{ pokemonByName: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + 'pokemonByName' + > + > + > + + pokemons: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query.pokemons<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationQuery<{ pokemons: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + 'pokemons' + > + > + > + + trainerByName: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query.trainerByName<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationQuery<{ trainerByName: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + 'trainerByName' + > + > + > + + trainers: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query.trainers<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationQuery<{ trainers: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + 'trainers' + > + > + > +} + +export interface MutationMethods<$Context extends $$Utilities.Context> { + $batch: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Mutation<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutput< + $Context, + InferResult.OperationMutation< + $$Utilities.AssertExtendsObject<$SelectionSet>, + $$Schema.Schema<$Context['scalars']> + > + > + > + > + __typename: $$Utilities.ClientTransports.PreflightCheck< + $Context, + () => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + { __typename: 'Mutation' }, + '__typename' + > + > + > + + addPokemon: $$Utilities.ClientTransports.PreflightCheck< + $Context, + <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Mutation.addPokemon<$Context['scalars']>>, + ) => Promise< + & (null | {}) + & $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ addPokemon: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + 'addPokemon' + > + > + > +} + +export interface BuilderMethodsRoot<$Context extends $$Utilities.Context> { + query: QueryMethods<$Context> + mutation: MutationMethods<$Context> +} + +export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction { + // @ts-expect-error parameter is Untyped. + return: BuilderMethodsRoot +} diff --git a/examples/$/graffle/modules/methods-select.ts b/examples/$/graffle/modules/methods-select.ts new file mode 100644 index 000000000..884ec06b6 --- /dev/null +++ b/examples/$/graffle/modules/methods-select.ts @@ -0,0 +1,145 @@ +import type * as $$Utilities from 'graffle/utilities-for-generated' +import * as $$SelectionSets from './selection-sets.js' + +// +// +// +// +// +// +// ================================================================================================== +// Select Methods Interface +// ================================================================================================== +// +// +// +// +// +// + +export interface $MethodsSelect { + Query: Query + Mutation: Mutation + BattleRoyale: BattleRoyale + BattleTrainer: BattleTrainer + BattleWild: BattleWild + CombatantMultiPokemon: CombatantMultiPokemon + CombatantSinglePokemon: CombatantSinglePokemon + Patron: Patron + Pokemon: Pokemon + Trainer: Trainer + Battle: Battle + Being: Being +} + +// +// +// +// +// +// +// ================================================================================================== +// Root +// ================================================================================================== +// +// +// +// +// +// + +export interface Query { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Query>): $SelectionSet +} + +export interface Mutation { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Mutation>): $SelectionSet +} + +// +// +// +// +// +// +// ================================================================================================== +// OutputObject +// ================================================================================================== +// +// +// +// +// +// + +export interface BattleRoyale { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.BattleRoyale>): $SelectionSet +} + +export interface BattleTrainer { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.BattleTrainer>): $SelectionSet +} + +export interface BattleWild { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.BattleWild>): $SelectionSet +} + +export interface CombatantMultiPokemon { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.CombatantMultiPokemon>): $SelectionSet +} + +export interface CombatantSinglePokemon { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.CombatantSinglePokemon>): $SelectionSet +} + +export interface Patron { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Patron>): $SelectionSet +} + +export interface Pokemon { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Pokemon>): $SelectionSet +} + +export interface Trainer { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Trainer>): $SelectionSet +} + +// +// +// +// +// +// +// ================================================================================================== +// Union +// ================================================================================================== +// +// +// +// +// +// + +export interface Battle { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Battle>): $SelectionSet +} + +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// + +export interface Being { + <$SelectionSet>(selectionSet: $$Utilities.Exact<$SelectionSet, $$SelectionSets.Being>): $SelectionSet +} diff --git a/examples/$/graffle/modules/scalar.ts b/examples/$/graffle/modules/scalar.ts new file mode 100644 index 000000000..c7798c5e1 --- /dev/null +++ b/examples/$/graffle/modules/scalar.ts @@ -0,0 +1,39 @@ +import type * as $$Utilities from 'graffle/utilities-for-generated' + +export * from 'graffle/generator-helpers/standard-scalar-types' + +// +// +// +// +// CUSTOM SCALAR TYPE +// DATE +// -------------------------------------------------------------------------------------------------- +// Date +// -------------------------------------------------------------------------------------------------- +// +// + +export type Date = $$Utilities.Schema.Scalar.ScalarCodecless<'Date'> + +// +// +// +// +// +// +// ================================================================================================== +// Registry +// ================================================================================================== +// +// +// +// +// +// + +export const $registry = { + map: {}, +} as $Registry + +export type $Registry = $$Utilities.Schema.Scalar.Registry.Empty diff --git a/examples/$/graffle/modules/schema-driven-data-map.ts b/examples/$/graffle/modules/schema-driven-data-map.ts new file mode 100644 index 000000000..a4973ab8b --- /dev/null +++ b/examples/$/graffle/modules/schema-driven-data-map.ts @@ -0,0 +1,475 @@ +import type * as $$Utilities from 'graffle/utilities-for-generated' +import * as $$Scalar from './scalar.js' +// +// +// +// +// +// +// ================================================================================================== +// ScalarStandard +// ================================================================================================== +// +// +// +// +// +// + +const Float = $$Scalar.Float + +const ID = $$Scalar.ID + +const String = $$Scalar.String + +const Int = $$Scalar.Int + +const Boolean = $$Scalar.Boolean + +// +// +// +// +// +// +// ================================================================================================== +// ScalarCustom +// ================================================================================================== +// +// +// +// +// +// + +const Date = 'Date' + +// +// +// +// +// +// +// ================================================================================================== +// Enum +// ================================================================================================== +// +// +// +// +// +// + +const BattleWildResult: $$Utilities.SchemaDrivenDataMap.Enum = { + k: 'enum', + n: 'BattleWildResult', +} + +const PokemonType: $$Utilities.SchemaDrivenDataMap.Enum = { + k: 'enum', + n: 'PokemonType', +} + +const TrainerClass: $$Utilities.SchemaDrivenDataMap.Enum = { + k: 'enum', + n: 'TrainerClass', +} + +// +// +// +// +// +// +// ================================================================================================== +// InputObject +// ================================================================================================== +// +// +// +// +// +// + +const DateFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { + n: 'DateFilter', + fcs: ['gte', 'lte'], + f: { + gte: { + nt: Date, + }, + lte: { + nt: Date, + }, + }, +} + +const PokemonFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { + n: 'PokemonFilter', + fcs: ['birthday'], + f: { + birthday: { + // nt: DateFilter, <-- Assigned later to avoid potential circular dependency. + }, + name: {}, + type: {}, + }, +} + +const StringFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { + n: 'StringFilter', + f: { + contains: {}, + in: {}, + }, +} + +// +// +// +// +// +// +// ================================================================================================== +// OutputObject +// ================================================================================================== +// +// +// +// +// +// + +const BattleRoyale: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + combatants: { + // nt: CombatantMultiPokemon, <-- Assigned later to avoid potential circular dependency. + }, + date: {}, + id: {}, + winner: { + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +const BattleTrainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + combatant1: { + // nt: CombatantSinglePokemon, <-- Assigned later to avoid potential circular dependency. + }, + combatant2: { + // nt: CombatantSinglePokemon, <-- Assigned later to avoid potential circular dependency. + }, + date: {}, + id: {}, + winner: { + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +const BattleWild: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + date: {}, + id: {}, + pokemon: { + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + result: {}, + trainer: { + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + wildPokemons: { + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +const CombatantMultiPokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + pokemons: { + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + trainer: { + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +const CombatantSinglePokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + pokemon: { + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + trainer: { + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +const Patron: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + id: {}, + money: {}, + name: {}, + }, +} + +const Pokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + attack: {}, + birthday: { + nt: Date, + }, + defense: {}, + hp: {}, + id: {}, + name: {}, + trainer: { + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + type: {}, + }, +} + +const Trainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + class: {}, + fans: { + // nt: Patron, <-- Assigned later to avoid potential circular dependency. + }, + id: {}, + name: {}, + pokemon: { + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// + +const Being: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + ...Pokemon.f, + ...Trainer.f, + }, +} + +// +// +// +// +// +// +// ================================================================================================== +// Union +// ================================================================================================== +// +// +// +// +// +// + +const Battle: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + ...BattleRoyale.f, + ...BattleTrainer.f, + ...BattleWild.f, + }, +} + +// +// +// +// +// +// +// ================================================================================================== +// Root +// ================================================================================================== +// +// +// +// +// +// + +const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + battles: { + // nt: Battle, <-- Assigned later to avoid potential circular dependency. + }, + beings: { + // nt: Being, <-- Assigned later to avoid potential circular dependency. + }, + pokemonByName: { + a: { + name: { + nt: String, + it: [1], + }, + }, + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + pokemons: { + a: { + filter: { + nt: PokemonFilter, + it: [0], + }, + }, + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + trainerByName: { + a: { + name: { + nt: String, + it: [1], + }, + }, + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + trainers: { + // nt: Trainer, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + addPokemon: { + a: { + attack: { + nt: Int, + it: [0], + }, + defense: { + nt: Int, + it: [0], + }, + hp: { + nt: Int, + it: [0], + }, + name: { + nt: String, + it: [1], + }, + type: { + nt: PokemonType, + it: [1], + }, + }, + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + +// +// +// +// +// +// +// ================================================================================================== +// Reference Assignments +// (avoids circular assignment issues) +// ================================================================================================== +// +// +// +// +// +// + +PokemonFilter.f![`birthday`]!.nt = DateFilter +BattleRoyale.f[`combatants`]!.nt = CombatantMultiPokemon +BattleRoyale.f[`winner`]!.nt = Trainer +BattleTrainer.f[`combatant1`]!.nt = CombatantSinglePokemon +BattleTrainer.f[`combatant2`]!.nt = CombatantSinglePokemon +BattleTrainer.f[`winner`]!.nt = Trainer +BattleWild.f[`pokemon`]!.nt = Pokemon +BattleWild.f[`trainer`]!.nt = Trainer +BattleWild.f[`wildPokemons`]!.nt = Pokemon +CombatantMultiPokemon.f[`pokemons`]!.nt = Pokemon +CombatantMultiPokemon.f[`trainer`]!.nt = Trainer +CombatantSinglePokemon.f[`pokemon`]!.nt = Pokemon +CombatantSinglePokemon.f[`trainer`]!.nt = Trainer +Pokemon.f[`trainer`]!.nt = Trainer +Trainer.f[`fans`]!.nt = Patron +Trainer.f[`pokemon`]!.nt = Pokemon +Query.f[`battles`]!.nt = Battle +Query.f[`beings`]!.nt = Being +Query.f[`pokemonByName`]!.nt = Pokemon +Query.f[`pokemons`]!.nt = Pokemon +Query.f[`trainerByName`]!.nt = Trainer +Query.f[`trainers`]!.nt = Trainer +Mutation.f[`addPokemon`]!.nt = Pokemon + +// +// +// +// +// +// +// ================================================================================================== +// Index +// ================================================================================================== +// +// +// +// +// +// + +const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { + operations: { + query: Query, + mutation: Mutation, + }, + directives: {}, + types: { + Float, + ID, + String, + Int, + Boolean, + Date, + BattleWildResult, + PokemonType, + TrainerClass, + DateFilter, + PokemonFilter, + StringFilter, + BattleRoyale, + BattleTrainer, + BattleWild, + CombatantMultiPokemon, + CombatantSinglePokemon, + Patron, + Pokemon, + Trainer, + Being, + Battle, + Query, + Mutation, + }, +} + +export { $schemaDrivenDataMap as schemaDrivenDataMap } diff --git a/examples/$/graffle/modules/schema.ts b/examples/$/graffle/modules/schema.ts new file mode 100644 index 000000000..627cd7228 --- /dev/null +++ b/examples/$/graffle/modules/schema.ts @@ -0,0 +1,1137 @@ +import type { Schema as $ } from 'graffle/utilities-for-generated' +import type * as $$Utilities from 'graffle/utilities-for-generated' +import * as $$Data from './data.js' +import * as $$Scalar from './scalar.js' + +export namespace Schema { + // + // + // + // + // + // + // ================================================================================================== + // Root + // ================================================================================================== + // + // + // + // + // + // + + // Query + // -------------------------------------------------------------------------------------------------- + // + + export interface Query extends $.OutputObject { + name: 'Query' + fields: { + __typename: Query.__typename + battles: Query.battles + beings: Query.beings + pokemonByName: Query.pokemonByName + pokemons: Query.pokemons + trainerByName: Query.trainerByName + trainers: Query.trainers + } + } + + export namespace Query { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Query' + } + } + + export interface battles extends $.OutputField { + name: 'battles' + arguments: {} + inlineType: [1, [1]] + namedType: $$NamedTypes.$$Battle + } + + export interface beings extends $.OutputField { + name: 'beings' + arguments: {} + inlineType: [1, [1]] + namedType: $$NamedTypes.$$Being + } + + export interface pokemonByName extends $.OutputField { + name: 'pokemonByName' + arguments: { + name: { + kind: 'InputField' + name: 'name' + inlineType: [1] + namedType: $$NamedTypes.$$String + } + } + inlineType: [0, [1]] + namedType: $$NamedTypes.$$Pokemon + } + + export interface pokemons extends $.OutputField { + name: 'pokemons' + arguments: { + filter: { + kind: 'InputField' + name: 'filter' + inlineType: [0] + namedType: $$NamedTypes.$$PokemonFilter + } + } + inlineType: [0, [1]] + namedType: $$NamedTypes.$$Pokemon + } + + export interface trainerByName extends $.OutputField { + name: 'trainerByName' + arguments: { + name: { + kind: 'InputField' + name: 'name' + inlineType: [1] + namedType: $$NamedTypes.$$String + } + } + inlineType: [0] + namedType: $$NamedTypes.$$Trainer + } + + export interface trainers extends $.OutputField { + name: 'trainers' + arguments: {} + inlineType: [0, [1]] + namedType: $$NamedTypes.$$Trainer + } + } + + // Mutation + // -------------------------------------------------------------------------------------------------- + // + + export interface Mutation extends $.OutputObject { + name: 'Mutation' + fields: { + __typename: Mutation.__typename + addPokemon: Mutation.addPokemon + } + } + + export namespace Mutation { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Mutation' + } + } + + export interface addPokemon extends $.OutputField { + name: 'addPokemon' + arguments: { + attack: { + kind: 'InputField' + name: 'attack' + inlineType: [0] + namedType: $$NamedTypes.$$Int + } + defense: { + kind: 'InputField' + name: 'defense' + inlineType: [0] + namedType: $$NamedTypes.$$Int + } + hp: { + kind: 'InputField' + name: 'hp' + inlineType: [0] + namedType: $$NamedTypes.$$Int + } + name: { + kind: 'InputField' + name: 'name' + inlineType: [1] + namedType: $$NamedTypes.$$String + } + type: { + kind: 'InputField' + name: 'type' + inlineType: [1] + namedType: $$NamedTypes.$$PokemonType + } + } + inlineType: [0] + namedType: $$NamedTypes.$$Pokemon + } + } + + // + // + // + // + // + // + // ================================================================================================== + // OutputObject + // ================================================================================================== + // + // + // + // + // + // + + // BattleRoyale + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleRoyale extends $.OutputObject { + name: 'BattleRoyale' + fields: { + __typename: BattleRoyale.__typename + combatants: BattleRoyale.combatants + date: BattleRoyale.date + id: BattleRoyale.id + winner: BattleRoyale.winner + } + } + + export namespace BattleRoyale { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'BattleRoyale' + } + } + + export interface combatants extends $.OutputField { + name: 'combatants' + arguments: {} + inlineType: [0, [1]] + namedType: $$NamedTypes.$$CombatantMultiPokemon + } + + export interface date extends $.OutputField { + name: 'date' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Float + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface winner extends $.OutputField { + name: 'winner' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Trainer + } + } + + // BattleTrainer + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleTrainer extends $.OutputObject { + name: 'BattleTrainer' + fields: { + __typename: BattleTrainer.__typename + combatant1: BattleTrainer.combatant1 + combatant2: BattleTrainer.combatant2 + date: BattleTrainer.date + id: BattleTrainer.id + winner: BattleTrainer.winner + } + } + + export namespace BattleTrainer { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'BattleTrainer' + } + } + + export interface combatant1 extends $.OutputField { + name: 'combatant1' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$CombatantSinglePokemon + } + + export interface combatant2 extends $.OutputField { + name: 'combatant2' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$CombatantSinglePokemon + } + + export interface date extends $.OutputField { + name: 'date' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Float + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface winner extends $.OutputField { + name: 'winner' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Trainer + } + } + + // BattleWild + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleWild extends $.OutputObject { + name: 'BattleWild' + fields: { + __typename: BattleWild.__typename + date: BattleWild.date + id: BattleWild.id + pokemon: BattleWild.pokemon + result: BattleWild.result + trainer: BattleWild.trainer + wildPokemons: BattleWild.wildPokemons + } + } + + export namespace BattleWild { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'BattleWild' + } + } + + export interface date extends $.OutputField { + name: 'date' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Float + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface pokemon extends $.OutputField { + name: 'pokemon' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Pokemon + } + + export interface result extends $.OutputField { + name: 'result' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$BattleWildResult + } + + export interface trainer extends $.OutputField { + name: 'trainer' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Trainer + } + + export interface wildPokemons extends $.OutputField { + name: 'wildPokemons' + arguments: {} + inlineType: [0, [1]] + namedType: $$NamedTypes.$$Pokemon + } + } + + // CombatantMultiPokemon + // -------------------------------------------------------------------------------------------------- + // + + export interface CombatantMultiPokemon extends $.OutputObject { + name: 'CombatantMultiPokemon' + fields: { + __typename: CombatantMultiPokemon.__typename + pokemons: CombatantMultiPokemon.pokemons + trainer: CombatantMultiPokemon.trainer + } + } + + export namespace CombatantMultiPokemon { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'CombatantMultiPokemon' + } + } + + export interface pokemons extends $.OutputField { + name: 'pokemons' + arguments: {} + inlineType: [0, [1]] + namedType: $$NamedTypes.$$Pokemon + } + + export interface trainer extends $.OutputField { + name: 'trainer' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Trainer + } + } + + // CombatantSinglePokemon + // -------------------------------------------------------------------------------------------------- + // + + export interface CombatantSinglePokemon extends $.OutputObject { + name: 'CombatantSinglePokemon' + fields: { + __typename: CombatantSinglePokemon.__typename + pokemon: CombatantSinglePokemon.pokemon + trainer: CombatantSinglePokemon.trainer + } + } + + export namespace CombatantSinglePokemon { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'CombatantSinglePokemon' + } + } + + export interface pokemon extends $.OutputField { + name: 'pokemon' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Pokemon + } + + export interface trainer extends $.OutputField { + name: 'trainer' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Trainer + } + } + + // Patron + // -------------------------------------------------------------------------------------------------- + // + + export interface Patron extends $.OutputObject { + name: 'Patron' + fields: { + __typename: Patron.__typename + id: Patron.id + money: Patron.money + name: Patron.name + } + } + + export namespace Patron { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Patron' + } + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface money extends $.OutputField { + name: 'money' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Int + } + + export interface name extends $.OutputField { + name: 'name' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$String + } + } + + // Pokemon + // -------------------------------------------------------------------------------------------------- + // + + export interface Pokemon extends $.OutputObject { + name: 'Pokemon' + fields: { + __typename: Pokemon.__typename + attack: Pokemon.attack + birthday: Pokemon.birthday + defense: Pokemon.defense + hp: Pokemon.hp + id: Pokemon.id + name: Pokemon.name + trainer: Pokemon.trainer + type: Pokemon.type + } + } + + export namespace Pokemon { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Pokemon' + } + } + + export interface attack extends $.OutputField { + name: 'attack' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$Int + } + + export interface birthday extends $.OutputField { + name: 'birthday' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$Date + } + + export interface defense extends $.OutputField { + name: 'defense' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$Int + } + + export interface hp extends $.OutputField { + name: 'hp' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$Int + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$ID + } + + export interface name extends $.OutputField { + name: 'name' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$String + } + + export interface trainer extends $.OutputField { + name: 'trainer' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$Trainer + } + + export interface type extends $.OutputField { + name: 'type' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$PokemonType + } + } + + // Trainer + // -------------------------------------------------------------------------------------------------- + // + + export interface Trainer extends $.OutputObject { + name: 'Trainer' + fields: { + __typename: Trainer.__typename + class: Trainer.$class + fans: Trainer.fans + id: Trainer.id + name: Trainer.name + pokemon: Trainer.pokemon + } + } + + export namespace Trainer { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Trainer' + } + } + + export interface $class extends $.OutputField { + name: 'class' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$TrainerClass + } + + export interface fans extends $.OutputField { + name: 'fans' + arguments: {} + inlineType: [0, [1]] + namedType: $$NamedTypes.$$Patron + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface name extends $.OutputField { + name: 'name' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$String + } + + export interface pokemon extends $.OutputField { + name: 'pokemon' + arguments: {} + inlineType: [0, [1]] + namedType: $$NamedTypes.$$Pokemon + } + } + + // + // + // + // + // + // + // ================================================================================================== + // InputObject + // ================================================================================================== + // + // + // + // + // + // + + // DateFilter + // -------------------------------------------------------------------------------------------------- + // + + export interface DateFilter extends $.InputObject { + name: 'DateFilter' + isAllFieldsNullable: true + fields: { + gte: DateFilter.gte + lte: DateFilter.lte + } + } + + export namespace DateFilter { + export interface gte extends $.InputField { + name: 'gte' + inlineType: [0] + namedType: $$NamedTypes.$$Date + } + + export interface lte extends $.InputField { + name: 'lte' + inlineType: [0] + namedType: $$NamedTypes.$$Date + } + } + + // PokemonFilter + // -------------------------------------------------------------------------------------------------- + // + + export interface PokemonFilter extends $.InputObject { + name: 'PokemonFilter' + isAllFieldsNullable: true + fields: { + birthday: PokemonFilter.birthday + name: PokemonFilter.name + type: PokemonFilter.type + } + } + + export namespace PokemonFilter { + export interface birthday extends $.InputField { + name: 'birthday' + inlineType: [0] + namedType: $$NamedTypes.$$DateFilter + } + + export interface name extends $.InputField { + name: 'name' + inlineType: [0] + namedType: $$NamedTypes.$$StringFilter + } + + export interface type extends $.InputField { + name: 'type' + inlineType: [0] + namedType: $$NamedTypes.$$PokemonType + } + } + + // StringFilter + // -------------------------------------------------------------------------------------------------- + // + + export interface StringFilter extends $.InputObject { + name: 'StringFilter' + isAllFieldsNullable: true + fields: { + contains: StringFilter.contains + in: StringFilter.$in + } + } + + export namespace StringFilter { + export interface contains extends $.InputField { + name: 'contains' + inlineType: [0] + namedType: $$NamedTypes.$$String + } + + export interface $in extends $.InputField { + name: 'in' + inlineType: [0, [1]] + namedType: $$NamedTypes.$$String + } + } + + // + // + // + // + // + // + // ================================================================================================== + // Interface + // ================================================================================================== + // + // + // + // + // + // + + // Being + // -------------------------------------------------------------------------------------------------- + // + + export interface Being extends $.Interface { + fields: { + id: Being.id + name: Being.name + } + name: 'Being' + implementors: [Patron, Pokemon, Trainer] + implementorsUnion: + | Patron + | Pokemon + | Trainer + implementorsIndex: { + Patron: Patron + Pokemon: Pokemon + Trainer: Trainer + } + } + + export namespace Being { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Being' + } + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface name extends $.OutputField { + name: 'name' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$String + } + } + + // + // + // + // + // + // + // ================================================================================================== + // Union + // ================================================================================================== + // + // + // + // + // + // + + // Battle + // -------------------------------------------------------------------------------------------------- + // + + export interface Battle extends $.Union { + name: 'Battle' + members: [BattleRoyale, BattleTrainer, BattleWild] + membersUnion: + | BattleRoyale + | BattleTrainer + | BattleWild + membersIndex: { + BattleRoyale: BattleRoyale + BattleTrainer: BattleTrainer + BattleWild: BattleWild + } + } + + // + // + // + // + // + // + // ================================================================================================== + // Enum + // ================================================================================================== + // + // + // + // + // + // + + // BattleWildResult + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleWildResult extends $.Enum { + name: 'BattleWildResult' + members: ['pokemonsCaptured', 'pokemonsDefeated', 'trainerDefeated'] + membersUnion: + | 'pokemonsCaptured' + | 'pokemonsDefeated' + | 'trainerDefeated' + } + + // PokemonType + // -------------------------------------------------------------------------------------------------- + // + + export interface PokemonType extends $.Enum { + name: 'PokemonType' + members: ['bug', 'electric', 'fire', 'grass', 'water'] + membersUnion: + | 'bug' + | 'electric' + | 'fire' + | 'grass' + | 'water' + } + + // TrainerClass + // -------------------------------------------------------------------------------------------------- + // + + export interface TrainerClass extends $.Enum { + name: 'TrainerClass' + members: [ + 'bugCatcher', + 'camper', + 'picnicker', + 'psychic', + 'psychicMedium', + 'psychicYoungster', + 'sailor', + 'superNerd', + 'tamer', + 'teamRocketGrunt', + 'triathlete', + 'youngster', + 'youth', + ] + membersUnion: + | 'bugCatcher' + | 'camper' + | 'picnicker' + | 'psychic' + | 'psychicMedium' + | 'psychicYoungster' + | 'sailor' + | 'superNerd' + | 'tamer' + | 'teamRocketGrunt' + | 'triathlete' + | 'youngster' + | 'youth' + } + + // + // + // + // + // + // + // ================================================================================================== + // ScalarCustom + // ================================================================================================== + // + // + // + // + // + // + + // Date + // -------------------------------------------------------------------------------------------------- + // + + export type Date = $$Scalar.Date + + // + // + // + // + // + // + // ================================================================================================== + // ScalarStandard + // ================================================================================================== + // + // + // + // + // + // + + // Float + // -------------------------------------------------------------------------------------------------- + // + + export type Float = $.StandardTypes.Float + + // ID + // -------------------------------------------------------------------------------------------------- + // + + export type ID = $.StandardTypes.ID + + // String + // -------------------------------------------------------------------------------------------------- + // + + export type String = $.StandardTypes.String + + // Int + // -------------------------------------------------------------------------------------------------- + // + + export type Int = $.StandardTypes.Int + + // Boolean + // -------------------------------------------------------------------------------------------------- + // + + export type Boolean = $.StandardTypes.Boolean + + // + // + // + // + // + // + // ================================================================================================== + // Named Types Index + // ================================================================================================== + // + // + // + // + // + // + + /** + * [1] These definitions serve to allow field selection interfaces to extend their respective object type without + * name clashing between the field name and the object name. + * + * For example imagine `Query.Foo` field with type also called `Foo`. Our generated interfaces for each field + * would end up with an error of `export interface Foo extends Foo ...` + */ + + namespace $$NamedTypes { + export type $$Query = Query + export type $$Mutation = Mutation + export type $$BattleRoyale = BattleRoyale + export type $$BattleTrainer = BattleTrainer + export type $$BattleWild = BattleWild + export type $$CombatantMultiPokemon = CombatantMultiPokemon + export type $$CombatantSinglePokemon = CombatantSinglePokemon + export type $$Patron = Patron + export type $$Pokemon = Pokemon + export type $$Trainer = Trainer + export type $$DateFilter = DateFilter + export type $$PokemonFilter = PokemonFilter + export type $$StringFilter = StringFilter + export type $$Being = Being + export type $$Battle = Battle + export type $$BattleWildResult = BattleWildResult + export type $$PokemonType = PokemonType + export type $$TrainerClass = TrainerClass + export type $$Date = Date + export type $$Float = Float + export type $$ID = ID + export type $$String = String + export type $$Int = Int + export type $$Boolean = Boolean + } +} + +// +// +// +// +// +// +// ================================================================================================== +// Schema +// ================================================================================================== +// +// +// +// +// +// + +export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Scalar.$Registry> extends $ { + name: $$Data.Name + operationsAvailable: ['query', 'mutation'] + RootUnion: + | Schema.Query + | Schema.Mutation + Root: { + query: Schema.Query + mutation: Schema.Mutation + subscription: null + } + allTypes: { + Query: Schema.Query + Mutation: Schema.Mutation + BattleWildResult: Schema.BattleWildResult + PokemonType: Schema.PokemonType + TrainerClass: Schema.TrainerClass + BattleRoyale: Schema.BattleRoyale + BattleTrainer: Schema.BattleTrainer + BattleWild: Schema.BattleWild + CombatantMultiPokemon: Schema.CombatantMultiPokemon + CombatantSinglePokemon: Schema.CombatantSinglePokemon + Patron: Schema.Patron + Pokemon: Schema.Pokemon + Trainer: Schema.Trainer + Battle: Schema.Battle + Being: Schema.Being + } + objects: { + BattleRoyale: Schema.BattleRoyale + BattleTrainer: Schema.BattleTrainer + BattleWild: Schema.BattleWild + CombatantMultiPokemon: Schema.CombatantMultiPokemon + CombatantSinglePokemon: Schema.CombatantSinglePokemon + Patron: Schema.Patron + Pokemon: Schema.Pokemon + Trainer: Schema.Trainer + } + unions: { + Battle: Schema.Battle + } + interfaces: { + Being: Schema.Being + } + scalarNamesUnion: + | 'Date' + | 'Float' + | 'ID' + | 'String' + | 'Int' + | 'Boolean' + scalars: { + Date: Schema.Date + Float: Schema.Float + ID: Schema.ID + String: Schema.String + Int: Schema.Int + Boolean: Schema.Boolean + } + scalarRegistry: $Scalars + extensions: $$Utilities.GlobalRegistry.TypeExtensions +} diff --git a/examples/$/graffle/modules/select.ts b/examples/$/graffle/modules/select.ts new file mode 100644 index 000000000..693e3b027 --- /dev/null +++ b/examples/$/graffle/modules/select.ts @@ -0,0 +1,108 @@ +import type { InferResult } from 'graffle/schema' +import type { OperationTypeNode } from 'graphql' +import * as $$Data from './data.js' +import * as $$Schema from './schema.js' +import * as $$SelectionSets from './selection-sets.js' + +// +// +// +// +// +// +// ================================================================================================== +// Runtime +// ================================================================================================== +// +// +// +// +// +// +import { createSelect } from 'graffle/client' +export const Select = createSelect($$Data.Name) + +// +// +// +// +// +// +// ================================================================================================== +// Buildtime +// ================================================================================================== +// +// +// +// +// +// + +export namespace Select { + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends $$SelectionSets.Query> = InferResult.Operation< + $SelectionSet, + $$Schema.Schema, + OperationTypeNode.QUERY + > + export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = InferResult.Operation< + $SelectionSet, + $$Schema.Schema, + OperationTypeNode.MUTATION + > + // OutputObject + // -------------------------------------------------------------------------------------------------- + // + export type BattleRoyale<$SelectionSet extends $$SelectionSets.BattleRoyale> = InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['BattleRoyale'] + > + export type BattleTrainer<$SelectionSet extends $$SelectionSets.BattleTrainer> = InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['BattleTrainer'] + > + export type BattleWild<$SelectionSet extends $$SelectionSets.BattleWild> = InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['BattleWild'] + > + export type CombatantMultiPokemon<$SelectionSet extends $$SelectionSets.CombatantMultiPokemon> = + InferResult.OutputObjectLike<$SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['CombatantMultiPokemon']> + export type CombatantSinglePokemon<$SelectionSet extends $$SelectionSets.CombatantSinglePokemon> = + InferResult.OutputObjectLike<$SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['CombatantSinglePokemon']> + export type Patron<$SelectionSet extends $$SelectionSets.Patron> = InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Patron'] + > + export type Pokemon<$SelectionSet extends $$SelectionSets.Pokemon> = InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Pokemon'] + > + export type Trainer<$SelectionSet extends $$SelectionSets.Trainer> = InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Trainer'] + > + // Union + // -------------------------------------------------------------------------------------------------- + // + export type Battle<$SelectionSet extends $$SelectionSets.Battle> = InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Battle'] + > + // Interface + // -------------------------------------------------------------------------------------------------- + // + export type Being<$SelectionSet extends $$SelectionSets.Being> = InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Being'] + > +} diff --git a/examples/$/graffle/modules/selection-sets.ts b/examples/$/graffle/modules/selection-sets.ts new file mode 100644 index 000000000..aa1853ec5 --- /dev/null +++ b/examples/$/graffle/modules/selection-sets.ts @@ -0,0 +1,1953 @@ +import type { Select as $Select } from 'graffle/schema' +import type * as $$Utilities from 'graffle/utilities-for-generated' + +// +// +// +// +// +// +// ================================================================================================== +// Document +// ================================================================================================== +// +// +// +// +// +// + +export interface $Document< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + query?: Record> + mutation?: Record> +} + +// +// +// +// +// +// +// ================================================================================================== +// Root +// ================================================================================================== +// +// +// +// +// +// + +// Query +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Query< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * Select the `battles` field on the `Query` object. Its type is `Battle` (a `Union` kind of type). + */ + battles?: Query.battles$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `beings` field on the `Query` object. Its type is `Being` (a `Interface` kind of type). + */ + beings?: Query.beings$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `pokemonByName` field on the `Query` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + pokemonByName?: Query.pokemonByName<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `pokemons` field on the `Query` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + pokemons?: Query.pokemons$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `trainerByName` field on the `Query` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + trainerByName?: Query.trainerByName<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `trainers` field on the `Query` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + trainers?: Query.trainers$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Query$FragmentInline<_$Scalars> + | Query$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Query$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Query<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Query { + export type battles<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + battles$SelectionSet<_$Scalars> + + export interface battles$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Battle<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `battles` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type battles$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + battles$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type beings<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + beings$SelectionSet<_$Scalars> + + export interface beings$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Being<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `beings` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type beings$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + beings$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type pokemonByName< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = pokemonByName$SelectionSet<_$Scalars> + + export interface pokemonByName$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { + /** + * Arguments for `pokemonByName` field. All arguments are required so you must include this. + */ + $: pokemonByName$Arguments<_$Scalars> + } + + export interface pokemonByName$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + name: string + } + + // --- expanded --- + + /** + * This is the "expanded" version of the `pokemonByName` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type pokemonByName$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemonByName$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type pokemons< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = pokemons$SelectionSet<_$Scalars> + + export interface pokemons$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { + /** + * Arguments for `pokemons` field. No arguments are required so you may omit this. + */ + $?: pokemons$Arguments<_$Scalars> + } + + export interface pokemons$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + filter?: $NamedTypes.$PokemonFilter<_$Scalars> | undefined | null + } + + // --- expanded --- + + /** + * This is the "expanded" version of the `pokemons` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type pokemons$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemons$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type trainerByName< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = trainerByName$SelectionSet<_$Scalars> + + export interface trainerByName$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> { + /** + * Arguments for `trainerByName` field. All arguments are required so you must include this. + */ + $: trainerByName$Arguments<_$Scalars> + } + + export interface trainerByName$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + name: string + } + + // --- expanded --- + + /** + * This is the "expanded" version of the `trainerByName` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type trainerByName$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainerByName$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type trainers< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = trainers$SelectionSet<_$Scalars> + + export interface trainers$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `trainers` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type trainers$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainers$SelectionSet<_$Scalars> + > +} + +// Mutation +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * Select the `addPokemon` field on the `Mutation` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + addPokemon?: Mutation.addPokemon<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Mutation$FragmentInline<_$Scalars> + | Mutation$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Mutation$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Mutation { + export type addPokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = addPokemon$SelectionSet<_$Scalars> + + export interface addPokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { + /** + * Arguments for `addPokemon` field. Some (2/5) arguments are required so you must include this. + */ + $: addPokemon$Arguments<_$Scalars> + } + + export interface addPokemon$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + attack?: number | undefined | null + defense?: number | undefined | null + hp?: number | undefined | null + name: string + $type: $NamedTypes.$PokemonType + } + + // --- expanded --- + + /** + * This is the "expanded" version of the `addPokemon` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type addPokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + addPokemon$SelectionSet<_$Scalars> + > +} + +// +// +// +// +// +// +// ================================================================================================== +// Enum +// ================================================================================================== +// +// +// +// +// +// + +export type BattleWildResult = + | 'pokemonsCaptured' + | 'pokemonsDefeated' + | 'trainerDefeated' + +export type PokemonType = + | 'bug' + | 'electric' + | 'fire' + | 'grass' + | 'water' + +export type TrainerClass = + | 'bugCatcher' + | 'camper' + | 'picnicker' + | 'psychic' + | 'psychicMedium' + | 'psychicYoungster' + | 'sailor' + | 'superNerd' + | 'tamer' + | 'teamRocketGrunt' + | 'triathlete' + | 'youngster' + | 'youth' + +// +// +// +// +// +// +// ================================================================================================== +// InputObject +// ================================================================================================== +// +// +// +// +// +// + +export interface DateFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + gte?: + | $$Utilities.Schema.Scalar.GetDecoded< + $$Utilities.Schema.Scalar.LookupCustomScalarOrFallbackToString<'Date', _$Scalars> + > + | undefined + | null + lte?: + | $$Utilities.Schema.Scalar.GetDecoded< + $$Utilities.Schema.Scalar.LookupCustomScalarOrFallbackToString<'Date', _$Scalars> + > + | undefined + | null +} + +export interface PokemonFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + birthday?: $NamedTypes.$DateFilter<_$Scalars> | undefined | null + name?: $NamedTypes.$StringFilter<_$Scalars> | undefined | null + $type?: $NamedTypes.$PokemonType | undefined | null +} + +export interface StringFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + contains?: string | undefined | null + in?: Array | undefined | null +} + +// +// +// +// +// +// +// ================================================================================================== +// OutputObject +// ================================================================================================== +// +// +// +// +// +// + +// BattleRoyale +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface BattleRoyale< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { + /** + * Select the `combatants` field on the `BattleRoyale` object. Its type is `CombatantMultiPokemon` (a `OutputObject` kind of type). + */ + combatants?: + | BattleRoyale.combatants$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + /** + * Select the `date` field on the `BattleRoyale` object. Its type is `Float` (a `ScalarStandard` kind of type). + */ + date?: BattleRoyale.date$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `id` field on the `BattleRoyale` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: BattleRoyale.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `winner` field on the `BattleRoyale` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + winner?: BattleRoyale.winner$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | BattleRoyale$FragmentInline<_$Scalars> + | BattleRoyale$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface BattleRoyale$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends BattleRoyale<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace BattleRoyale { + export type combatants< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = combatants$SelectionSet<_$Scalars> + + export interface combatants$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$CombatantMultiPokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `combatants` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type combatants$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + combatants$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type date<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | date$SelectionSet<_$Scalars> + + export interface date$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type date$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | date$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type winner<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + winner$SelectionSet<_$Scalars> + + export interface winner$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `winner` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type winner$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + winner$SelectionSet<_$Scalars> + > +} + +// BattleTrainer +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface BattleTrainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { + /** + * Select the `combatant1` field on the `BattleTrainer` object. Its type is `CombatantSinglePokemon` (a `OutputObject` kind of type). + */ + combatant1?: + | BattleTrainer.combatant1$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + /** + * Select the `combatant2` field on the `BattleTrainer` object. Its type is `CombatantSinglePokemon` (a `OutputObject` kind of type). + */ + combatant2?: + | BattleTrainer.combatant2$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + /** + * Select the `date` field on the `BattleTrainer` object. Its type is `Float` (a `ScalarStandard` kind of type). + */ + date?: BattleTrainer.date$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `id` field on the `BattleTrainer` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: BattleTrainer.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `winner` field on the `BattleTrainer` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + winner?: BattleTrainer.winner$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | BattleTrainer$FragmentInline<_$Scalars> + | BattleTrainer$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface BattleTrainer$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends BattleTrainer<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace BattleTrainer { + export type combatant1< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = combatant1$SelectionSet<_$Scalars> + + export interface combatant1$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$CombatantSinglePokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `combatant1` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type combatant1$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + combatant1$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type combatant2< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = combatant2$SelectionSet<_$Scalars> + + export interface combatant2$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$CombatantSinglePokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `combatant2` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type combatant2$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + combatant2$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type date<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | date$SelectionSet<_$Scalars> + + export interface date$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type date$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | date$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type winner<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + winner$SelectionSet<_$Scalars> + + export interface winner$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `winner` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type winner$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + winner$SelectionSet<_$Scalars> + > +} + +// BattleWild +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface BattleWild< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { + /** + * Select the `date` field on the `BattleWild` object. Its type is `Float` (a `ScalarStandard` kind of type). + */ + date?: BattleWild.date$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `id` field on the `BattleWild` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: BattleWild.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `pokemon` field on the `BattleWild` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + pokemon?: BattleWild.pokemon$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `result` field on the `BattleWild` object. Its type is `BattleWildResult` (a `Enum` kind of type). + */ + result?: BattleWild.result$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `trainer` field on the `BattleWild` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + trainer?: BattleWild.trainer$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `wildPokemons` field on the `BattleWild` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + wildPokemons?: + | BattleWild.wildPokemons$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | BattleWild$FragmentInline<_$Scalars> + | BattleWild$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface BattleWild$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends BattleWild<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace BattleWild { + export type date<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | date$SelectionSet<_$Scalars> + + export interface date$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type date$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | date$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type pokemon<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + pokemon$SelectionSet<_$Scalars> + + export interface pokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `pokemon` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type pokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemon$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type result<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | result$SelectionSet<_$Scalars> + + export interface result$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `result` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type result$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | result$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars> + + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `trainer` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type wildPokemons< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = wildPokemons$SelectionSet<_$Scalars> + + export interface wildPokemons$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `wildPokemons` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type wildPokemons$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + wildPokemons$SelectionSet<_$Scalars> + > +} + +// CombatantMultiPokemon +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface CombatantMultiPokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { + /** + * Select the `pokemons` field on the `CombatantMultiPokemon` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + pokemons?: + | CombatantMultiPokemon.pokemons$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + /** + * Select the `trainer` field on the `CombatantMultiPokemon` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + trainer?: + | CombatantMultiPokemon.trainer$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | CombatantMultiPokemon$FragmentInline<_$Scalars> + | CombatantMultiPokemon$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface CombatantMultiPokemon$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends CombatantMultiPokemon<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace CombatantMultiPokemon { + export type pokemons< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = pokemons$SelectionSet<_$Scalars> + + export interface pokemons$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `pokemons` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type pokemons$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemons$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars> + + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `trainer` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + > +} + +// CombatantSinglePokemon +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface CombatantSinglePokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { + /** + * Select the `pokemon` field on the `CombatantSinglePokemon` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + pokemon?: + | CombatantSinglePokemon.pokemon$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + /** + * Select the `trainer` field on the `CombatantSinglePokemon` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + trainer?: + | CombatantSinglePokemon.trainer$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | CombatantSinglePokemon$FragmentInline<_$Scalars> + | CombatantSinglePokemon$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface CombatantSinglePokemon$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends CombatantSinglePokemon<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace CombatantSinglePokemon { + export type pokemon<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + pokemon$SelectionSet<_$Scalars> + + export interface pokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `pokemon` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type pokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemon$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars> + + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `trainer` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + > +} + +// Patron +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Patron<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $Select.Bases.ObjectLike +{ + /** + * Select the `id` field on the `Patron` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: Patron.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `money` field on the `Patron` object. Its type is `Int` (a `ScalarStandard` kind of type). + */ + money?: Patron.money$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `name` field on the `Patron` object. Its type is `String` (a `ScalarStandard` kind of type). + */ + name?: Patron.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Patron$FragmentInline<_$Scalars> + | Patron$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Patron$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Patron<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Patron { + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type money<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | money$SelectionSet<_$Scalars> + + export interface money$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `money` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type money$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | money$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `name` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + > +} + +// Pokemon +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Pokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { + /** + * Select the `attack` field on the `Pokemon` object. Its type is `Int` (a `ScalarStandard` kind of type). + */ + attack?: Pokemon.attack$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `birthday` field on the `Pokemon` object. Its type is `Date` (a `ScalarCustom` kind of type). + */ + birthday?: Pokemon.birthday$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `defense` field on the `Pokemon` object. Its type is `Int` (a `ScalarStandard` kind of type). + */ + defense?: Pokemon.defense$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `hp` field on the `Pokemon` object. Its type is `Int` (a `ScalarStandard` kind of type). + */ + hp?: Pokemon.hp$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `id` field on the `Pokemon` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: Pokemon.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `name` field on the `Pokemon` object. Its type is `String` (a `ScalarStandard` kind of type). + */ + name?: Pokemon.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `trainer` field on the `Pokemon` object. Its type is `Trainer` (a `OutputObject` kind of type). + */ + trainer?: Pokemon.trainer$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `type` field on the `Pokemon` object. Its type is `PokemonType` (a `Enum` kind of type). + */ + type?: Pokemon.type$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Pokemon$FragmentInline<_$Scalars> + | Pokemon$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Pokemon$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Pokemon<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Pokemon { + export type attack<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | attack$SelectionSet<_$Scalars> + + export interface attack$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `attack` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type attack$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | attack$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type birthday< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = + | $Select.Indicator.NoArgsIndicator + | birthday$SelectionSet<_$Scalars> + + export interface birthday$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `birthday` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type birthday$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | birthday$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type defense<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | defense$SelectionSet<_$Scalars> + + export interface defense$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `defense` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type defense$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | defense$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type hp<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | hp$SelectionSet<_$Scalars> + + export interface hp$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `hp` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type hp$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | hp$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `name` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars> + + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `trainer` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type type<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | type$SelectionSet<_$Scalars> + + export interface type$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `type` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type type$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | type$SelectionSet<_$Scalars> + > +} + +// Trainer +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Trainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { + /** + * Select the `class` field on the `Trainer` object. Its type is `TrainerClass` (a `Enum` kind of type). + */ + class?: Trainer.$class$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `fans` field on the `Trainer` object. Its type is `Patron` (a `OutputObject` kind of type). + */ + fans?: Trainer.fans$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `id` field on the `Trainer` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: Trainer.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `name` field on the `Trainer` object. Its type is `String` (a `ScalarStandard` kind of type). + */ + name?: Trainer.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `pokemon` field on the `Trainer` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + pokemon?: Trainer.pokemon$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Trainer$FragmentInline<_$Scalars> + | Trainer$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Trainer$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Trainer<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Trainer { + export type $class<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | $class$SelectionSet<_$Scalars> + + export interface $class$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `$class` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type $class$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | $class$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type fans<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + fans$SelectionSet<_$Scalars> + + export interface fans$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Patron<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `fans` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type fans$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + fans$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `name` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type pokemon<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + pokemon$SelectionSet<_$Scalars> + + export interface pokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `pokemon` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type pokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemon$SelectionSet<_$Scalars> + > +} + +// +// +// +// +// +// +// ================================================================================================== +// Union +// ================================================================================================== +// +// +// +// +// +// + +export interface Battle< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * A meta field. Is the name of the type being selected. Since this is a union type and thus polymorphic, + * the name is one of the member type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + + ___on_BattleRoyale?: BattleRoyale<_$Scalars> + ___on_BattleTrainer?: BattleTrainer<_$Scalars> + ___on_BattleWild?: BattleWild<_$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Battle$FragmentInline<_$Scalars> + | Battle$FragmentInline<_$Scalars>[] +} +export interface Battle$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Battle<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// + +// Being +// -------------------------------------------------------------------------------------------------- +// + +export interface Being<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $Select.Bases.ObjectLike +{ + id?: Being.id<_$Scalars> + name?: Being.name<_$Scalars> + ___on_Patron?: Patron<_$Scalars> + ___on_Pokemon?: Pokemon<_$Scalars> + ___on_Trainer?: Trainer<_$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Being$FragmentInline<_$Scalars> + | Being$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Being$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Being<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +export namespace Being { + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `name` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<_$Scalars> + > +} + +/** + * [1] These definitions serve to allow field selection interfaces to extend their respective object type without + * name clashing between the field name and the object name. + * + * For example imagine `Query.Foo` field with type also called `Foo`. Our generated interfaces for each field + * would end up with an error of `export interface Foo extends Foo ...` + */ +export namespace $NamedTypes { + export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Query<_$Scalars> + export type $Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Mutation<_$Scalars> + export type $BattleWildResult = BattleWildResult + export type $PokemonType = PokemonType + export type $TrainerClass = TrainerClass + export type $DateFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = DateFilter<_$Scalars> + export type $PokemonFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = PokemonFilter<_$Scalars> + export type $StringFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = StringFilter<_$Scalars> + export type $BattleRoyale< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = BattleRoyale<_$Scalars> + export type $BattleTrainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = BattleTrainer<_$Scalars> + export type $BattleWild< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = BattleWild<_$Scalars> + export type $CombatantMultiPokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = CombatantMultiPokemon<_$Scalars> + export type $CombatantSinglePokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = CombatantSinglePokemon<_$Scalars> + export type $Patron<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Patron<_$Scalars> + export type $Pokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Pokemon<_$Scalars> + export type $Trainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Trainer<_$Scalars> + export type $Battle<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Battle<_$Scalars> + export type $Being<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Being<_$Scalars> +} diff --git a/examples/10_transport-http/transport-http_abort.ts b/examples/10_transport-http/transport-http_abort.ts index d45b6cde7..1dc7615f6 100644 --- a/examples/10_transport-http/transport-http_abort.ts +++ b/examples/10_transport-http/transport-http_abort.ts @@ -2,7 +2,7 @@ * This example shows how to cancel requests using an `AbortController` signal. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const abortController = new AbortController() diff --git a/examples/10_transport-http/transport-http_extension_fetch__custom-fetch.ts b/examples/10_transport-http/transport-http_extension_fetch__custom-fetch.ts index 1d1cd0992..8422e457f 100644 --- a/examples/10_transport-http/transport-http_extension_fetch__custom-fetch.ts +++ b/examples/10_transport-http/transport-http_extension_fetch__custom-fetch.ts @@ -3,7 +3,7 @@ */ /* eslint-disable */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { showJson } from '../$/helpers.js' import { publicGraphQLSchemaEndpoints } from '../$/helpers.js' diff --git a/examples/10_transport-http/transport-http_extension_headers__dynamicHeaders.ts b/examples/10_transport-http/transport-http_extension_headers__dynamicHeaders.ts index 031df0a19..18997eff0 100644 --- a/examples/10_transport-http/transport-http_extension_headers__dynamicHeaders.ts +++ b/examples/10_transport-http/transport-http_extension_headers__dynamicHeaders.ts @@ -2,7 +2,7 @@ * This example shows how to leverage the extension system to dynamically manipulate headers per request. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle diff --git a/examples/10_transport-http/transport-http_headers_raw__headers.ts b/examples/10_transport-http/transport-http_headers_raw__headers.ts index 648607807..9c3ac0138 100644 --- a/examples/10_transport-http/transport-http_headers_raw__headers.ts +++ b/examples/10_transport-http/transport-http_headers_raw__headers.ts @@ -2,7 +2,7 @@ * This example shows how to use the `transport` configuration to control request headers. Notice how empty string headers unset previously set headers. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { show } from '../$/helpers.js' import { publicGraphQLSchemaEndpoints } from '../$/helpers.js' diff --git a/examples/10_transport-http/transport-http_method-get.ts b/examples/10_transport-http/transport-http_method-get.ts index eca1da4c8..b02e7d77e 100644 --- a/examples/10_transport-http/transport-http_method-get.ts +++ b/examples/10_transport-http/transport-http_method-get.ts @@ -3,7 +3,7 @@ * to be sent over HTTP GET method. Note write-kind operations (mutation) are still sent over HTTP POST method. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' const graffle = Graffle diff --git a/examples/10_transport-http/transport-http_raw.ts b/examples/10_transport-http/transport-http_raw.ts index 3d4b7f4e1..91ed97a79 100644 --- a/examples/10_transport-http/transport-http_raw.ts +++ b/examples/10_transport-http/transport-http_raw.ts @@ -2,7 +2,7 @@ * This example shows how to use the `raw` configuration of transport configuration to easily access low-level `RequestInit` configuration. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { show } from '../$/helpers.js' import { publicGraphQLSchemaEndpoints } from '../$/helpers.js' @@ -14,7 +14,7 @@ const graffle = Graffle mode: `cors`, }, }) - .anyware(async ({ exchange }) => { + .anyware(({ exchange }) => { show(exchange.input.request) return exchange() }) diff --git a/examples/20_output/output_default.ts b/examples/20_output/output_default.ts index 462692aae..359bfbfeb 100644 --- a/examples/20_output/output_default.ts +++ b/examples/20_output/output_default.ts @@ -2,7 +2,7 @@ * This example shows the default output behavior. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/20_output/output_envelope.ts b/examples/20_output/output_envelope.ts index 96cb6d758..0032c36f3 100644 --- a/examples/20_output/output_envelope.ts +++ b/examples/20_output/output_envelope.ts @@ -2,7 +2,7 @@ * This example shows how to configure output to use the envelope. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' const pokemon = Graffle.create({ diff --git a/examples/20_output/output_envelope_envelope-error__envelope-error.ts b/examples/20_output/output_envelope_envelope-error__envelope-error.ts index a449502ca..5bd696c46 100644 --- a/examples/20_output/output_envelope_envelope-error__envelope-error.ts +++ b/examples/20_output/output_envelope_envelope-error__envelope-error.ts @@ -2,7 +2,7 @@ * This example shows how to configure output to embed errors into the envelope. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' // dprint-ignore diff --git a/examples/20_output/output_envelope_envelope_error-throw__envelope-error-throw.ts b/examples/20_output/output_envelope_envelope_error-throw__envelope-error-throw.ts index 74bad7fe2..d489be339 100644 --- a/examples/20_output/output_envelope_envelope_error-throw__envelope-error-throw.ts +++ b/examples/20_output/output_envelope_envelope_error-throw__envelope-error-throw.ts @@ -2,7 +2,7 @@ * This example shows how to configure output to throw errors even when using the envelope. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' // dprint-ignore const pokemon = Graffle diff --git a/examples/20_output/output_preset__standard-graphql.ts b/examples/20_output/output_preset__standard-graphql.ts index c25b12527..f70f9ac0f 100644 --- a/examples/20_output/output_preset__standard-graphql.ts +++ b/examples/20_output/output_preset__standard-graphql.ts @@ -2,7 +2,7 @@ * This example shows how to configure output to approximate the traditional GraphQL ExecutionResult type. */ -import { Graffle, Preset } from '../../src/entrypoints/main.js' +import { Graffle, Preset } from 'graffle' import { show } from '../$/show.js' const graffle = Graffle diff --git a/examples/20_output/output_return-error.ts b/examples/20_output/output_return-error.ts index 9fd6352b2..387fa81e0 100644 --- a/examples/20_output/output_return-error.ts +++ b/examples/20_output/output_return-error.ts @@ -2,7 +2,7 @@ * This example shows how to configure output to have errors returned instead of e.g. thrown. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' // dprint-ignore diff --git a/examples/20_output/output_return-error_return-error-execution__return-error-execution.ts b/examples/20_output/output_return-error_return-error-execution__return-error-execution.ts index e7f350782..f862247f9 100644 --- a/examples/20_output/output_return-error_return-error-execution__return-error-execution.ts +++ b/examples/20_output/output_return-error_return-error-execution__return-error-execution.ts @@ -2,7 +2,7 @@ * This example shows how to configure output to have only certain kinds of errors returned while others thrown. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/show.js' const pokemon = Graffle diff --git a/examples/30_gql/gql_gql-document-node.ts b/examples/30_gql/gql_gql-document-node.ts index 04a937a40..aa51a511b 100644 --- a/examples/30_gql/gql_gql-document-node.ts +++ b/examples/30_gql/gql_gql-document-node.ts @@ -2,10 +2,10 @@ * This example shows how to send a request using a Document instance for the GraphQL document. */ +import { Graffle } from 'graffle' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' +import { Throws } from 'graffle/extensions/throws' import { parse } from 'graphql' -import { Opentelemetry } from '../../src/entrypoints/extensions/opentelemetry/runtime.js' -import { Throws } from '../../src/entrypoints/extensions/throws/runtime.js' -import { Graffle } from '../../src/entrypoints/main.js' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle diff --git a/examples/30_gql/gql_gql-document-node_gql-typed_gql-document-node-typed__gql-document-node-typed.ts b/examples/30_gql/gql_gql-document-node_gql-typed_gql-document-node-typed__gql-document-node-typed.ts index 2cdda0bb4..fa6de68b6 100644 --- a/examples/30_gql/gql_gql-document-node_gql-typed_gql-document-node-typed__gql-document-node-typed.ts +++ b/examples/30_gql/gql_gql-document-node_gql-typed_gql-document-node-typed__gql-document-node-typed.ts @@ -3,8 +3,8 @@ * package `graphql` to make a type safe request with gql method. */ +import { Graffle } from 'graffle' import { parse, type TypedQueryDocumentNode } from 'graphql' -import { Graffle } from '../../src/entrypoints/main.js' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle.create() diff --git a/examples/30_gql/gql_gql-string.ts b/examples/30_gql/gql_gql-string.ts index 0dedad43a..77783f078 100644 --- a/examples/30_gql/gql_gql-string.ts +++ b/examples/30_gql/gql_gql-string.ts @@ -2,7 +2,7 @@ * This example shows how to send a request using a string for the GraphQL document. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle.create().transport({ url: publicGraphQLSchemaEndpoints.Pokemon }) diff --git a/examples/30_gql/gql_gql-string_gql-typed__gql-string-typed.ts b/examples/30_gql/gql_gql-string_gql-typed__gql-string-typed.ts index 39af37622..ea2be30f4 100644 --- a/examples/30_gql/gql_gql-string_gql-typed__gql-string-typed.ts +++ b/examples/30_gql/gql_gql-string_gql-typed__gql-string-typed.ts @@ -4,7 +4,7 @@ * suggests below, ideally some sort of automation would generate the types for you. */ -import { Graffle, type TypedDocument } from '../../src/entrypoints/main.js' +import { Graffle, type TypedDocument } from 'graffle' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle.create().transport({ url: publicGraphQLSchemaEndpoints.Pokemon }) diff --git a/examples/35_custom-scalar/custom-scalar.ts b/examples/35_custom-scalar/custom-scalar.ts index 934584d53..8504005d6 100644 --- a/examples/35_custom-scalar/custom-scalar.ts +++ b/examples/35_custom-scalar/custom-scalar.ts @@ -3,7 +3,7 @@ * have arguments and data automatically encoded and decoded respectively. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' const graffle = Graffle diff --git a/examples/40_other/transport-memory.ts b/examples/40_other/transport-memory.ts index 851962189..a8c099fb1 100644 --- a/examples/40_other/transport-memory.ts +++ b/examples/40_other/transport-memory.ts @@ -2,9 +2,9 @@ * This example shows how you can send requests against an in-memory GraphQL schema instead of one hosted over HTTP. */ +import { Graffle } from 'graffle' +import { TransportMemory } from 'graffle/extensions/transport-memory' import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql' -import { Graffle } from '../../src/entrypoints/main.js' -import { TransportMemory } from '../../src/extensions/TransportMemory/TransportMemory.js' import { showJson } from '../$/helpers.js' const schema = new GraphQLSchema({ diff --git a/examples/50_anyware/anyware_jump-start__jump-start.ts b/examples/50_anyware/anyware_jump-start__jump-start.ts index 64d0def5e..668d48ef6 100644 --- a/examples/50_anyware/anyware_jump-start__jump-start.ts +++ b/examples/50_anyware/anyware_jump-start__jump-start.ts @@ -3,7 +3,7 @@ * This is more succinct than having to manually write each hook execution * until your reach your desired one. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints } from '../$/helpers.js' Graffle diff --git a/examples/50_anyware/anyware_short-circuit__short-circuit.ts b/examples/50_anyware/anyware_short-circuit__short-circuit.ts index 0d89bd442..994c1ceb7 100644 --- a/examples/50_anyware/anyware_short-circuit__short-circuit.ts +++ b/examples/50_anyware/anyware_short-circuit__short-circuit.ts @@ -3,7 +3,7 @@ * This is more succinct than having to manually write each hook execution * even past your desired one until the final result. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints } from '../$/helpers.js' Graffle diff --git a/examples/50_anyware/anyware_slot_slot-body__slot-body.ts b/examples/50_anyware/anyware_slot_slot-body__slot-body.ts index 3000561aa..30d1475d6 100644 --- a/examples/50_anyware/anyware_slot_slot-body__slot-body.ts +++ b/examples/50_anyware/anyware_slot_slot-body__slot-body.ts @@ -1,7 +1,7 @@ /** * This example shows how to use the `body` slot on the `pack` hook. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle diff --git a/examples/50_anyware/anyware_slot_slot-body__slot-search-params.ts b/examples/50_anyware/anyware_slot_slot-body__slot-search-params.ts index 2e02a5a69..c4a2b9410 100644 --- a/examples/50_anyware/anyware_slot_slot-body__slot-search-params.ts +++ b/examples/50_anyware/anyware_slot_slot-body__slot-search-params.ts @@ -1,7 +1,7 @@ /** * This example shows how to use the `searchParams` slot on the `pack` hook. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle diff --git a/examples/50_anyware/anyware_slot_slot-fetch__slot-fetch.ts b/examples/50_anyware/anyware_slot_slot-fetch__slot-fetch.ts index 52a65f511..f577d2c85 100644 --- a/examples/50_anyware/anyware_slot_slot-fetch__slot-fetch.ts +++ b/examples/50_anyware/anyware_slot_slot-fetch__slot-fetch.ts @@ -1,7 +1,7 @@ /** * This example shows how to use the `fetch` slot on `exchange` hook. */ -import { Graffle } from '../../src/entrypoints/main.js' +import { Graffle } from 'graffle' import { publicGraphQLSchemaEndpoints, show } from '../$/helpers.js' const graffle = Graffle diff --git a/examples/55_document-builder/document-builder_alias.ts b/examples/55_document-builder/document-builder_alias.ts index 2da56d738..6433715c1 100644 --- a/examples/55_document-builder/document-builder_alias.ts +++ b/examples/55_document-builder/document-builder_alias.ts @@ -2,7 +2,7 @@ * This example shows how to write GraphQL aliases in the TypeScript interface. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { showJson } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/55_document-builder/document-builder_arguments.ts b/examples/55_document-builder/document-builder_arguments.ts index 9c33f3803..2ff93a432 100644 --- a/examples/55_document-builder/document-builder_arguments.ts +++ b/examples/55_document-builder/document-builder_arguments.ts @@ -2,13 +2,13 @@ * This example shows how to write field arguments in TypeScript interface. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { showJson } from '../$/helpers.js' -const atlas = Graffle.create() +const graffle = Graffle.create() // dprint-ignore -const pokemons = await atlas.query.pokemons({ +const pokemons = await graffle.query.pokemons({ $: { filter: { name: { in: [`Pikachu`, `Charizard`] } } }, // [!code highlight] name: true, trainer: { name: true }, diff --git a/examples/55_document-builder/document-builder_batch.ts b/examples/55_document-builder/document-builder_batch.ts index 9253fc672..d9f14f066 100644 --- a/examples/55_document-builder/document-builder_batch.ts +++ b/examples/55_document-builder/document-builder_batch.ts @@ -2,7 +2,7 @@ * This example shows how to write batches of GraphQL root fields (aka. entrypoints) in the TypeScript interface. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { showJson } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/55_document-builder/document-builder_directive.ts b/examples/55_document-builder/document-builder_directive.ts index fc805211e..49a1c7ebd 100644 --- a/examples/55_document-builder/document-builder_directive.ts +++ b/examples/55_document-builder/document-builder_directive.ts @@ -2,7 +2,7 @@ * This example shows how to use special fields to write GraphQL document directives. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { showJson } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/55_document-builder/document-builder_document.ts b/examples/55_document-builder/document-builder_document.ts index 153b706b8..c1bfb3b4a 100644 --- a/examples/55_document-builder/document-builder_document.ts +++ b/examples/55_document-builder/document-builder_document.ts @@ -2,7 +2,7 @@ * This example shows how to write whole GraphQL documents in the TypeScript interface. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { showJson } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/55_document-builder/document-builder_interface.ts b/examples/55_document-builder/document-builder_interface.ts index 5f8362343..13abd4838 100644 --- a/examples/55_document-builder/document-builder_interface.ts +++ b/examples/55_document-builder/document-builder_interface.ts @@ -2,7 +2,7 @@ * This example shows how to work with interface types. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/55_document-builder/document-builder_root-field.ts b/examples/55_document-builder/document-builder_root-field.ts index 1369046da..d065606e4 100644 --- a/examples/55_document-builder/document-builder_root-field.ts +++ b/examples/55_document-builder/document-builder_root-field.ts @@ -2,7 +2,7 @@ * This example shows how to use dedicated root field methods to easily operate on one GraphQL root field at at time. If you need to work with multiple root fields, check out the `batch` example. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { showJson } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/55_document-builder/document-builder_union.ts b/examples/55_document-builder/document-builder_union.ts index d6cf4091f..dd5fa512f 100644 --- a/examples/55_document-builder/document-builder_union.ts +++ b/examples/55_document-builder/document-builder_union.ts @@ -2,7 +2,7 @@ * This example shows how to work with GraphQL union types in the TypeScript interface. */ -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Graffle } from '../$/graffle/__.js' import { show } from '../$/helpers.js' const pokemon = Graffle.create() diff --git a/examples/60_extension/extension_introspection__introspection.ts b/examples/60_extension/extension_introspection__introspection.ts index 9604ded1f..9825e02c1 100644 --- a/examples/60_extension/extension_introspection__introspection.ts +++ b/examples/60_extension/extension_introspection__introspection.ts @@ -2,8 +2,8 @@ * This example shows how to use the Introspection extension to easily introspect your schema. */ -import { Introspection } from '../../src/entrypoints/extensions/introspection/runtime.js' -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Introspection } from 'graffle/extensions/introspection' +import { Graffle } from '../$/graffle/__.js' import { interceptAndShowUncaughtErrors, show } from '../$/show.js' interceptAndShowUncaughtErrors() diff --git a/examples/60_extension/extension_opentelemetry__opentelemetry.ts b/examples/60_extension/extension_opentelemetry__opentelemetry.ts index 75bae71b7..997198871 100644 --- a/examples/60_extension/extension_opentelemetry__opentelemetry.ts +++ b/examples/60_extension/extension_opentelemetry__opentelemetry.ts @@ -1,7 +1,7 @@ import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' -import { Opentelemetry } from '../../src/entrypoints/extensions/opentelemetry/runtime.js' -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Opentelemetry } from 'graffle/extensions/opentelemetry' +import { Graffle } from '../$/graffle/__.js' import { interceptAndShowOutput, show } from '../$/helpers.js' interceptAndShowOutput() diff --git a/examples/60_extension/extension_throws__throws.ts b/examples/60_extension/extension_throws__throws.ts index 3f929755a..af937de8c 100644 --- a/examples/60_extension/extension_throws__throws.ts +++ b/examples/60_extension/extension_throws__throws.ts @@ -2,8 +2,8 @@ * This example shows how to use the Throws extension to throw errors for one-off cases. */ -import { Throws } from '../../src/entrypoints/extensions/throws/runtime.js' -import { Graffle } from '../../tests/_/schemas/pokemon/graffle/__.js' +import { Throws } from 'graffle/extensions/throws' +import { Graffle } from '../$/graffle/__.js' import { interceptAndShowUncaughtErrors, show } from '../$/show.js' interceptAndShowUncaughtErrors() diff --git a/examples/65_preset/preset_none.ts b/examples/65_preset/preset_bare.ts similarity index 81% rename from examples/65_preset/preset_none.ts rename to examples/65_preset/preset_bare.ts index 89a53858f..79945ae39 100644 --- a/examples/65_preset/preset_none.ts +++ b/examples/65_preset/preset_bare.ts @@ -3,10 +3,10 @@ * its most minimal. It uses no extensions, not even a transport. */ -import { create } from '../../src/entrypoints/presets/bare.js' -import { Introspection } from '../../src/extensions/Introspection/Introspection.js' +import { Introspection } from 'graffle/extensions/introspection' +import { GraffleBare } from 'graffle/presets/bare' -const graffle = create() +const graffle = GraffleBare.create() /** * Because we have no transports registered, the `transport` method @@ -19,7 +19,7 @@ const _t: never = graffle.transport const _e1: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.gql const _e2: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.document const _e3: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.$batch -const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.id +const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.pokemons const _e5: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.$batch -const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.id +const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.addPokemon const _e7: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.use(Introspection()).introspect diff --git a/examples/65_preset/preset_minimal.ts b/examples/65_preset/preset_minimal.ts index 1ce1555a3..36709df46 100644 --- a/examples/65_preset/preset_minimal.ts +++ b/examples/65_preset/preset_minimal.ts @@ -4,11 +4,11 @@ * Transport HTTP extension. */ -import { Graffle } from '../../src/entrypoints/main.js' -import { create } from '../../src/entrypoints/presets/minimal.js' +import { Graffle } from 'graffle' +import { GraffleMinimal } from 'graffle/presets/minimal' -console.log(`Is the default preset`, Graffle.create === create) +console.log(`Is the default preset`, Graffle.create === GraffleMinimal.create) -const graffle = create() +const graffle = GraffleMinimal.create() console.log(`The current transport is`, graffle._.transports.current) diff --git a/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt b/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt index 67658d15e..0fdb6de65 100644 --- a/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt +++ b/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt @@ -4,7 +4,7 @@ headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1734293284713' + 'x-sent-at-time': '1734313683348' }, method: 'post', url: 'http://localhost:3000/graphql', diff --git a/examples/__outputs__/20_output/output_envelope.output.txt b/examples/__outputs__/20_output/output_envelope.output.txt index a8f66aa28..7aa391ba7 100644 --- a/examples/__outputs__/20_output/output_envelope.output.txt +++ b/examples/__outputs__/20_output/output_envelope.output.txt @@ -16,7 +16,7 @@ headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Sun, 15 Dec 2024 20:08:05 GMT', + date: 'Mon, 16 Dec 2024 01:48:03 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/examples/__outputs__/20_output/output_preset__standard-graphql.output.txt b/examples/__outputs__/20_output/output_preset__standard-graphql.output.txt index cccf761a0..23779a638 100644 --- a/examples/__outputs__/20_output/output_preset__standard-graphql.output.txt +++ b/examples/__outputs__/20_output/output_preset__standard-graphql.output.txt @@ -10,8 +10,7 @@ ContextualError: There was an error in the core implementation of hook "exchange ... 2 lines matching cause stack trace ... at async Object.send (/some/path/to/gql.ts:XX:XX:26) at async (/some/path/to/output_preset__standard-graphql.ts:XX:XX:16) { - context: { hookName: 'exchange', source: 'implementation' }, - [cause]: TypeError: Failed to parse URL from ... + cause: TypeError: Failed to parse URL from ... at new Request (node:internal/deps/undici/undici:XX:XX) at Object.run (/some/path/to/TransportHttp.ts:XX:XX:31) ... 6 lines matching cause stack trace ... @@ -31,7 +30,8 @@ ContextualError: There was an error in the core implementation of hook "exchange code: 'ERR_INVALID_URL', input: '...' } - } + }, + context: { hookName: 'exchange', source: 'implementation' } } Node.js vXX.XX.XX \ No newline at end of file diff --git a/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt b/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt index 76b3b3fdc..b0de7c34c 100644 --- a/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt +++ b/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt @@ -2,8 +2,8 @@ { __schema: { description: null, - queryType: { name: 'Query' }, - mutationType: { name: 'Mutation' }, + queryType: { name: 'Query', kind: 'OBJECT' }, + mutationType: { name: 'Mutation', kind: 'OBJECT' }, subscriptionType: null, types: [ { diff --git a/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt b/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt index fb94a8703..c943e359a 100644 --- a/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt +++ b/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt @@ -5,18 +5,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'encode', - id: 'b4f6b90f9d4cb7f9', + id: '0932a4af7db7f676', kind: 0, - timestamp: 1734293285758000, - duration: 1165.458, + timestamp: 1734313684255000, + duration: 886.584, attributes: {}, status: { code: 0 }, events: [], @@ -29,18 +29,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'pack', - id: '28d86e022df6a130', + id: '2dac90b2b7dae9cf', kind: 0, - timestamp: 1734293285761000, - duration: 123866.625, + timestamp: 1734313684257000, + duration: 9667.791, attributes: {}, status: { code: 0 }, events: [], @@ -53,18 +53,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'exchange', - id: '009c240ba45bff12', + id: 'c9162ca6e544cf37', kind: 0, - timestamp: 1734293285888000, - duration: 60630.292, + timestamp: 1734313684267000, + duration: 15232.833, attributes: {}, status: { code: 0 }, events: [], @@ -77,18 +77,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'unpack', - id: '1a49677d316b711e', + id: 'c360e1de02b2f249', kind: 0, - timestamp: 1734293285949000, - duration: 1003.209, + timestamp: 1734313684283000, + duration: 773.625, attributes: {}, status: { code: 0 }, events: [], @@ -101,18 +101,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'decode', - id: '3b7f0a2030462e74', + id: '6f38295d85844fd0', kind: 0, - timestamp: 1734293285950000, - duration: 444.291, + timestamp: 1734313684283000, + duration: 400.083, attributes: {}, status: { code: 0 }, events: [], @@ -125,18 +125,18 @@ 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', parentId: undefined, traceState: undefined, name: 'request', - id: '65825892207135a8', + id: 'fff65363c3906c5f', kind: 0, - timestamp: 1734293285757000, - duration: 193579.292, + timestamp: 1734313684255000, + duration: 29236.834, attributes: {}, status: { code: 0 }, events: [], diff --git a/examples/__outputs__/65_preset/preset_none.output.txt b/examples/__outputs__/65_preset/preset_bare.output.txt similarity index 100% rename from examples/__outputs__/65_preset/preset_none.output.txt rename to examples/__outputs__/65_preset/preset_bare.output.txt diff --git a/examples/package.json b/examples/package.json new file mode 100644 index 000000000..90725d5a2 --- /dev/null +++ b/examples/package.json @@ -0,0 +1,19 @@ +{ + "name": "examples", + "private": true, + "type": "module", + "scripts": { + "check:types": "tsc --noEmit" + }, + "dependencies": { + "@opentelemetry/sdk-trace-base": "^1.29.0", + "@opentelemetry/sdk-trace-node": "^1.29.0", + "graffle": "file:..", + "graphql": "^16.10.0", + "typescript": "^5.7.2" + }, + "devDependencies": { + "@tsconfig/node20": "^20.1.4", + "@tsconfig/strictest": "^2.0.5" + } +} diff --git a/examples/pnpm-lock.yaml b/examples/pnpm-lock.yaml new file mode 100644 index 000000000..ead9521d3 --- /dev/null +++ b/examples/pnpm-lock.yaml @@ -0,0 +1,328 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@opentelemetry/sdk-trace-base': + specifier: ^1.29.0 + version: 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/sdk-trace-node': + specifier: ^1.29.0 + version: 1.29.0(@opentelemetry/api@1.9.0) + graffle: + specifier: file:.. + version: file:..(@opentelemetry/api@1.9.0)(graphql@16.10.0) + graphql: + specifier: ^16.10.0 + version: 16.10.0 + typescript: + specifier: ^5.7.2 + version: 5.7.2 + devDependencies: + '@tsconfig/node20': + specifier: ^20.1.4 + version: 20.1.4 + '@tsconfig/strictest': + specifier: ^2.0.5 + version: 2.0.5 + +packages: + + '@0no-co/graphql.web@1.0.12': + resolution: {integrity: sha512-BTDjjsV/zSPy5fqItwm+KWUfh9CSe9tTtR6rCB72ddtkAxdcHbi4Ir4r/L1Et4lyxmL+i7Rb3m9sjLLi9tYrzA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + peerDependenciesMeta: + graphql: + optional: true + + '@graphql-typed-document-node/core@3.2.0': + resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + + '@molt/command@0.9.0': + resolution: {integrity: sha512-1JI8dAlpqlZoXyKWVQggX7geFNPxBpocHIXQCsnxDjKy+3WX4SGyZVJXuLlqRRrX7FmQCuuMAfx642ovXmPA9g==} + + '@molt/types@0.2.0': + resolution: {integrity: sha512-p6ChnEZDGjg9PYPec9BK6Yp5/DdSrYQvXTBAtgrnqX6N36cZy37ql1c8Tc5LclfIYBNG7EZp8NBcRTYJwyi84g==} + + '@opentelemetry/api@1.9.0': + resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==} + engines: {node: '>=8.0.0'} + + '@opentelemetry/context-async-hooks@1.29.0': + resolution: {integrity: sha512-TKT91jcFXgHyIDF1lgJF3BHGIakn6x0Xp7Tq3zoS3TMPzT9IlP0xEavWP8C1zGjU9UmZP2VR1tJhW9Az1A3w8Q==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/core@1.29.0': + resolution: {integrity: sha512-gmT7vAreXl0DTHD2rVZcw3+l2g84+5XiHIqdBUxXbExymPCvSsGOpiwMmn8nkiJur28STV31wnhIDrzWDPzjfA==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/propagator-b3@1.29.0': + resolution: {integrity: sha512-ktsNDlqhu+/IPGEJRMj81upg2JupUp+SwW3n1ZVZTnrDiYUiMUW41vhaziA7Q6UDhbZvZ58skDpQhe2ZgNIPvg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/propagator-jaeger@1.29.0': + resolution: {integrity: sha512-EXIEYmFgybnFMijVgqx1mq/diWwSQcd0JWVksytAVQEnAiaDvP45WuncEVQkFIAC0gVxa2+Xr8wL5pF5jCVKbg==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/resources@1.29.0': + resolution: {integrity: sha512-s7mLXuHZE7RQr1wwweGcaRp3Q4UJJ0wazeGlc/N5/XSe6UyXfsh1UQGMADYeg7YwD+cEdMtU1yJAUXdnFzYzyQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/sdk-trace-base@1.29.0': + resolution: {integrity: sha512-hEOpAYLKXF3wGJpXOtWsxEtqBgde0SCv+w+jvr3/UusR4ll3QrENEGnSl1WDCyRrpqOQ5NCNOvZch9UFVa7MnQ==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/sdk-trace-node@1.29.0': + resolution: {integrity: sha512-ZpGYt+VnMu6O0SRKzhuIivr7qJm3GpWnTCMuJspu4kt3QWIpIenwixo5Vvjuu3R4h2Onl/8dtqAiPIs92xd5ww==} + engines: {node: '>=14'} + peerDependencies: + '@opentelemetry/api': '>=1.0.0 <1.10.0' + + '@opentelemetry/semantic-conventions@1.28.0': + resolution: {integrity: sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==} + engines: {node: '>=14'} + + '@tsconfig/node20@20.1.4': + resolution: {integrity: sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==} + + '@tsconfig/strictest@2.0.5': + resolution: {integrity: sha512-ec4tjL2Rr0pkZ5hww65c+EEPYwxOi4Ryv+0MtjeaSQRJyq322Q27eOQiFbuNgw2hpL4hB1/W/HBGk3VKS43osg==} + + alge@0.8.1: + resolution: {integrity: sha512-kiV9nTt+XIauAXsowVygDxMZLplZxDWt0W8plE/nB32/V2ziM/P/TxDbSVK7FYIUt2Xo16h3/htDh199LNPCKQ==} + + ansi-regex@6.1.0: + resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + engines: {node: '>=12'} + + chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + + es-toolkit@1.30.1: + resolution: {integrity: sha512-ZXflqanzH8BpHkDhFa10bBf6ONDCe84EPUm7SSICGzuuROSluT2ynTPtwn9PcRelMtorCRozSknI/U0MNYp0Uw==} + + graffle@file:..: + resolution: {directory: .., type: directory} + hasBin: true + peerDependencies: + '@dprint/formatter': ^0.4.0 + '@dprint/typescript': ^0.93.0 + '@opentelemetry/api': ^1.9.0 + graphql: 14 - 16 + prettier: ^3.3.3 + peerDependenciesMeta: + '@dprint/formatter': + optional: true + '@dprint/typescript': + optional: true + '@opentelemetry/api': + optional: true + prettier: + optional: true + + graphql@16.10.0: + resolution: {integrity: sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==} + engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} + + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + + lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + + lodash.ismatch@4.4.0: + resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} + + lodash.snakecase@4.1.1: + resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} + + readline-sync@1.4.10: + resolution: {integrity: sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==} + engines: {node: '>= 0.8.0'} + + remeda@1.61.0: + resolution: {integrity: sha512-caKfSz9rDeSKBQQnlJnVW3mbVdFgxgGWQKq1XlFokqjf+hQD5gxutLGTTY2A/x24UxVyJe9gH5fAkFI63ULw4A==} + + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + + string-length@6.0.0: + resolution: {integrity: sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg==} + engines: {node: '>=16'} + + strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + + ts-toolbelt@9.6.0: + resolution: {integrity: sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==} + + type-fest@4.30.1: + resolution: {integrity: sha512-ojFL7eDMX2NF0xMbDwPZJ8sb7ckqtlAi1GsmgsFXvErT9kFTk1r0DuQKvrCh73M6D4nngeHJmvogF9OluXs7Hw==} + engines: {node: '>=16'} + + typescript@5.7.2: + resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} + engines: {node: '>=14.17'} + hasBin: true + + zod@3.24.1: + resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} + +snapshots: + + '@0no-co/graphql.web@1.0.12(graphql@16.10.0)': + optionalDependencies: + graphql: 16.10.0 + + '@graphql-typed-document-node/core@3.2.0(graphql@16.10.0)': + dependencies: + graphql: 16.10.0 + + '@molt/command@0.9.0': + dependencies: + '@molt/types': 0.2.0 + alge: 0.8.1 + chalk: 5.3.0 + lodash.camelcase: 4.3.0 + lodash.snakecase: 4.1.1 + readline-sync: 1.4.10 + string-length: 6.0.0 + strip-ansi: 7.1.0 + ts-toolbelt: 9.6.0 + type-fest: 4.30.1 + zod: 3.24.1 + + '@molt/types@0.2.0': + dependencies: + ts-toolbelt: 9.6.0 + + '@opentelemetry/api@1.9.0': {} + + '@opentelemetry/context-async-hooks@1.29.0(@opentelemetry/api@1.9.0)': + dependencies: + '@opentelemetry/api': 1.9.0 + + '@opentelemetry/core@1.29.0(@opentelemetry/api@1.9.0)': + dependencies: + '@opentelemetry/api': 1.9.0 + '@opentelemetry/semantic-conventions': 1.28.0 + + '@opentelemetry/propagator-b3@1.29.0(@opentelemetry/api@1.9.0)': + dependencies: + '@opentelemetry/api': 1.9.0 + '@opentelemetry/core': 1.29.0(@opentelemetry/api@1.9.0) + + '@opentelemetry/propagator-jaeger@1.29.0(@opentelemetry/api@1.9.0)': + dependencies: + '@opentelemetry/api': 1.9.0 + '@opentelemetry/core': 1.29.0(@opentelemetry/api@1.9.0) + + '@opentelemetry/resources@1.29.0(@opentelemetry/api@1.9.0)': + dependencies: + '@opentelemetry/api': 1.9.0 + '@opentelemetry/core': 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/semantic-conventions': 1.28.0 + + '@opentelemetry/sdk-trace-base@1.29.0(@opentelemetry/api@1.9.0)': + dependencies: + '@opentelemetry/api': 1.9.0 + '@opentelemetry/core': 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/resources': 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/semantic-conventions': 1.28.0 + + '@opentelemetry/sdk-trace-node@1.29.0(@opentelemetry/api@1.9.0)': + dependencies: + '@opentelemetry/api': 1.9.0 + '@opentelemetry/context-async-hooks': 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/core': 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/propagator-b3': 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/propagator-jaeger': 1.29.0(@opentelemetry/api@1.9.0) + '@opentelemetry/sdk-trace-base': 1.29.0(@opentelemetry/api@1.9.0) + semver: 7.6.3 + + '@opentelemetry/semantic-conventions@1.28.0': {} + + '@tsconfig/node20@20.1.4': {} + + '@tsconfig/strictest@2.0.5': {} + + alge@0.8.1: + dependencies: + lodash.ismatch: 4.4.0 + remeda: 1.61.0 + ts-toolbelt: 9.6.0 + zod: 3.24.1 + + ansi-regex@6.1.0: {} + + chalk@5.3.0: {} + + es-toolkit@1.30.1: {} + + graffle@file:..(@opentelemetry/api@1.9.0)(graphql@16.10.0): + dependencies: + '@0no-co/graphql.web': 1.0.12(graphql@16.10.0) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.10.0) + '@molt/command': 0.9.0 + es-toolkit: 1.30.1 + graphql: 16.10.0 + is-plain-obj: 4.1.0 + optionalDependencies: + '@opentelemetry/api': 1.9.0 + + graphql@16.10.0: {} + + is-plain-obj@4.1.0: {} + + lodash.camelcase@4.3.0: {} + + lodash.ismatch@4.4.0: {} + + lodash.snakecase@4.1.1: {} + + readline-sync@1.4.10: {} + + remeda@1.61.0: {} + + semver@7.6.3: {} + + string-length@6.0.0: + dependencies: + strip-ansi: 7.1.0 + + strip-ansi@7.1.0: + dependencies: + ansi-regex: 6.1.0 + + ts-toolbelt@9.6.0: {} + + type-fest@4.30.1: {} + + typescript@5.7.2: {} + + zod@3.24.1: {} diff --git a/examples/tsconfig.json b/examples/tsconfig.json new file mode 100644 index 000000000..bb376b25a --- /dev/null +++ b/examples/tsconfig.json @@ -0,0 +1,33 @@ +{ + "extends": [ + "@tsconfig/strictest/tsconfig.json", + "@tsconfig/node20/tsconfig.json" + ], + "compilerOptions": { + "lib": ["DOM", "DOM.Iterable", "ES2023"], + // Use ESM + "module": "NodeNext", + "moduleResolution": "nodenext", + + // TODO enable, leads to lots of errors currently. + "exactOptionalPropertyTypes": false, + // We handle these with ESLint: + "noUnusedLocals": false, + "noUnusedParameters": false, + + // DX + "sourceMap": true, + "declaration": true, + "declarationMap": true, + "incremental": true, + "tsBuildInfoFile": "node_modules/.cache/.tsbuildinfo", + "noErrorTruncation": true, + + // Other + "skipLibCheck": true, + "esModuleInterop": true, + "isolatedModules": false, + "verbatimModuleSyntax": true + }, + "include": ["."] +} diff --git a/package.json b/package.json index 147854aad..2e114f848 100644 --- a/package.json +++ b/package.json @@ -42,13 +42,13 @@ "default": "./build/entrypoints/extensions/transport-http/runtime.js" }, "./presets/bare": { - "default": "./build/entrypoints/presets/__GraffleBare.js" + "default": "./build/entrypoints/presets/bare.js" }, "./presets/basic": { - "default": "./build/entrypoints/presets/__GraffleBasic.js" + "default": "./build/entrypoints/presets/basic.js" }, "./presets/minimal": { - "default": "./build/entrypoints/presets/__GraffleMinimal.js" + "default": "./build/entrypoints/presets/minimal.js" }, "./client": { "default": "./build/entrypoints/client.js" @@ -92,15 +92,17 @@ "serve:pokemon": "tsx tests/_/services/pokemonManual.ts", "gen:graffle": "pnpm gen:graffle:tests && pnpm build && cd website && pnpm gen:graffle", "gen:graffle:tests": "tsx tests/_/schemas/generate.ts && pnpm graffle --project src/extensions/SchemaErrors/tests/fixture", + "gen:graffle:examples": "tsx tests/_/schemas/generate.ts && pnpm graffle --defaultSchemaUrl http://localhost:3000/graphql --schema ./tests/_/schemas/pokemon/schema.graphql --output ./examples/$/graffle", "graffle": "tsx ./src/generator/cli/generate.ts", "gen:examples": "tsx scripts/generate-examples-derivatives/generate.ts && pnpm format", "dev": "rm -rf dist && tsc --watch", "format": "pnpm build:docs && dprint fmt", - "lint": "eslint . --fix", - "check": "pnpm check:types && pnpm check:format && pnpm check:lint && pnpm check:publint", - "check:types": "pnpm tsc --noEmit", + "lint": "eslint . --fix --ignore-pattern 'website' --ignore-pattern 'build'", + "check": "pnpm check:types && pnpm check:format && pnpm check:lint && pnpm check:publint && pnpm examples:check:types", + "examples:check:types": "cd examples && tsc --noEmit", + "check:types": "tsc --noEmit", "check:format": "dprint check && pnpm build:docs && git diff --exit-code README.md", - "check:lint": "eslint . --max-warnings 0", + "check:lint": "eslint . --max-warnings 0 --ignore-pattern 'website' --ignore-pattern 'build'", "check:publint": "publint run --strict", "prepublishOnly": "pnpm build", "build:docs": "doctoc README.md --notitle && dprint fmt README.md", diff --git a/scripts/generate-examples-derivatives/generate-docs.ts b/scripts/generate-examples-derivatives/generate-docs.ts index 32b0da176..d533a1666 100644 --- a/scripts/generate-examples-derivatives/generate-docs.ts +++ b/scripts/generate-examples-derivatives/generate-docs.ts @@ -131,24 +131,8 @@ const generateExampleLinksSnippets = async (examplesTransformed: ExampleTransfor const transformRewriteGraffleImports = (example: Example) => { const defaultSchema = `pokemon` - const newContent = example.file.content - .replaceAll(/from '.+\/tests\/_\/schemas\/(.*)\/graffle\/(.+)\.js'/g, `from './$1/$2.js'`) - .replaceAll( - /from '.*entrypoints\/extensions\/(.*?)\/runtime.js'/g, - `from 'graffle/extensions/$1'`, - ) - .replaceAll( - /from '.*entrypoints\/extensions\/(.*?)\/gentime.js'/g, - `from 'graffle/extensions/$1/generator'`, - ) - .replaceAll( - /from '.*entrypoints\/main.js'/g, - `from 'graffle'`, - ) - .replaceAll( - /from '.*entrypoints\/(.*?).js'/g, - `from 'graffle/$1'`, - ) + let newContent = example.file.content + .replaceAll(/from '..\/\$\/graffle\/__.js'/g, `from './graffle/__.js'`) // The examples that use Pokemon schema are mapped to the default schema in the documentation. // This works with Twoslash because we generate a pokemon schema in the website root directory. .replaceAll(new RegExp(`(import.*./)${defaultSchema}`, `g`), `$1graffle`) @@ -156,6 +140,15 @@ const transformRewriteGraffleImports = (example: Example) => { // Any $ imports are entirely removed. .replaceAll(/import.*'.*\$.*'\n/g, ``) + newContent = ` +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + +${newContent.trim()}` + return { ...example, file: { diff --git a/src/client/properties/gql/gql.test-d.ts b/src/client/properties/gql/gql.test-d.ts index 875968bbb..2eb7d515e 100644 --- a/src/client/properties/gql/gql.test-d.ts +++ b/src/client/properties/gql/gql.test-d.ts @@ -1,7 +1,7 @@ import { kitchenSink } from '../../../../tests/_/helpers.js' -import { GraffleBare } from '../../../entrypoints/presets/__GraffleBare.js' -import { GraffleBasic } from '../../../entrypoints/presets/__GraffleBasic.js' -import { GraffleMinimal } from '../../../entrypoints/presets/__GraffleMinimal.js' +import { GraffleBare } from '../../../entrypoints/presets/bare.js' +import { GraffleBasic } from '../../../entrypoints/presets/basic.js' +import { GraffleMinimal } from '../../../entrypoints/presets/minimal.js' import { assertType } from '../../../lib/assert-equal.js' import type { Grafaid } from '../../../lib/grafaid/__.js' import type { ClientTransports } from '../../../types/context.js' diff --git a/src/entrypoints/_Graffle.ts b/src/entrypoints/_Graffle.ts index ce35200ec..8d8235fec 100644 --- a/src/entrypoints/_Graffle.ts +++ b/src/entrypoints/_Graffle.ts @@ -1,2 +1,2 @@ export * as Scalars from './_Scalars.js' -export { create } from './presets/minimal.js' +export { create } from './presets/_minimal.js' diff --git a/src/entrypoints/presets/__GraffleBare.ts b/src/entrypoints/presets/__GraffleBare.ts deleted file mode 100644 index 3ae7cf28b..000000000 --- a/src/entrypoints/presets/__GraffleBare.ts +++ /dev/null @@ -1 +0,0 @@ -export * as GraffleBare from './bare.js' diff --git a/src/entrypoints/presets/__GraffleBasic.ts b/src/entrypoints/presets/__GraffleBasic.ts deleted file mode 100644 index 99f180138..000000000 --- a/src/entrypoints/presets/__GraffleBasic.ts +++ /dev/null @@ -1 +0,0 @@ -export * as GraffleBasic from './basic.js' diff --git a/src/entrypoints/presets/__GraffleMinimal.ts b/src/entrypoints/presets/__GraffleMinimal.ts deleted file mode 100644 index 8fb2dbc63..000000000 --- a/src/entrypoints/presets/__GraffleMinimal.ts +++ /dev/null @@ -1 +0,0 @@ -export * as GraffleMinimal from './minimal.js' diff --git a/src/entrypoints/presets/_bare.ts b/src/entrypoints/presets/_bare.ts new file mode 100644 index 000000000..d09d52895 --- /dev/null +++ b/src/entrypoints/presets/_bare.ts @@ -0,0 +1,5 @@ +import type { Client as BaseClient } from '../../client/client.js' +import type { Context } from '../../types/context.js' +export { create } from '../../client/client.js' + +export type Client = BaseClient diff --git a/src/entrypoints/presets/_basic.ts b/src/entrypoints/presets/_basic.ts new file mode 100644 index 000000000..57261e24d --- /dev/null +++ b/src/entrypoints/presets/_basic.ts @@ -0,0 +1,29 @@ +import { type Client as BaseClient, createConstructorWithContext } from '../../client/client.js' +import { useReducer } from '../../client/properties/use.js' +import type { ConfigManager } from '../../lib/config-manager/__.js' +import { Context, type Context as BaseContext } from '../../types/context.js' +import { TransportHttp } from '../extensions/transport-http/runtime.js' +import { TransportMemory } from '../extensions/transport-memory/runtime.js' +import type { PartialOrUndefined } from '../main.js' + +const context = useReducer(useReducer(Context.States.contextEmpty, TransportHttp()), TransportMemory()) + +type BasicClientContext = typeof context + +export const create = createConstructorWithContext(context) + +export type Client = BaseClient + +export namespace Client { + export type Context = BasicClientContext + + export type With<$ContextNewPartial extends PartialOrUndefined> = BaseClient< + // @ts-expect-error fixme + ConfigManager.SetKeysOptional< + BasicClientContext, + $ContextNewPartial + >, + {}, + {} + > +} diff --git a/src/entrypoints/presets/_minimal.ts b/src/entrypoints/presets/_minimal.ts new file mode 100644 index 000000000..fdf03487f --- /dev/null +++ b/src/entrypoints/presets/_minimal.ts @@ -0,0 +1,28 @@ +import { type Client as BaseClient, createConstructorWithContext } from '../../client/client.js' +import { useReducer } from '../../client/properties/use.js' +import type { ConfigManager } from '../../lib/config-manager/__.js' +import { Context, type Context as BaseContext } from '../../types/context.js' +import { TransportHttp } from '../extensions/transport-http/runtime.js' +import type { PartialOrUndefined } from '../main.js' + +const context = useReducer(Context.States.contextEmpty, TransportHttp()) + +export type MinimalClientContext = typeof context + +export const create = createConstructorWithContext(context) + +export type Client = BaseClient + +export namespace Client { + export type Context = MinimalClientContext + + export type With<$ContextNewPartial extends PartialOrUndefined> = BaseClient< + // @ts-expect-error fixme + ConfigManager.SetKeysOptional< + MinimalClientContext, + $ContextNewPartial + >, + {}, + {} + > +} diff --git a/src/entrypoints/presets/bare.ts b/src/entrypoints/presets/bare.ts index d09d52895..5264609a1 100644 --- a/src/entrypoints/presets/bare.ts +++ b/src/entrypoints/presets/bare.ts @@ -1,5 +1 @@ -import type { Client as BaseClient } from '../../client/client.js' -import type { Context } from '../../types/context.js' -export { create } from '../../client/client.js' - -export type Client = BaseClient +export * as GraffleBare from './_bare.js' diff --git a/src/entrypoints/presets/basic.ts b/src/entrypoints/presets/basic.ts index 57261e24d..9f66b9b40 100644 --- a/src/entrypoints/presets/basic.ts +++ b/src/entrypoints/presets/basic.ts @@ -1,29 +1 @@ -import { type Client as BaseClient, createConstructorWithContext } from '../../client/client.js' -import { useReducer } from '../../client/properties/use.js' -import type { ConfigManager } from '../../lib/config-manager/__.js' -import { Context, type Context as BaseContext } from '../../types/context.js' -import { TransportHttp } from '../extensions/transport-http/runtime.js' -import { TransportMemory } from '../extensions/transport-memory/runtime.js' -import type { PartialOrUndefined } from '../main.js' - -const context = useReducer(useReducer(Context.States.contextEmpty, TransportHttp()), TransportMemory()) - -type BasicClientContext = typeof context - -export const create = createConstructorWithContext(context) - -export type Client = BaseClient - -export namespace Client { - export type Context = BasicClientContext - - export type With<$ContextNewPartial extends PartialOrUndefined> = BaseClient< - // @ts-expect-error fixme - ConfigManager.SetKeysOptional< - BasicClientContext, - $ContextNewPartial - >, - {}, - {} - > -} +export * as GraffleBasic from './_basic.js' diff --git a/src/entrypoints/presets/minimal.ts b/src/entrypoints/presets/minimal.ts index fdf03487f..993bdc950 100644 --- a/src/entrypoints/presets/minimal.ts +++ b/src/entrypoints/presets/minimal.ts @@ -1,28 +1 @@ -import { type Client as BaseClient, createConstructorWithContext } from '../../client/client.js' -import { useReducer } from '../../client/properties/use.js' -import type { ConfigManager } from '../../lib/config-manager/__.js' -import { Context, type Context as BaseContext } from '../../types/context.js' -import { TransportHttp } from '../extensions/transport-http/runtime.js' -import type { PartialOrUndefined } from '../main.js' - -const context = useReducer(Context.States.contextEmpty, TransportHttp()) - -export type MinimalClientContext = typeof context - -export const create = createConstructorWithContext(context) - -export type Client = BaseClient - -export namespace Client { - export type Context = MinimalClientContext - - export type With<$ContextNewPartial extends PartialOrUndefined> = BaseClient< - // @ts-expect-error fixme - ConfigManager.SetKeysOptional< - MinimalClientContext, - $ContextNewPartial - >, - {}, - {} - > -} +export * as GraffleMinimal from './_minimal.js' diff --git a/src/extensions/Upload/Upload.test.ts b/src/extensions/Upload/Upload.test.ts index f2d9df94a..d2056aeaa 100644 --- a/src/extensions/Upload/Upload.test.ts +++ b/src/extensions/Upload/Upload.test.ts @@ -7,7 +7,7 @@ import { Graffle } from '../../entrypoints/main.js' import { Upload } from './Upload.js' import { type SchemaService, serveSchema } from '../../../tests/_/lib/serveSchema.js' -import type { GraffleMinimal } from '../../entrypoints/presets/__GraffleMinimal.js' +import type { GraffleMinimal } from '../../entrypoints/presets/minimal.js' let schemaServer: SchemaService diff --git a/src/generator/generators/Client.ts b/src/generator/generators/Client.ts index a4ae57e21..71ab51d3b 100644 --- a/src/generator/generators/Client.ts +++ b/src/generator/generators/Client.ts @@ -5,7 +5,7 @@ import { ModuleGeneratorScalar } from './Scalar.js' import { ModuleGeneratorSchemaDrivenDataMap } from './SchemaDrivenDataMap.js' export const ModuleGeneratorClient = createModuleGenerator( - `Client`, + `client`, ({ config, code }) => { code(importModuleGenerator(config, ModuleGeneratorSchemaDrivenDataMap)) code(importModuleGenerator(config, ModuleGeneratorData)) diff --git a/src/generator/generators/Data.ts b/src/generator/generators/Data.ts index 39b85902c..fcc1089af 100644 --- a/src/generator/generators/Data.ts +++ b/src/generator/generators/Data.ts @@ -1,7 +1,7 @@ import { createModuleGenerator } from '../helpers/moduleGenerator.js' export const ModuleGeneratorData = createModuleGenerator( - `Data`, + `data`, ({ config, code }) => { code( `export const Name = \`${config.name}\``, diff --git a/src/generator/generators/Scalar.ts b/src/generator/generators/Scalar.ts index a9c521052..36cab3918 100644 --- a/src/generator/generators/Scalar.ts +++ b/src/generator/generators/Scalar.ts @@ -6,7 +6,7 @@ import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { typeTitle2 } from '../helpers/render.js' export const ModuleGeneratorScalar = createModuleGenerator( - `Scalar`, + `scalar`, ({ config, code }) => { // todo test case for when this is true const isNeedCustomScalarDefaults = Grafaid.Schema.KindMap.hasCustomScalars(config.schema.kindMap) diff --git a/src/generator/generators/Schema.ts b/src/generator/generators/Schema.ts index 170f09b5d..35fe20832 100644 --- a/src/generator/generators/Schema.ts +++ b/src/generator/generators/Schema.ts @@ -11,7 +11,7 @@ import { ModuleGeneratorData } from './Data.js' import { ModuleGeneratorScalar } from './Scalar.js' export const ModuleGeneratorSchema = createModuleGenerator( - `Schema`, + `schema`, ({ config, code }) => { const kindMap = config.schema.kindMap.list const kinds = entries(kindMap) diff --git a/src/generator/generators/Select.ts b/src/generator/generators/Select.ts index 85f983aa0..e5569d0ae 100644 --- a/src/generator/generators/Select.ts +++ b/src/generator/generators/Select.ts @@ -9,7 +9,7 @@ import { ModuleGeneratorSchema } from './Schema.js' import { ModuleGeneratorSelectionSets } from './SelectionSets.js' export const ModuleGeneratorSelect = createModuleGenerator( - `Select`, + `select`, ({ config, code }) => { const iSchema = `${identifiers.$$Schema}.Schema` const enumMemberName = { diff --git a/src/generator/generators/global.ts b/src/generator/generators/global.ts index 057676881..84958d000 100644 --- a/src/generator/generators/global.ts +++ b/src/generator/generators/global.ts @@ -8,7 +8,7 @@ import { ModuleGeneratorMethodsSelect } from './MethodsSelect.js' import { ModuleGeneratorSchema } from './Schema.js' export const ModuleGeneratorGlobal = createModuleGenerator( - `Global`, + `global`, ({ config, code }) => { code(importModuleGenerator(config, ModuleGeneratorData)) code(importModuleGenerator(config, ModuleGeneratorMethodsSelect)) diff --git a/tests/_/helpers.ts b/tests/_/helpers.ts index a2379be1b..2937cd2d3 100644 --- a/tests/_/helpers.ts +++ b/tests/_/helpers.ts @@ -5,8 +5,8 @@ import * as Path from 'node:path' import type { Mock } from 'vitest' import { test as testBase, vi } from 'vitest' import { Graffle } from '../../src/entrypoints/main.js' -import type { GraffleBasic } from '../../src/entrypoints/presets/__GraffleBasic.js' -import type { GraffleMinimal } from '../../src/entrypoints/presets/__GraffleMinimal.js' +import type { GraffleBasic } from '../../src/entrypoints/presets/basic.js' +import type { GraffleMinimal } from '../../src/entrypoints/presets/minimal.js' import type { SchemaDrivenDataMap } from '../../src/entrypoints/utilities-for-generated.js' import { TransportMemory } from '../../src/extensions/TransportMemory/TransportMemory.js' import type { ConfigManager } from '../../src/lib/config-manager/__.js' diff --git a/tests/_/schemas/pokemon/schema.graphql b/tests/_/schemas/pokemon/schema.graphql new file mode 100644 index 000000000..5761276fc --- /dev/null +++ b/tests/_/schemas/pokemon/schema.graphql @@ -0,0 +1,129 @@ +union Battle = BattleRoyale | BattleTrainer | BattleWild + +type BattleRoyale { + combatants: [CombatantMultiPokemon!] + date: Float + id: ID + winner: Trainer +} + +type BattleTrainer { + combatant1: CombatantSinglePokemon + combatant2: CombatantSinglePokemon + date: Float + id: ID + winner: Trainer +} + +type BattleWild { + date: Float + id: ID + pokemon: Pokemon + result: BattleWildResult + trainer: Trainer + wildPokemons: [Pokemon!] +} + +enum BattleWildResult { + pokemonsCaptured + pokemonsDefeated + trainerDefeated +} + +interface Being { + id: ID + name: String +} + +type CombatantMultiPokemon { + pokemons: [Pokemon!] + trainer: Trainer +} + +type CombatantSinglePokemon { + pokemon: Pokemon + trainer: Trainer +} + +""" +A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format. +""" +scalar Date + +input DateFilter { + gte: Date + lte: Date +} + +type Mutation { + addPokemon(attack: Int, defense: Int, hp: Int, name: String!, type: PokemonType!): Pokemon +} + +type Patron implements Being { + id: ID + money: Int + name: String +} + +type Pokemon implements Being { + attack: Int! + birthday: Date! + defense: Int! + hp: Int! + id: ID! + name: String! + trainer: Trainer + type: PokemonType! +} + +input PokemonFilter { + birthday: DateFilter + name: StringFilter + type: PokemonType +} + +enum PokemonType { + bug + electric + fire + grass + water +} + +type Query { + battles: [Battle!]! + beings: [Being!]! + pokemonByName(name: String!): [Pokemon!] + pokemons(filter: PokemonFilter): [Pokemon!] + trainerByName(name: String!): Trainer + trainers: [Trainer!] +} + +input StringFilter { + contains: String + in: [String!] +} + +type Trainer implements Being { + class: TrainerClass + fans: [Patron!] + id: ID + name: String + pokemon: [Pokemon!] +} + +enum TrainerClass { + bugCatcher + camper + picnicker + psychic + psychicMedium + psychicYoungster + sailor + superNerd + tamer + teamRocketGrunt + triathlete + youngster + youth +} \ No newline at end of file diff --git a/tests/examples/65_preset/preset_none.test.ts b/tests/examples/65_preset/preset_bare.test.ts similarity index 85% rename from tests/examples/65_preset/preset_none.test.ts rename to tests/examples/65_preset/preset_bare.test.ts index 5667598f5..c6144174c 100644 --- a/tests/examples/65_preset/preset_none.test.ts +++ b/tests/examples/65_preset/preset_bare.test.ts @@ -7,13 +7,13 @@ import { expect, test } from 'vitest' import { runExample } from '../../../scripts/generate-examples-derivatives/helpers.js' -test(`preset_none`, async () => { - const exampleResult = await runExample(`./examples/65_preset/preset_none.ts`) +test(`preset_bare`, async () => { + const exampleResult = await runExample(`./examples/65_preset/preset_bare.ts`) // Examples should output their data results. const exampleResultMaybeEncoded = exampleResult // If ever outputs vary by Node version, you can use this to snapshot by Node version. // const nodeMajor = process.version.match(/v(\d+)/)?.[1] ?? `unknown` await expect(exampleResultMaybeEncoded).toMatchFileSnapshot( - `../../../examples/__outputs__/65_preset/preset_none.output.txt`, + `../../../examples/__outputs__/65_preset/preset_bare.output.txt`, ) }) diff --git a/tsconfig.json b/tsconfig.json index 37d9f66e5..7396d30ef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,5 +30,5 @@ "verbatimModuleSyntax": true }, "include": ["src", "tests", "examples", "scripts"], - "exclude": ["build"] + "exclude": ["build", "examples"] } diff --git a/website/.vitepress/config.ts b/website/.vitepress/config.ts index 9b276f3aa..ebf9d9e92 100644 --- a/website/.vitepress/config.ts +++ b/website/.vitepress/config.ts @@ -105,8 +105,8 @@ export default defineConfig({ }), twoslashOptions: { handbookOptions: { - noErrors: true, - noErrorValidation: process.env.NODE_ENV !== 'development', + // noErrors: true, + // noErrorValidation: process.env.NODE_ENV !== 'development', }, compilerOptions: { moduleResolution: ModuleResolutionKind.Bundler, diff --git a/website/content/_snippets/example-links/none.md b/website/content/_snippets/example-links/bare.md similarity index 52% rename from website/content/_snippets/example-links/none.md rename to website/content/_snippets/example-links/bare.md index 742a45e3b..c514ee7eb 100644 --- a/website/content/_snippets/example-links/none.md +++ b/website/content/_snippets/example-links/bare.md @@ -1 +1 @@ - + diff --git a/website/content/_snippets/example-links/preset.md b/website/content/_snippets/example-links/preset.md index 0061ac983..122e33ea6 100644 --- a/website/content/_snippets/example-links/preset.md +++ b/website/content/_snippets/example-links/preset.md @@ -1 +1 @@ - + diff --git a/website/content/_snippets/example-links/preset_none.md b/website/content/_snippets/example-links/preset_bare.md similarity index 52% rename from website/content/_snippets/example-links/preset_none.md rename to website/content/_snippets/example-links/preset_bare.md index 742a45e3b..c514ee7eb 100644 --- a/website/content/_snippets/example-links/preset_none.md +++ b/website/content/_snippets/example-links/preset_bare.md @@ -1 +1 @@ - + diff --git a/website/content/_snippets/examples/anyware/jump-start.detail.md b/website/content/_snippets/examples/anyware/jump-start.detail.md index a2774f8d8..601a26dbf 100644 --- a/website/content/_snippets/examples/anyware/jump-start.detail.md +++ b/website/content/_snippets/examples/anyware/jump-start.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' Graffle diff --git a/website/content/_snippets/examples/anyware/jump-start.md b/website/content/_snippets/examples/anyware/jump-start.md index 198869088..db240d9ab 100644 --- a/website/content/_snippets/examples/anyware/jump-start.md +++ b/website/content/_snippets/examples/anyware/jump-start.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' Graffle diff --git a/website/content/_snippets/examples/anyware/short-circuit.detail.md b/website/content/_snippets/examples/anyware/short-circuit.detail.md index eceb2f241..28f385b0d 100644 --- a/website/content/_snippets/examples/anyware/short-circuit.detail.md +++ b/website/content/_snippets/examples/anyware/short-circuit.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' Graffle diff --git a/website/content/_snippets/examples/anyware/short-circuit.md b/website/content/_snippets/examples/anyware/short-circuit.md index 1dc1324c1..96708e2e1 100644 --- a/website/content/_snippets/examples/anyware/short-circuit.md +++ b/website/content/_snippets/examples/anyware/short-circuit.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' Graffle diff --git a/website/content/_snippets/examples/anyware/slot-body.detail.md b/website/content/_snippets/examples/anyware/slot-body.detail.md index 715e81e8d..69e4dfddc 100644 --- a/website/content/_snippets/examples/anyware/slot-body.detail.md +++ b/website/content/_snippets/examples/anyware/slot-body.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/anyware/slot-body.md b/website/content/_snippets/examples/anyware/slot-body.md index 566be4f06..929423b20 100644 --- a/website/content/_snippets/examples/anyware/slot-body.md +++ b/website/content/_snippets/examples/anyware/slot-body.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/anyware/slot-fetch.detail.md b/website/content/_snippets/examples/anyware/slot-fetch.detail.md index 14cc7adc2..c207aea0b 100644 --- a/website/content/_snippets/examples/anyware/slot-fetch.detail.md +++ b/website/content/_snippets/examples/anyware/slot-fetch.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/anyware/slot-fetch.md b/website/content/_snippets/examples/anyware/slot-fetch.md index 2f824d141..2f5e0131c 100644 --- a/website/content/_snippets/examples/anyware/slot-fetch.md +++ b/website/content/_snippets/examples/anyware/slot-fetch.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/anyware/slot-search-params.detail.md b/website/content/_snippets/examples/anyware/slot-search-params.detail.md index 8bab72a2c..37e8d0072 100644 --- a/website/content/_snippets/examples/anyware/slot-search-params.detail.md +++ b/website/content/_snippets/examples/anyware/slot-search-params.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/anyware/slot-search-params.md b/website/content/_snippets/examples/anyware/slot-search-params.md index 5db22e21b..f4ae5c0b8 100644 --- a/website/content/_snippets/examples/anyware/slot-search-params.md +++ b/website/content/_snippets/examples/anyware/slot-search-params.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/custom-scalar/custom-scalar.detail.md b/website/content/_snippets/examples/custom-scalar/custom-scalar.detail.md index 3b6ce4cef..394030445 100644 --- a/website/content/_snippets/examples/custom-scalar/custom-scalar.detail.md +++ b/website/content/_snippets/examples/custom-scalar/custom-scalar.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const graffle = Graffle diff --git a/website/content/_snippets/examples/custom-scalar/custom-scalar.md b/website/content/_snippets/examples/custom-scalar/custom-scalar.md index c8be7d902..50c958fb9 100644 --- a/website/content/_snippets/examples/custom-scalar/custom-scalar.md +++ b/website/content/_snippets/examples/custom-scalar/custom-scalar.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const graffle = Graffle diff --git a/website/content/_snippets/examples/document-builder/alias.detail.md b/website/content/_snippets/examples/document-builder/alias.detail.md index 3c11a24d8..762cb89bf 100644 --- a/website/content/_snippets/examples/document-builder/alias.detail.md +++ b/website/content/_snippets/examples/document-builder/alias.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/alias.md b/website/content/_snippets/examples/document-builder/alias.md index 10254b29a..0a3bcf47e 100644 --- a/website/content/_snippets/examples/document-builder/alias.md +++ b/website/content/_snippets/examples/document-builder/alias.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/arguments.detail.md b/website/content/_snippets/examples/document-builder/arguments.detail.md index 22d6b4cd1..7a564aad3 100644 --- a/website/content/_snippets/examples/document-builder/arguments.detail.md +++ b/website/content/_snippets/examples/document-builder/arguments.detail.md @@ -5,11 +5,17 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' -const atlas = Graffle.create() +const graffle = Graffle.create() -const pokemons = await atlas.query.pokemons({ +const pokemons = await graffle.query.pokemons({ $: { filter: { name: { in: [`Pikachu`, `Charizard`] } } }, // [!code highlight] name: true, trainer: { name: true }, diff --git a/website/content/_snippets/examples/document-builder/arguments.md b/website/content/_snippets/examples/document-builder/arguments.md index 99850e485..80a095c8c 100644 --- a/website/content/_snippets/examples/document-builder/arguments.md +++ b/website/content/_snippets/examples/document-builder/arguments.md @@ -3,11 +3,17 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' -const atlas = Graffle.create() +const graffle = Graffle.create() -const pokemons = await atlas.query.pokemons({ +const pokemons = await graffle.query.pokemons({ $: { filter: { name: { in: [`Pikachu`, `Charizard`] } } }, // [!code highlight] name: true, trainer: { name: true }, diff --git a/website/content/_snippets/examples/document-builder/batch.detail.md b/website/content/_snippets/examples/document-builder/batch.detail.md index 4979406ed..0b930f3b3 100644 --- a/website/content/_snippets/examples/document-builder/batch.detail.md +++ b/website/content/_snippets/examples/document-builder/batch.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/batch.md b/website/content/_snippets/examples/document-builder/batch.md index 7192d73ad..e33bc3948 100644 --- a/website/content/_snippets/examples/document-builder/batch.md +++ b/website/content/_snippets/examples/document-builder/batch.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/directive.detail.md b/website/content/_snippets/examples/document-builder/directive.detail.md index e37ea90e3..6eb9b21e8 100644 --- a/website/content/_snippets/examples/document-builder/directive.detail.md +++ b/website/content/_snippets/examples/document-builder/directive.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/directive.md b/website/content/_snippets/examples/document-builder/directive.md index 28709a58e..73b2c3084 100644 --- a/website/content/_snippets/examples/document-builder/directive.md +++ b/website/content/_snippets/examples/document-builder/directive.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/document.detail.md b/website/content/_snippets/examples/document-builder/document.detail.md index 311e28003..079c599a8 100644 --- a/website/content/_snippets/examples/document-builder/document.detail.md +++ b/website/content/_snippets/examples/document-builder/document.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/document.md b/website/content/_snippets/examples/document-builder/document.md index 1bff75323..0c24f17f8 100644 --- a/website/content/_snippets/examples/document-builder/document.md +++ b/website/content/_snippets/examples/document-builder/document.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/interface.detail.md b/website/content/_snippets/examples/document-builder/interface.detail.md index b53829155..3ca77cfd3 100644 --- a/website/content/_snippets/examples/document-builder/interface.detail.md +++ b/website/content/_snippets/examples/document-builder/interface.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/interface.md b/website/content/_snippets/examples/document-builder/interface.md index f9a774821..eb56dfd57 100644 --- a/website/content/_snippets/examples/document-builder/interface.md +++ b/website/content/_snippets/examples/document-builder/interface.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/root-field.detail.md b/website/content/_snippets/examples/document-builder/root-field.detail.md index d63f0517b..0c0758e24 100644 --- a/website/content/_snippets/examples/document-builder/root-field.detail.md +++ b/website/content/_snippets/examples/document-builder/root-field.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/root-field.md b/website/content/_snippets/examples/document-builder/root-field.md index b33d04d26..6ed6df967 100644 --- a/website/content/_snippets/examples/document-builder/root-field.md +++ b/website/content/_snippets/examples/document-builder/root-field.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/union.detail.md b/website/content/_snippets/examples/document-builder/union.detail.md index ef3952db5..581649561 100644 --- a/website/content/_snippets/examples/document-builder/union.detail.md +++ b/website/content/_snippets/examples/document-builder/union.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/document-builder/union.md b/website/content/_snippets/examples/document-builder/union.md index 7e9082914..024b58260 100644 --- a/website/content/_snippets/examples/document-builder/union.md +++ b/website/content/_snippets/examples/document-builder/union.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/extension/introspection.detail.md b/website/content/_snippets/examples/extension/introspection.detail.md index 919b67b30..104e404a2 100644 --- a/website/content/_snippets/examples/extension/introspection.detail.md +++ b/website/content/_snippets/examples/extension/introspection.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Introspection } from 'graffle/extensions/introspection' import { Graffle } from './graffle/__.js' @@ -20,8 +26,8 @@ console.log(data) { __schema: { description: null, - queryType: { name: 'Query' }, - mutationType: { name: 'Mutation' }, + queryType: { name: 'Query', kind: 'OBJECT' }, + mutationType: { name: 'Mutation', kind: 'OBJECT' }, subscriptionType: null, types: [ { diff --git a/website/content/_snippets/examples/extension/introspection.md b/website/content/_snippets/examples/extension/introspection.md index 894dce9c6..bc75bc7fb 100644 --- a/website/content/_snippets/examples/extension/introspection.md +++ b/website/content/_snippets/examples/extension/introspection.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Introspection } from 'graffle/extensions/introspection' import { Graffle } from './graffle/__.js' @@ -18,8 +24,8 @@ console.log(data) { __schema: { description: null, - queryType: { name: 'Query' }, - mutationType: { name: 'Mutation' }, + queryType: { name: 'Query', kind: 'OBJECT' }, + mutationType: { name: 'Mutation', kind: 'OBJECT' }, subscriptionType: null, types: [ { diff --git a/website/content/_snippets/examples/extension/opentelemetry.detail.md b/website/content/_snippets/examples/extension/opentelemetry.detail.md index 1e0bc9015..9df6a4c57 100644 --- a/website/content/_snippets/examples/extension/opentelemetry.detail.md +++ b/website/content/_snippets/examples/extension/opentelemetry.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' import { Opentelemetry } from 'graffle/extensions/opentelemetry' @@ -33,18 +39,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'encode', - id: 'b4f6b90f9d4cb7f9', + id: '0932a4af7db7f676', kind: 0, - timestamp: 1734293285758000, - duration: 1165.458, + timestamp: 1734313684255000, + duration: 886.584, attributes: {}, status: { code: 0 }, events: [], @@ -60,18 +66,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'pack', - id: '28d86e022df6a130', + id: '2dac90b2b7dae9cf', kind: 0, - timestamp: 1734293285761000, - duration: 123866.625, + timestamp: 1734313684257000, + duration: 9667.791, attributes: {}, status: { code: 0 }, events: [], @@ -87,18 +93,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'exchange', - id: '009c240ba45bff12', + id: 'c9162ca6e544cf37', kind: 0, - timestamp: 1734293285888000, - duration: 60630.292, + timestamp: 1734313684267000, + duration: 15232.833, attributes: {}, status: { code: 0 }, events: [], @@ -114,18 +120,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'unpack', - id: '1a49677d316b711e', + id: 'c360e1de02b2f249', kind: 0, - timestamp: 1734293285949000, - duration: 1003.209, + timestamp: 1734313684283000, + duration: 773.625, attributes: {}, status: { code: 0 }, events: [], @@ -141,18 +147,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'decode', - id: '3b7f0a2030462e74', + id: '6f38295d85844fd0', kind: 0, - timestamp: 1734293285950000, - duration: 444.291, + timestamp: 1734313684283000, + duration: 400.083, attributes: {}, status: { code: 0 }, events: [], @@ -168,18 +174,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', parentId: undefined, traceState: undefined, name: 'request', - id: '65825892207135a8', + id: 'fff65363c3906c5f', kind: 0, - timestamp: 1734293285757000, - duration: 193579.292, + timestamp: 1734313684255000, + duration: 29236.834, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/_snippets/examples/extension/opentelemetry.md b/website/content/_snippets/examples/extension/opentelemetry.md index 30ba21821..fefe6d20f 100644 --- a/website/content/_snippets/examples/extension/opentelemetry.md +++ b/website/content/_snippets/examples/extension/opentelemetry.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' import { Opentelemetry } from 'graffle/extensions/opentelemetry' @@ -31,18 +37,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'encode', - id: 'b4f6b90f9d4cb7f9', + id: '0932a4af7db7f676', kind: 0, - timestamp: 1734293285758000, - duration: 1165.458, + timestamp: 1734313684255000, + duration: 886.584, attributes: {}, status: { code: 0 }, events: [], @@ -58,18 +64,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'pack', - id: '28d86e022df6a130', + id: '2dac90b2b7dae9cf', kind: 0, - timestamp: 1734293285761000, - duration: 123866.625, + timestamp: 1734313684257000, + duration: 9667.791, attributes: {}, status: { code: 0 }, events: [], @@ -85,18 +91,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'exchange', - id: '009c240ba45bff12', + id: 'c9162ca6e544cf37', kind: 0, - timestamp: 1734293285888000, - duration: 60630.292, + timestamp: 1734313684267000, + duration: 15232.833, attributes: {}, status: { code: 0 }, events: [], @@ -112,18 +118,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'unpack', - id: '1a49677d316b711e', + id: 'c360e1de02b2f249', kind: 0, - timestamp: 1734293285949000, - duration: 1003.209, + timestamp: 1734313684283000, + duration: 773.625, attributes: {}, status: { code: 0 }, events: [], @@ -139,18 +145,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'decode', - id: '3b7f0a2030462e74', + id: '6f38295d85844fd0', kind: 0, - timestamp: 1734293285950000, - duration: 444.291, + timestamp: 1734313684283000, + duration: 400.083, attributes: {}, status: { code: 0 }, events: [], @@ -166,18 +172,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', parentId: undefined, traceState: undefined, name: 'request', - id: '65825892207135a8', + id: 'fff65363c3906c5f', kind: 0, - timestamp: 1734293285757000, - duration: 193579.292, + timestamp: 1734313684255000, + duration: 29236.834, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/_snippets/examples/extension/throws.detail.md b/website/content/_snippets/examples/extension/throws.detail.md index 126d483b3..5ae885f5a 100644 --- a/website/content/_snippets/examples/extension/throws.detail.md +++ b/website/content/_snippets/examples/extension/throws.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Throws } from 'graffle/extensions/throws' import { Graffle } from './graffle/__.js' diff --git a/website/content/_snippets/examples/extension/throws.md b/website/content/_snippets/examples/extension/throws.md index 9cd008a66..2bf513916 100644 --- a/website/content/_snippets/examples/extension/throws.md +++ b/website/content/_snippets/examples/extension/throws.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Throws } from 'graffle/extensions/throws' import { Graffle } from './graffle/__.js' diff --git a/website/content/_snippets/examples/gql/gql-document-node-typed.detail.md b/website/content/_snippets/examples/gql/gql-document-node-typed.detail.md index cba63d9f6..256483f85 100644 --- a/website/content/_snippets/examples/gql/gql-document-node-typed.detail.md +++ b/website/content/_snippets/examples/gql/gql-document-node-typed.detail.md @@ -5,8 +5,14 @@ ```ts twoslash -import { parse, type TypedQueryDocumentNode } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' +import { parse, type TypedQueryDocumentNode } from 'graphql' const graffle = Graffle.create() .transport({ diff --git a/website/content/_snippets/examples/gql/gql-document-node-typed.md b/website/content/_snippets/examples/gql/gql-document-node-typed.md index ad28ef876..046680a5c 100644 --- a/website/content/_snippets/examples/gql/gql-document-node-typed.md +++ b/website/content/_snippets/examples/gql/gql-document-node-typed.md @@ -3,8 +3,14 @@ ```ts twoslash -import { parse, type TypedQueryDocumentNode } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' +import { parse, type TypedQueryDocumentNode } from 'graphql' const graffle = Graffle.create() .transport({ diff --git a/website/content/_snippets/examples/gql/gql-document-node.detail.md b/website/content/_snippets/examples/gql/gql-document-node.detail.md index e3857c5e4..87792e7d6 100644 --- a/website/content/_snippets/examples/gql/gql-document-node.detail.md +++ b/website/content/_snippets/examples/gql/gql-document-node.detail.md @@ -5,10 +5,16 @@ ```ts twoslash -import { parse } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + +import { Graffle } from 'graffle' import { Opentelemetry } from 'graffle/extensions/opentelemetry' import { Throws } from 'graffle/extensions/throws' -import { Graffle } from 'graffle' +import { parse } from 'graphql' const graffle = Graffle .create() diff --git a/website/content/_snippets/examples/gql/gql-document-node.md b/website/content/_snippets/examples/gql/gql-document-node.md index 85d9ac5c8..6d322b0ae 100644 --- a/website/content/_snippets/examples/gql/gql-document-node.md +++ b/website/content/_snippets/examples/gql/gql-document-node.md @@ -3,10 +3,16 @@ ```ts twoslash -import { parse } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + +import { Graffle } from 'graffle' import { Opentelemetry } from 'graffle/extensions/opentelemetry' import { Throws } from 'graffle/extensions/throws' -import { Graffle } from 'graffle' +import { parse } from 'graphql' const graffle = Graffle .create() diff --git a/website/content/_snippets/examples/gql/gql-string-typed.detail.md b/website/content/_snippets/examples/gql/gql-string-typed.detail.md index 1ebd5a701..07e24653c 100644 --- a/website/content/_snippets/examples/gql/gql-string-typed.detail.md +++ b/website/content/_snippets/examples/gql/gql-string-typed.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle, type TypedDocument } from 'graffle' const graffle = Graffle.create().transport({ url: `http://localhost:3000/graphql` }) diff --git a/website/content/_snippets/examples/gql/gql-string-typed.md b/website/content/_snippets/examples/gql/gql-string-typed.md index f0d82e900..7d643f750 100644 --- a/website/content/_snippets/examples/gql/gql-string-typed.md +++ b/website/content/_snippets/examples/gql/gql-string-typed.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle, type TypedDocument } from 'graffle' const graffle = Graffle.create().transport({ url: `http://localhost:3000/graphql` }) diff --git a/website/content/_snippets/examples/gql/gql-string.detail.md b/website/content/_snippets/examples/gql/gql-string.detail.md index 95ae86a50..d8640ac2b 100644 --- a/website/content/_snippets/examples/gql/gql-string.detail.md +++ b/website/content/_snippets/examples/gql/gql-string.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle.create().transport({ url: `http://localhost:3000/graphql` }) diff --git a/website/content/_snippets/examples/gql/gql-string.md b/website/content/_snippets/examples/gql/gql-string.md index 6b6ad4769..a126b6986 100644 --- a/website/content/_snippets/examples/gql/gql-string.md +++ b/website/content/_snippets/examples/gql/gql-string.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle.create().transport({ url: `http://localhost:3000/graphql` }) diff --git a/website/content/_snippets/examples/other/transport-memory.detail.md b/website/content/_snippets/examples/other/transport-memory.detail.md index 3d79b98f6..fabf00206 100644 --- a/website/content/_snippets/examples/other/transport-memory.detail.md +++ b/website/content/_snippets/examples/other/transport-memory.detail.md @@ -5,9 +5,15 @@ ```ts twoslash -import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' -import { TransportMemory } from '../../src/extensions/TransportMemory/TransportMemory.js' +import { TransportMemory } from 'graffle/extensions/transport-memory' +import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql' const schema = new GraphQLSchema({ query: new GraphQLObjectType({ diff --git a/website/content/_snippets/examples/other/transport-memory.md b/website/content/_snippets/examples/other/transport-memory.md index 269dbb547..fa620bbcc 100644 --- a/website/content/_snippets/examples/other/transport-memory.md +++ b/website/content/_snippets/examples/other/transport-memory.md @@ -3,9 +3,15 @@ ```ts twoslash -import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' -import { TransportMemory } from '../../src/extensions/TransportMemory/TransportMemory.js' +import { TransportMemory } from 'graffle/extensions/transport-memory' +import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql' const schema = new GraphQLSchema({ query: new GraphQLObjectType({ diff --git a/website/content/_snippets/examples/output/default.detail.md b/website/content/_snippets/examples/output/default.detail.md index 02ebfaf67..3bf0d8405 100644 --- a/website/content/_snippets/examples/output/default.detail.md +++ b/website/content/_snippets/examples/output/default.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/output/default.md b/website/content/_snippets/examples/output/default.md index 0b17f8e3f..8f3ede10f 100644 --- a/website/content/_snippets/examples/output/default.md +++ b/website/content/_snippets/examples/output/default.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/_snippets/examples/output/envelope-error-throw.detail.md b/website/content/_snippets/examples/output/envelope-error-throw.detail.md index 8e82c14ed..ddc8b1c53 100644 --- a/website/content/_snippets/examples/output/envelope-error-throw.detail.md +++ b/website/content/_snippets/examples/output/envelope-error-throw.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/envelope-error-throw.md b/website/content/_snippets/examples/output/envelope-error-throw.md index dcbda2182..d5b6b7c25 100644 --- a/website/content/_snippets/examples/output/envelope-error-throw.md +++ b/website/content/_snippets/examples/output/envelope-error-throw.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/envelope-error.detail.md b/website/content/_snippets/examples/output/envelope-error.detail.md index 3250ceebc..4b3459bc3 100644 --- a/website/content/_snippets/examples/output/envelope-error.detail.md +++ b/website/content/_snippets/examples/output/envelope-error.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/envelope-error.md b/website/content/_snippets/examples/output/envelope-error.md index b5032697b..9f6682aa3 100644 --- a/website/content/_snippets/examples/output/envelope-error.md +++ b/website/content/_snippets/examples/output/envelope-error.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/envelope.detail.md b/website/content/_snippets/examples/output/envelope.detail.md index 9b6b950c7..ad4d67f57 100644 --- a/website/content/_snippets/examples/output/envelope.detail.md +++ b/website/content/_snippets/examples/output/envelope.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create({ @@ -38,7 +44,7 @@ console.log(result) headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Sun, 15 Dec 2024 20:08:05 GMT', + date: 'Mon, 16 Dec 2024 01:48:03 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/_snippets/examples/output/envelope.md b/website/content/_snippets/examples/output/envelope.md index 96b635fd2..a9f31b0fe 100644 --- a/website/content/_snippets/examples/output/envelope.md +++ b/website/content/_snippets/examples/output/envelope.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create({ @@ -36,7 +42,7 @@ console.log(result) headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Sun, 15 Dec 2024 20:08:05 GMT', + date: 'Mon, 16 Dec 2024 01:48:03 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/_snippets/examples/output/return-error-execution.detail.md b/website/content/_snippets/examples/output/return-error-execution.detail.md index 22036b9e0..4a686092e 100644 --- a/website/content/_snippets/examples/output/return-error-execution.detail.md +++ b/website/content/_snippets/examples/output/return-error-execution.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/return-error-execution.md b/website/content/_snippets/examples/output/return-error-execution.md index 77c430484..685c60794 100644 --- a/website/content/_snippets/examples/output/return-error-execution.md +++ b/website/content/_snippets/examples/output/return-error-execution.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/return-error.detail.md b/website/content/_snippets/examples/output/return-error.detail.md index a18b65488..3437c1380 100644 --- a/website/content/_snippets/examples/output/return-error.detail.md +++ b/website/content/_snippets/examples/output/return-error.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/return-error.md b/website/content/_snippets/examples/output/return-error.md index 430af8d6a..f40e26220 100644 --- a/website/content/_snippets/examples/output/return-error.md +++ b/website/content/_snippets/examples/output/return-error.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/_snippets/examples/output/standard-graphql.detail.md b/website/content/_snippets/examples/output/standard-graphql.detail.md index b7f8e597f..c8d12640a 100644 --- a/website/content/_snippets/examples/output/standard-graphql.detail.md +++ b/website/content/_snippets/examples/output/standard-graphql.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle, Preset } from 'graffle' const graffle = Graffle @@ -31,8 +37,7 @@ ContextualError: There was an error in the core implementation of hook "exchange ... 2 lines matching cause stack trace ... at async Object.send (/some/path/to/gql.ts:XX:XX:26) at async (/some/path/to/output_preset__standard-graphql.ts:XX:XX:16) { - context: { hookName: 'exchange', source: 'implementation' }, - [cause]: TypeError: Failed to parse URL from ... + cause: TypeError: Failed to parse URL from ... at new Request (node:internal/deps/undici/undici:XX:XX) at Object.run (/some/path/to/TransportHttp.ts:XX:XX:31) ... 6 lines matching cause stack trace ... @@ -52,7 +57,8 @@ ContextualError: There was an error in the core implementation of hook "exchange code: 'ERR_INVALID_URL', input: '...' } - } + }, + context: { hookName: 'exchange', source: 'implementation' } } Node.js vXX.XX.XX diff --git a/website/content/_snippets/examples/output/standard-graphql.md b/website/content/_snippets/examples/output/standard-graphql.md index d603583e4..e83541201 100644 --- a/website/content/_snippets/examples/output/standard-graphql.md +++ b/website/content/_snippets/examples/output/standard-graphql.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle, Preset } from 'graffle' const graffle = Graffle @@ -29,8 +35,7 @@ ContextualError: There was an error in the core implementation of hook "exchange ... 2 lines matching cause stack trace ... at async Object.send (/some/path/to/gql.ts:XX:XX:26) at async (/some/path/to/output_preset__standard-graphql.ts:XX:XX:16) { - context: { hookName: 'exchange', source: 'implementation' }, - [cause]: TypeError: Failed to parse URL from ... + cause: TypeError: Failed to parse URL from ... at new Request (node:internal/deps/undici/undici:XX:XX) at Object.run (/some/path/to/TransportHttp.ts:XX:XX:31) ... 6 lines matching cause stack trace ... @@ -50,7 +55,8 @@ ContextualError: There was an error in the core implementation of hook "exchange code: 'ERR_INVALID_URL', input: '...' } - } + }, + context: { hookName: 'exchange', source: 'implementation' } } Node.js vXX.XX.XX diff --git a/website/content/_snippets/examples/preset/none.detail.md b/website/content/_snippets/examples/preset/bare.detail.md similarity index 64% rename from website/content/_snippets/examples/preset/none.detail.md rename to website/content/_snippets/examples/preset/bare.detail.md index f1f6b0ab6..6fbee444a 100644 --- a/website/content/_snippets/examples/preset/none.detail.md +++ b/website/content/_snippets/examples/preset/bare.detail.md @@ -1,14 +1,20 @@ ::: details Example
-None +Bare ```ts twoslash -import { create } from 'graffle/presets/bare' -import { Introspection } from '../../src/extensions/Introspection/Introspection.js' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- -const graffle = create() +import { Introspection } from 'graffle/extensions/introspection' +import { GraffleBare } from 'graffle/presets/bare' + +const graffle = GraffleBare.create() /** * Because we have no transports registered, the `transport` method @@ -21,9 +27,9 @@ const _t: never = graffle.transport const _e1: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.gql const _e2: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.document const _e3: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.$batch -const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.id +const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.pokemons const _e5: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.$batch -const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.id +const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.addPokemon const _e7: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.use(Introspection()).introspect ``` diff --git a/website/content/_snippets/examples/preset/none.md b/website/content/_snippets/examples/preset/bare.md similarity index 64% rename from website/content/_snippets/examples/preset/none.md rename to website/content/_snippets/examples/preset/bare.md index 0fd8d2132..21c033c08 100644 --- a/website/content/_snippets/examples/preset/none.md +++ b/website/content/_snippets/examples/preset/bare.md @@ -1,12 +1,18 @@
-None +Bare ```ts twoslash -import { create } from 'graffle/presets/bare' -import { Introspection } from '../../src/extensions/Introspection/Introspection.js' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- -const graffle = create() +import { Introspection } from 'graffle/extensions/introspection' +import { GraffleBare } from 'graffle/presets/bare' + +const graffle = GraffleBare.create() /** * Because we have no transports registered, the `transport` method @@ -19,9 +25,9 @@ const _t: never = graffle.transport const _e1: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.gql const _e2: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.document const _e3: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.$batch -const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.id +const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.pokemons const _e5: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.$batch -const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.id +const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.addPokemon const _e7: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.use(Introspection()).introspect ``` diff --git a/website/content/_snippets/examples/preset/minimal.detail.md b/website/content/_snippets/examples/preset/minimal.detail.md index be117030d..6fe3ac6ba 100644 --- a/website/content/_snippets/examples/preset/minimal.detail.md +++ b/website/content/_snippets/examples/preset/minimal.detail.md @@ -5,12 +5,18 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' -import { create } from 'graffle/presets/minimal' +import { GraffleMinimal } from 'graffle/presets/minimal' -console.log(`Is the default preset`, Graffle.create === create) +console.log(`Is the default preset`, Graffle.create === GraffleMinimal.create) -const graffle = create() +const graffle = GraffleMinimal.create() console.log(`The current transport is`, graffle._.transports.current) ``` diff --git a/website/content/_snippets/examples/preset/minimal.md b/website/content/_snippets/examples/preset/minimal.md index 966f8c503..d044b8093 100644 --- a/website/content/_snippets/examples/preset/minimal.md +++ b/website/content/_snippets/examples/preset/minimal.md @@ -3,12 +3,18 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' -import { create } from 'graffle/presets/minimal' +import { GraffleMinimal } from 'graffle/presets/minimal' -console.log(`Is the default preset`, Graffle.create === create) +console.log(`Is the default preset`, Graffle.create === GraffleMinimal.create) -const graffle = create() +const graffle = GraffleMinimal.create() console.log(`The current transport is`, graffle._.transports.current) ``` diff --git a/website/content/_snippets/examples/transport-http/abort.detail.md b/website/content/_snippets/examples/transport-http/abort.detail.md index 1a91b7280..bb1f3de38 100644 --- a/website/content/_snippets/examples/transport-http/abort.detail.md +++ b/website/content/_snippets/examples/transport-http/abort.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const abortController = new AbortController() diff --git a/website/content/_snippets/examples/transport-http/abort.md b/website/content/_snippets/examples/transport-http/abort.md index e07cd8b17..8e3ae95f6 100644 --- a/website/content/_snippets/examples/transport-http/abort.md +++ b/website/content/_snippets/examples/transport-http/abort.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const abortController = new AbortController() diff --git a/website/content/_snippets/examples/transport-http/custom-fetch.detail.md b/website/content/_snippets/examples/transport-http/custom-fetch.detail.md index f93a97f9b..99a742820 100644 --- a/website/content/_snippets/examples/transport-http/custom-fetch.detail.md +++ b/website/content/_snippets/examples/transport-http/custom-fetch.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/transport-http/custom-fetch.md b/website/content/_snippets/examples/transport-http/custom-fetch.md index 4aa04c5f0..63c08bef9 100644 --- a/website/content/_snippets/examples/transport-http/custom-fetch.md +++ b/website/content/_snippets/examples/transport-http/custom-fetch.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md b/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md index baf28e6b3..2323955b6 100644 --- a/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md +++ b/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle @@ -40,7 +46,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1734293284713' + 'x-sent-at-time': '1734313683348' }, method: 'post', url: 'http://localhost:3000/graphql', diff --git a/website/content/_snippets/examples/transport-http/dynamic-headers.md b/website/content/_snippets/examples/transport-http/dynamic-headers.md index bb1c904d5..000a51adf 100644 --- a/website/content/_snippets/examples/transport-http/dynamic-headers.md +++ b/website/content/_snippets/examples/transport-http/dynamic-headers.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle @@ -38,7 +44,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1734293284713' + 'x-sent-at-time': '1734313683348' }, method: 'post', url: 'http://localhost:3000/graphql', diff --git a/website/content/_snippets/examples/transport-http/headers.detail.md b/website/content/_snippets/examples/transport-http/headers.detail.md index f3c0cb6a1..2c2e54923 100644 --- a/website/content/_snippets/examples/transport-http/headers.detail.md +++ b/website/content/_snippets/examples/transport-http/headers.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/transport-http/headers.md b/website/content/_snippets/examples/transport-http/headers.md index a8ea9a598..f23ea4673 100644 --- a/website/content/_snippets/examples/transport-http/headers.md +++ b/website/content/_snippets/examples/transport-http/headers.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/transport-http/method-get.detail.md b/website/content/_snippets/examples/transport-http/method-get.detail.md index a7fb003b5..d4fc45a49 100644 --- a/website/content/_snippets/examples/transport-http/method-get.detail.md +++ b/website/content/_snippets/examples/transport-http/method-get.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const graffle = Graffle diff --git a/website/content/_snippets/examples/transport-http/method-get.md b/website/content/_snippets/examples/transport-http/method-get.md index 9fc544b54..848ba4eb8 100644 --- a/website/content/_snippets/examples/transport-http/method-get.md +++ b/website/content/_snippets/examples/transport-http/method-get.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const graffle = Graffle diff --git a/website/content/_snippets/examples/transport-http/raw.detail.md b/website/content/_snippets/examples/transport-http/raw.detail.md index 8e9906baa..e56940b06 100644 --- a/website/content/_snippets/examples/transport-http/raw.detail.md +++ b/website/content/_snippets/examples/transport-http/raw.detail.md @@ -5,6 +5,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/_snippets/examples/transport-http/raw.md b/website/content/_snippets/examples/transport-http/raw.md index 669c7477e..46f3b3834 100644 --- a/website/content/_snippets/examples/transport-http/raw.md +++ b/website/content/_snippets/examples/transport-http/raw.md @@ -3,6 +3,12 @@ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/examples/10_transport-http/abort.md b/website/content/examples/10_transport-http/abort.md index 09553968e..2606ac428 100644 --- a/website/content/examples/10_transport-http/abort.md +++ b/website/content/examples/10_transport-http/abort.md @@ -8,6 +8,12 @@ This example shows how to cancel requests using an `AbortController` signal. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const abortController = new AbortController() diff --git a/website/content/examples/10_transport-http/custom-fetch.md b/website/content/examples/10_transport-http/custom-fetch.md index 51bf3d040..4ed95c6a2 100644 --- a/website/content/examples/10_transport-http/custom-fetch.md +++ b/website/content/examples/10_transport-http/custom-fetch.md @@ -8,6 +8,12 @@ This examples shows how to leverage the extension system to override the "exchan ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/examples/10_transport-http/dynamic-headers.md b/website/content/examples/10_transport-http/dynamic-headers.md index 9cc176bf3..d354283a5 100644 --- a/website/content/examples/10_transport-http/dynamic-headers.md +++ b/website/content/examples/10_transport-http/dynamic-headers.md @@ -8,6 +8,12 @@ This example shows how to leverage the extension system to dynamically manipulat ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle @@ -45,7 +51,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1734293284713' + 'x-sent-at-time': '1734313683348' }, method: 'post', url: 'http://localhost:3000/graphql', diff --git a/website/content/examples/10_transport-http/headers.md b/website/content/examples/10_transport-http/headers.md index 62c058f15..cbfe36267 100644 --- a/website/content/examples/10_transport-http/headers.md +++ b/website/content/examples/10_transport-http/headers.md @@ -8,6 +8,12 @@ This example shows how to use the `transport` configuration to control request h ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/examples/10_transport-http/method-get.md b/website/content/examples/10_transport-http/method-get.md index 194468a95..ba0bc112e 100644 --- a/website/content/examples/10_transport-http/method-get.md +++ b/website/content/examples/10_transport-http/method-get.md @@ -9,6 +9,12 @@ to be sent over HTTP GET method. Note write-kind operations (mutation) are still ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const graffle = Graffle diff --git a/website/content/examples/10_transport-http/raw.md b/website/content/examples/10_transport-http/raw.md index 84ed396c9..9c4542962 100644 --- a/website/content/examples/10_transport-http/raw.md +++ b/website/content/examples/10_transport-http/raw.md @@ -8,6 +8,12 @@ This example shows how to use the `raw` configuration of transport configuration ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/examples/20_output/default.md b/website/content/examples/20_output/default.md index 8e9ec741f..d0e9e56af 100644 --- a/website/content/examples/20_output/default.md +++ b/website/content/examples/20_output/default.md @@ -8,6 +8,12 @@ This example shows the default output behavior. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/20_output/envelope-error-throw.md b/website/content/examples/20_output/envelope-error-throw.md index d26be5513..90fe27c2b 100644 --- a/website/content/examples/20_output/envelope-error-throw.md +++ b/website/content/examples/20_output/envelope-error-throw.md @@ -8,6 +8,12 @@ This example shows how to configure output to throw errors even when using the e ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/examples/20_output/envelope-error.md b/website/content/examples/20_output/envelope-error.md index b8aca1741..432d369ed 100644 --- a/website/content/examples/20_output/envelope-error.md +++ b/website/content/examples/20_output/envelope-error.md @@ -8,6 +8,12 @@ This example shows how to configure output to embed errors into the envelope. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/examples/20_output/envelope.md b/website/content/examples/20_output/envelope.md index 53a8fdddb..ff4849ac0 100644 --- a/website/content/examples/20_output/envelope.md +++ b/website/content/examples/20_output/envelope.md @@ -8,6 +8,12 @@ This example shows how to configure output to use the envelope. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create({ @@ -43,7 +49,7 @@ console.log(result) headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Sun, 15 Dec 2024 20:08:05 GMT', + date: 'Mon, 16 Dec 2024 01:48:03 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/examples/20_output/return-error-execution.md b/website/content/examples/20_output/return-error-execution.md index 4b435efeb..4745761fd 100644 --- a/website/content/examples/20_output/return-error-execution.md +++ b/website/content/examples/20_output/return-error-execution.md @@ -8,6 +8,12 @@ This example shows how to configure output to have only certain kinds of errors ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/examples/20_output/return-error.md b/website/content/examples/20_output/return-error.md index b70a5487b..9486f144a 100644 --- a/website/content/examples/20_output/return-error.md +++ b/website/content/examples/20_output/return-error.md @@ -8,6 +8,12 @@ This example shows how to configure output to have errors returned instead of e. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle diff --git a/website/content/examples/20_output/standard-graphql.md b/website/content/examples/20_output/standard-graphql.md index d79714254..cbdc510b3 100644 --- a/website/content/examples/20_output/standard-graphql.md +++ b/website/content/examples/20_output/standard-graphql.md @@ -8,6 +8,12 @@ This example shows how to configure output to approximate the traditional GraphQ ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle, Preset } from 'graffle' const graffle = Graffle @@ -36,8 +42,7 @@ ContextualError: There was an error in the core implementation of hook "exchange ... 2 lines matching cause stack trace ... at async Object.send (/some/path/to/gql.ts:XX:XX:26) at async (/some/path/to/output_preset__standard-graphql.ts:XX:XX:16) { - context: { hookName: 'exchange', source: 'implementation' }, - [cause]: TypeError: Failed to parse URL from ... + cause: TypeError: Failed to parse URL from ... at new Request (node:internal/deps/undici/undici:XX:XX) at Object.run (/some/path/to/TransportHttp.ts:XX:XX:31) ... 6 lines matching cause stack trace ... @@ -57,7 +62,8 @@ ContextualError: There was an error in the core implementation of hook "exchange code: 'ERR_INVALID_URL', input: '...' } - } + }, + context: { hookName: 'exchange', source: 'implementation' } } Node.js vXX.XX.XX diff --git a/website/content/examples/30_gql/gql-document-node-typed.md b/website/content/examples/30_gql/gql-document-node-typed.md index 93294e484..84f5ac041 100644 --- a/website/content/examples/30_gql/gql-document-node-typed.md +++ b/website/content/examples/30_gql/gql-document-node-typed.md @@ -9,8 +9,14 @@ package `graphql` to make a type safe request with gql method. ```ts twoslash -import { parse, type TypedQueryDocumentNode } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' +import { parse, type TypedQueryDocumentNode } from 'graphql' const graffle = Graffle.create() .transport({ diff --git a/website/content/examples/30_gql/gql-document-node.md b/website/content/examples/30_gql/gql-document-node.md index 972b3ea70..206dd5108 100644 --- a/website/content/examples/30_gql/gql-document-node.md +++ b/website/content/examples/30_gql/gql-document-node.md @@ -8,10 +8,16 @@ This example shows how to send a request using a Document instance for the Graph ```ts twoslash -import { parse } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + +import { Graffle } from 'graffle' import { Opentelemetry } from 'graffle/extensions/opentelemetry' import { Throws } from 'graffle/extensions/throws' -import { Graffle } from 'graffle' +import { parse } from 'graphql' const graffle = Graffle .create() diff --git a/website/content/examples/30_gql/gql-string-typed.md b/website/content/examples/30_gql/gql-string-typed.md index 65f461e3a..7c8dcf04e 100644 --- a/website/content/examples/30_gql/gql-string-typed.md +++ b/website/content/examples/30_gql/gql-string-typed.md @@ -10,6 +10,12 @@ suggests below, ideally some sort of automation would generate the types for you ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle, type TypedDocument } from 'graffle' const graffle = Graffle.create().transport({ url: `http://localhost:3000/graphql` }) diff --git a/website/content/examples/30_gql/gql-string.md b/website/content/examples/30_gql/gql-string.md index 25c6fe463..07b77b0fa 100644 --- a/website/content/examples/30_gql/gql-string.md +++ b/website/content/examples/30_gql/gql-string.md @@ -8,6 +8,12 @@ This example shows how to send a request using a string for the GraphQL document ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle.create().transport({ url: `http://localhost:3000/graphql` }) diff --git a/website/content/examples/35_custom-scalar/custom-scalar.md b/website/content/examples/35_custom-scalar/custom-scalar.md index 43499a00a..80e4664db 100644 --- a/website/content/examples/35_custom-scalar/custom-scalar.md +++ b/website/content/examples/35_custom-scalar/custom-scalar.md @@ -9,6 +9,12 @@ have arguments and data automatically encoded and decoded respectively. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const graffle = Graffle diff --git a/website/content/examples/40_other/transport-memory.md b/website/content/examples/40_other/transport-memory.md index 86b7c70ba..ccd7e4377 100644 --- a/website/content/examples/40_other/transport-memory.md +++ b/website/content/examples/40_other/transport-memory.md @@ -8,9 +8,15 @@ This example shows how you can send requests against an in-memory GraphQL schema ```ts twoslash -import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' -import { TransportMemory } from '../../src/extensions/TransportMemory/TransportMemory.js' +import { TransportMemory } from 'graffle/extensions/transport-memory' +import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql' const schema = new GraphQLSchema({ query: new GraphQLObjectType({ diff --git a/website/content/examples/50_anyware/jump-start.md b/website/content/examples/50_anyware/jump-start.md index b75d7c329..05fd237e1 100644 --- a/website/content/examples/50_anyware/jump-start.md +++ b/website/content/examples/50_anyware/jump-start.md @@ -10,6 +10,12 @@ until your reach your desired one. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' Graffle diff --git a/website/content/examples/50_anyware/short-circuit.md b/website/content/examples/50_anyware/short-circuit.md index 425953c58..a76c7feb4 100644 --- a/website/content/examples/50_anyware/short-circuit.md +++ b/website/content/examples/50_anyware/short-circuit.md @@ -10,6 +10,12 @@ even past your desired one until the final result. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' Graffle diff --git a/website/content/examples/50_anyware/slot-body.md b/website/content/examples/50_anyware/slot-body.md index 0e75741ee..5cb35730c 100644 --- a/website/content/examples/50_anyware/slot-body.md +++ b/website/content/examples/50_anyware/slot-body.md @@ -8,6 +8,12 @@ This example shows how to use the `body` slot on the `pack` hook. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/examples/50_anyware/slot-fetch.md b/website/content/examples/50_anyware/slot-fetch.md index e1cabf264..3dab718dc 100644 --- a/website/content/examples/50_anyware/slot-fetch.md +++ b/website/content/examples/50_anyware/slot-fetch.md @@ -8,6 +8,12 @@ This example shows how to use the `fetch` slot on `exchange` hook. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/examples/50_anyware/slot-search-params.md b/website/content/examples/50_anyware/slot-search-params.md index c0c378e6a..0c98938c6 100644 --- a/website/content/examples/50_anyware/slot-search-params.md +++ b/website/content/examples/50_anyware/slot-search-params.md @@ -8,6 +8,12 @@ This example shows how to use the `searchParams` slot on the `pack` hook. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' const graffle = Graffle diff --git a/website/content/examples/55_document-builder/alias.md b/website/content/examples/55_document-builder/alias.md index bc45c8367..6e141a9e9 100644 --- a/website/content/examples/55_document-builder/alias.md +++ b/website/content/examples/55_document-builder/alias.md @@ -8,6 +8,12 @@ This example shows how to write GraphQL aliases in the TypeScript interface. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/55_document-builder/arguments.md b/website/content/examples/55_document-builder/arguments.md index bb8a46602..8b52e6710 100644 --- a/website/content/examples/55_document-builder/arguments.md +++ b/website/content/examples/55_document-builder/arguments.md @@ -8,11 +8,17 @@ This example shows how to write field arguments in TypeScript interface. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' -const atlas = Graffle.create() +const graffle = Graffle.create() -const pokemons = await atlas.query.pokemons({ +const pokemons = await graffle.query.pokemons({ $: { filter: { name: { in: [`Pikachu`, `Charizard`] } } }, // [!code highlight] name: true, trainer: { name: true }, diff --git a/website/content/examples/55_document-builder/batch.md b/website/content/examples/55_document-builder/batch.md index c358b0c5e..2a1d109f5 100644 --- a/website/content/examples/55_document-builder/batch.md +++ b/website/content/examples/55_document-builder/batch.md @@ -8,6 +8,12 @@ This example shows how to write batches of GraphQL root fields (aka. entrypoints ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/55_document-builder/directive.md b/website/content/examples/55_document-builder/directive.md index d352b7e29..403e239fb 100644 --- a/website/content/examples/55_document-builder/directive.md +++ b/website/content/examples/55_document-builder/directive.md @@ -8,6 +8,12 @@ This example shows how to use special fields to write GraphQL document directive ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/55_document-builder/document.md b/website/content/examples/55_document-builder/document.md index f11d4edec..ed45246b1 100644 --- a/website/content/examples/55_document-builder/document.md +++ b/website/content/examples/55_document-builder/document.md @@ -8,6 +8,12 @@ This example shows how to write whole GraphQL documents in the TypeScript interf ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/55_document-builder/interface.md b/website/content/examples/55_document-builder/interface.md index bec03c734..15e1eb91e 100644 --- a/website/content/examples/55_document-builder/interface.md +++ b/website/content/examples/55_document-builder/interface.md @@ -8,6 +8,12 @@ This example shows how to work with interface types. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/55_document-builder/root-field.md b/website/content/examples/55_document-builder/root-field.md index a5056549a..385a89356 100644 --- a/website/content/examples/55_document-builder/root-field.md +++ b/website/content/examples/55_document-builder/root-field.md @@ -8,6 +8,12 @@ This example shows how to use dedicated root field methods to easily operate on ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/55_document-builder/union.md b/website/content/examples/55_document-builder/union.md index 07cd92ea7..d78113feb 100644 --- a/website/content/examples/55_document-builder/union.md +++ b/website/content/examples/55_document-builder/union.md @@ -8,6 +8,12 @@ This example shows how to work with GraphQL union types in the TypeScript interf ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from './graffle/__.js' const pokemon = Graffle.create() diff --git a/website/content/examples/60_extension/introspection.md b/website/content/examples/60_extension/introspection.md index 2525c65fe..2001605d1 100644 --- a/website/content/examples/60_extension/introspection.md +++ b/website/content/examples/60_extension/introspection.md @@ -8,6 +8,12 @@ This example shows how to use the Introspection extension to easily introspect y ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Introspection } from 'graffle/extensions/introspection' import { Graffle } from './graffle/__.js' @@ -25,8 +31,8 @@ console.log(data) { __schema: { description: null, - queryType: { name: 'Query' }, - mutationType: { name: 'Mutation' }, + queryType: { name: 'Query', kind: 'OBJECT' }, + mutationType: { name: 'Mutation', kind: 'OBJECT' }, subscriptionType: null, types: [ { diff --git a/website/content/examples/60_extension/opentelemetry.md b/website/content/examples/60_extension/opentelemetry.md index 63029f999..dd3dd9805 100644 --- a/website/content/examples/60_extension/opentelemetry.md +++ b/website/content/examples/60_extension/opentelemetry.md @@ -6,6 +6,12 @@ aside: false ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { ConsoleSpanExporter, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base' import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node' import { Opentelemetry } from 'graffle/extensions/opentelemetry' @@ -36,18 +42,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'encode', - id: 'b4f6b90f9d4cb7f9', + id: '0932a4af7db7f676', kind: 0, - timestamp: 1734293285758000, - duration: 1165.458, + timestamp: 1734313684255000, + duration: 886.584, attributes: {}, status: { code: 0 }, events: [], @@ -63,18 +69,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'pack', - id: '28d86e022df6a130', + id: '2dac90b2b7dae9cf', kind: 0, - timestamp: 1734293285761000, - duration: 123866.625, + timestamp: 1734313684257000, + duration: 9667.791, attributes: {}, status: { code: 0 }, events: [], @@ -90,18 +96,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'exchange', - id: '009c240ba45bff12', + id: 'c9162ca6e544cf37', kind: 0, - timestamp: 1734293285888000, - duration: 60630.292, + timestamp: 1734313684267000, + duration: 15232.833, attributes: {}, status: { code: 0 }, events: [], @@ -117,18 +123,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'unpack', - id: '1a49677d316b711e', + id: 'c360e1de02b2f249', kind: 0, - timestamp: 1734293285949000, - duration: 1003.209, + timestamp: 1734313684283000, + duration: 773.625, attributes: {}, status: { code: 0 }, events: [], @@ -144,18 +150,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', - parentId: '65825892207135a8', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', + parentId: 'fff65363c3906c5f', traceState: undefined, name: 'decode', - id: '3b7f0a2030462e74', + id: '6f38295d85844fd0', kind: 0, - timestamp: 1734293285950000, - duration: 444.291, + timestamp: 1734313684283000, + duration: 400.083, attributes: {}, status: { code: 0 }, events: [], @@ -171,18 +177,18 @@ console.log(data) 'service.name': 'unknown_service:/Users/jasonkuhrt/Library/pnpm/nodejs/22.11.0/bin/node', 'telemetry.sdk.language': 'nodejs', 'telemetry.sdk.name': 'opentelemetry', - 'telemetry.sdk.version': '1.28.0' + 'telemetry.sdk.version': '1.29.0' } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: 'f223876fb94238d6e67c7f5ad5352b14', + traceId: '9f1dd3465bee320e11285dab4fd18c0a', parentId: undefined, traceState: undefined, name: 'request', - id: '65825892207135a8', + id: 'fff65363c3906c5f', kind: 0, - timestamp: 1734293285757000, - duration: 193579.292, + timestamp: 1734313684255000, + duration: 29236.834, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/examples/60_extension/throws.md b/website/content/examples/60_extension/throws.md index 204182618..f667bc747 100644 --- a/website/content/examples/60_extension/throws.md +++ b/website/content/examples/60_extension/throws.md @@ -8,6 +8,12 @@ This example shows how to use the Throws extension to throw errors for one-off c ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Throws } from 'graffle/extensions/throws' import { Graffle } from './graffle/__.js' diff --git a/website/content/examples/65_preset/none.md b/website/content/examples/65_preset/bare.md similarity index 68% rename from website/content/examples/65_preset/none.md rename to website/content/examples/65_preset/bare.md index 3c0985c2e..ac8fbe9fe 100644 --- a/website/content/examples/65_preset/none.md +++ b/website/content/examples/65_preset/bare.md @@ -2,17 +2,23 @@ aside: false --- -# None +# Bare This example shows use of the `bare` preset which is Graffle at its most minimal. It uses no extensions, not even a transport. ```ts twoslash -import { create } from 'graffle/presets/bare' -import { Introspection } from '../../src/extensions/Introspection/Introspection.js' +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- -const graffle = create() +import { Introspection } from 'graffle/extensions/introspection' +import { GraffleBare } from 'graffle/presets/bare' + +const graffle = GraffleBare.create() /** * Because we have no transports registered, the `transport` method @@ -25,9 +31,9 @@ const _t: never = graffle.transport const _e1: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.gql const _e2: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.document const _e3: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.$batch -const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.id +const _e4: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.query.pokemons const _e5: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.$batch -const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.id +const _e6: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.mutation.addPokemon const _e7: 'Error: You cannot send requests yet. You must setup a transport.' = graffle.use(Introspection()).introspect ``` diff --git a/website/content/examples/65_preset/minimal.md b/website/content/examples/65_preset/minimal.md index b81f273a9..8d47aea5c 100644 --- a/website/content/examples/65_preset/minimal.md +++ b/website/content/examples/65_preset/minimal.md @@ -10,12 +10,18 @@ Transport HTTP extension. ```ts twoslash +// Our website uses Vitepress+Twoslash. Twoslash does not discover the generated Graffle modules. +// Perhaps we can configure Twoslash to include them. Until we figure that out, we have to +// explicitly import them like this. +import './graffle/modules/global.js' +// ---cut--- + import { Graffle } from 'graffle' -import { create } from 'graffle/presets/minimal' +import { GraffleMinimal } from 'graffle/presets/minimal' -console.log(`Is the default preset`, Graffle.create === create) +console.log(`Is the default preset`, Graffle.create === GraffleMinimal.create) -const graffle = create() +const graffle = GraffleMinimal.create() console.log(`The current transport is`, graffle._.transports.current) ``` diff --git a/website/graffle/modules/Client.ts b/website/graffle/modules/client.ts similarity index 100% rename from website/graffle/modules/Client.ts rename to website/graffle/modules/client.ts diff --git a/website/graffle/modules/Data.ts b/website/graffle/modules/data.ts similarity index 100% rename from website/graffle/modules/Data.ts rename to website/graffle/modules/data.ts diff --git a/website/graffle/modules/Global.ts b/website/graffle/modules/global.ts similarity index 100% rename from website/graffle/modules/Global.ts rename to website/graffle/modules/global.ts diff --git a/website/graffle/modules/Scalar.ts b/website/graffle/modules/scalar.ts similarity index 100% rename from website/graffle/modules/Scalar.ts rename to website/graffle/modules/scalar.ts diff --git a/website/graffle/modules/Schema.ts b/website/graffle/modules/schema.ts similarity index 100% rename from website/graffle/modules/Schema.ts rename to website/graffle/modules/schema.ts diff --git a/website/graffle/modules/Select.ts b/website/graffle/modules/select.ts similarity index 100% rename from website/graffle/modules/Select.ts rename to website/graffle/modules/select.ts diff --git a/website/package.json b/website/package.json index 7b2c1732e..87ce0570a 100644 --- a/website/package.json +++ b/website/package.json @@ -2,11 +2,11 @@ "type": "module", "packageManager": "pnpm@9.12.2", "scripts": { - "dev": "NODE_ENV=development vitepress dev", + "dev": "disable_twoslash=true NODE_ENV=development vitepress dev", "dev:twoslash": "NODE_ENV=development vitepress dev", "build": "vitepress build", "preview": "vitepress preview", - "gen:graffle": "graffle --defaultSchemaUrl http://localhost:3000/graphql --schema ../tests/_/schemas/pokemon/graffle/schema.graphql" + "gen:graffle": "graffle --defaultSchemaUrl http://localhost:3000/graphql --schema ../tests/_/schemas/pokemon/schema.graphql" }, "devDependencies": { "vitepress": "^1.5.0" @@ -20,7 +20,7 @@ "es-toolkit": "^1.30.1", "floating-vue": "^5.2.2", "globby": "^14.0.2", - "graffle": "link:..", + "graffle": "file:..", "graphql": "^16.10.0", "tsx": "^4.19.2", "typescript": "^5.7.2", diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index 465823078..710c6417d 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: ^14.0.2 version: 14.0.2 graffle: - specifier: link:.. - version: link:.. + specifier: file:.. + version: file:..(graphql@16.10.0) graphql: specifier: ^16.10.0 version: 16.10.0 @@ -57,6 +57,14 @@ importers: packages: + '@0no-co/graphql.web@1.0.12': + resolution: {integrity: sha512-BTDjjsV/zSPy5fqItwm+KWUfh9CSe9tTtR6rCB72ddtkAxdcHbi4Ir4r/L1Et4lyxmL+i7Rb3m9sjLLi9tYrzA==} + peerDependencies: + graphql: ^14.0.0 || ^15.0.0 || ^16.0.0 + peerDependenciesMeta: + graphql: + optional: true + '@algolia/autocomplete-core@1.17.7': resolution: {integrity: sha512-BjiPOW6ks90UKl7TwMv7oNQMnzU+t/wk9mgIDi6b1tXpUek7MW0lbNOUHpvam9pe3lVCf4xPFT+lK7s+e+fs7Q==} @@ -460,6 +468,11 @@ packages: '@floating-ui/utils@0.2.8': resolution: {integrity: sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==} + '@graphql-typed-document-node/core@3.2.0': + resolution: {integrity: sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==} + peerDependencies: + graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0 + '@iconify-json/simple-icons@1.2.15': resolution: {integrity: sha512-4vxMQwkjsbjVIVGsPjKBnLMqAXu4wSlHmeN35KaJLK0UJNUj/ef6ES5c4bT/U4bSZjD2oZqOjOWTPD+HCrSUkg==} @@ -473,6 +486,12 @@ packages: '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@molt/command@0.9.0': + resolution: {integrity: sha512-1JI8dAlpqlZoXyKWVQggX7geFNPxBpocHIXQCsnxDjKy+3WX4SGyZVJXuLlqRRrX7FmQCuuMAfx642ovXmPA9g==} + + '@molt/types@0.2.0': + resolution: {integrity: sha512-p6ChnEZDGjg9PYPec9BK6Yp5/DdSrYQvXTBAtgrnqX6N36cZy37ql1c8Tc5LclfIYBNG7EZp8NBcRTYJwyi84g==} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -771,6 +790,9 @@ packages: '@vueuse/shared@11.3.0': resolution: {integrity: sha512-P8gSSWQeucH5821ek2mn/ciCk+MS/zoRKqdQIM3bHq6p7GXDAJLmnRRKmF5F65sAVJIfzQlwR3aDzwCn10s8hA==} + alge@0.8.1: + resolution: {integrity: sha512-kiV9nTt+XIauAXsowVygDxMZLplZxDWt0W8plE/nB32/V2ziM/P/TxDbSVK7FYIUt2Xo16h3/htDh199LNPCKQ==} + algoliasearch@5.17.1: resolution: {integrity: sha512-3CcbT5yTWJDIcBe9ZHgsPi184SkT1kyZi3GWlQU5EFgvq1V73X2sqHRkPCQMe0RA/uvZbB+1sFeAk73eWygeLg==} engines: {node: '>= 14.0.0'} @@ -813,6 +835,10 @@ packages: ccount@2.0.1: resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==} + chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + character-entities-html4@2.1.0: resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} @@ -957,6 +983,25 @@ packages: resolution: {integrity: sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==} engines: {node: '>=18'} + graffle@file:..: + resolution: {directory: .., type: directory} + hasBin: true + peerDependencies: + '@dprint/formatter': ^0.4.0 + '@dprint/typescript': ^0.93.0 + '@opentelemetry/api': ^1.9.0 + graphql: 14 - 16 + prettier: ^3.3.3 + peerDependenciesMeta: + '@dprint/formatter': + optional: true + '@dprint/typescript': + optional: true + '@opentelemetry/api': + optional: true + prettier: + optional: true + graphql@16.10.0: resolution: {integrity: sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==} engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0} @@ -1005,6 +1050,10 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + is-what@4.1.16: resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} engines: {node: '>=12.13'} @@ -1023,6 +1072,15 @@ packages: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} + lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + + lodash.ismatch@4.4.0: + resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} + + lodash.snakecase@4.1.1: + resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} + longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} @@ -1214,6 +1272,10 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + readline-sync@1.4.10: + resolution: {integrity: sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw==} + engines: {node: '>= 0.8.0'} + regex-recursion@4.3.0: resolution: {integrity: sha512-5LcLnizwjcQ2ALfOj95MjcatxyqF5RPySx9yT+PaXu3Gox2vyAtLDjHB8NTJLtMGkvyau6nI3CfpwFCjPUIs/A==} @@ -1223,6 +1285,9 @@ packages: regex@5.0.2: resolution: {integrity: sha512-/pczGbKIQgfTMRV0XjABvc5RzLqQmwqxLHdQao2RTXPk+pmTXB2P0IaUHYdYyk412YLwUIkaeMd5T+RzVgTqnQ==} + remeda@1.61.0: + resolution: {integrity: sha512-caKfSz9rDeSKBQQnlJnVW3mbVdFgxgGWQKq1XlFokqjf+hQD5gxutLGTTY2A/x24UxVyJe9gH5fAkFI63ULw4A==} + resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} @@ -1281,6 +1346,10 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + string-length@6.0.0: + resolution: {integrity: sha512-1U361pxZHEQ+FeSjzqRpV+cu2vTzYeWeafXFLykiFlv4Vc0n3njgU8HrMbyik5uwm77naWMuVG8fhEF+Ovb1Kg==} + engines: {node: '>=16'} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -1318,6 +1387,9 @@ packages: trim-lines@3.0.1: resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==} + ts-toolbelt@9.6.0: + resolution: {integrity: sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w==} + tsx@4.19.2: resolution: {integrity: sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==} engines: {node: '>=18.0.0'} @@ -1336,6 +1408,10 @@ packages: peerDependencies: typescript: '*' + type-fest@4.30.1: + resolution: {integrity: sha512-ojFL7eDMX2NF0xMbDwPZJ8sb7ckqtlAi1GsmgsFXvErT9kFTk1r0DuQKvrCh73M6D4nngeHJmvogF9OluXs7Hw==} + engines: {node: '>=16'} + typescript@5.7.2: resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==} engines: {node: '>=14.17'} @@ -1456,11 +1532,18 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + zod@3.24.1: + resolution: {integrity: sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==} + zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} snapshots: + '@0no-co/graphql.web@1.0.12(graphql@16.10.0)': + optionalDependencies: + graphql: 16.10.0 + '@algolia/autocomplete-core@1.17.7(@algolia/client-search@5.17.1)(algoliasearch@5.17.1)(search-insights@2.17.3)': dependencies: '@algolia/autocomplete-plugin-algolia-insights': 1.17.7(@algolia/client-search@5.17.1)(algoliasearch@5.17.1)(search-insights@2.17.3) @@ -1754,6 +1837,10 @@ snapshots: '@floating-ui/utils@0.2.8': {} + '@graphql-typed-document-node/core@3.2.0(graphql@16.10.0)': + dependencies: + graphql: 16.10.0 + '@iconify-json/simple-icons@1.2.15': dependencies: '@iconify/types': 2.0.0 @@ -1771,6 +1858,24 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.0': {} + '@molt/command@0.9.0': + dependencies: + '@molt/types': 0.2.0 + alge: 0.8.1 + chalk: 5.3.0 + lodash.camelcase: 4.3.0 + lodash.snakecase: 4.1.1 + readline-sync: 1.4.10 + string-length: 6.0.0 + strip-ansi: 7.1.0 + ts-toolbelt: 9.6.0 + type-fest: 4.30.1 + zod: 3.24.1 + + '@molt/types@0.2.0': + dependencies: + ts-toolbelt: 9.6.0 + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -2076,6 +2181,13 @@ snapshots: - '@vue/composition-api' - vue + alge@0.8.1: + dependencies: + lodash.ismatch: 4.4.0 + remeda: 1.61.0 + ts-toolbelt: 9.6.0 + zod: 3.24.1 + algoliasearch@5.17.1: dependencies: '@algolia/client-abtesting': 5.17.1 @@ -2122,6 +2234,8 @@ snapshots: ccount@2.0.1: {} + chalk@5.3.0: {} + character-entities-html4@2.1.0: {} character-entities-legacy@3.0.0: {} @@ -2299,6 +2413,15 @@ snapshots: slash: 5.1.0 unicorn-magic: 0.1.0 + graffle@file:..(graphql@16.10.0): + dependencies: + '@0no-co/graphql.web': 1.0.12(graphql@16.10.0) + '@graphql-typed-document-node/core': 3.2.0(graphql@16.10.0) + '@molt/command': 0.9.0 + es-toolkit: 1.30.1 + graphql: 16.10.0 + is-plain-obj: 4.1.0 + graphql@16.10.0: {} gray-matter@4.0.3: @@ -2346,6 +2469,8 @@ snapshots: is-number@7.0.0: {} + is-plain-obj@4.1.0: {} + is-what@4.1.16: {} isexe@2.0.0: {} @@ -2363,6 +2488,12 @@ snapshots: kind-of@6.0.3: {} + lodash.camelcase@4.3.0: {} + + lodash.ismatch@4.4.0: {} + + lodash.snakecase@4.1.1: {} + longest-streak@3.1.0: {} lru-cache@10.4.3: {} @@ -2682,6 +2813,8 @@ snapshots: queue-microtask@1.2.3: {} + readline-sync@1.4.10: {} + regex-recursion@4.3.0: dependencies: regex-utilities: 2.3.0 @@ -2692,6 +2825,8 @@ snapshots: dependencies: regex-utilities: 2.3.0 + remeda@1.61.0: {} + resolve-pkg-maps@1.0.0: {} reusify@1.0.4: {} @@ -2761,6 +2896,10 @@ snapshots: sprintf-js@1.0.3: {} + string-length@6.0.0: + dependencies: + strip-ansi: 7.1.0 + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -2800,6 +2939,8 @@ snapshots: trim-lines@3.0.1: {} + ts-toolbelt@9.6.0: {} + tsx@4.19.2: dependencies: esbuild: 0.23.1 @@ -2826,6 +2967,8 @@ snapshots: transitivePeerDependencies: - supports-color + type-fest@4.30.1: {} + typescript@5.7.2: {} unicorn-magic@0.1.0: {} @@ -2965,4 +3108,6 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + zod@3.24.1: {} + zwitch@2.0.4: {}