From 62553b588230583e159661a65de7bee80e929b21 Mon Sep 17 00:00:00 2001 From: Jason Kuhrt Date: Fri, 27 Dec 2024 09:57:25 -0500 Subject: [PATCH] refactor: document-builder namespace (#1296) --- .../$/graffle/modules/methods-document.ts | 2 +- package.json | 5 +- src/documentBuilder/_.js | 1 - src/documentBuilder/_.ts | 5 + src/entrypoints/utilities-for-generated.ts | 3 +- src/extension/TypeHooks.ts | 4 +- .../injectTypenameOnRootResultFields.test.ts | 14 +- .../graffle/modules/methods-document.ts | 2 +- .../fixture/graffle/modules/methods-root.ts | 284 +++++++-- .../tests/fixture/graffle/modules/select.ts | 265 +++++---- .../__snapshots__/generate.test.ts.snap | 558 ++++++++++++------ src/generator/generators/MethodsDocument.ts | 2 +- src/generator/generators/MethodsRoot.ts | 5 +- src/generator/generators/Select.ts | 12 +- src/generator/generators/SelectionSets.ts | 15 +- .../CustomScalars/decode.test.ts | 11 +- .../CustomScalars/encode.test.ts | 7 +- .../graffle/modules/methods-document.ts | 2 +- .../graffle/modules/methods-root.ts | 284 +++++++-- .../kitchen-sink/graffle/modules/select.ts | 265 +++++---- .../graffle/modules/methods-document.ts | 2 +- .../graffle/modules/methods-root.ts | 13 +- .../mutation-only/graffle/modules/select.ts | 9 +- .../graffle/modules/methods-document.ts | 2 +- .../pokemon/graffle/modules/methods-root.ts | 43 +- .../schemas/pokemon/graffle/modules/select.ts | 93 +-- .../graffle/modules/methods-document.ts | 2 +- .../graffle/modules/methods-root.ts | 16 +- .../query-only/graffle/modules/select.ts | 4 +- website/graffle/modules/methods-document.ts | 2 +- website/graffle/modules/methods-root.ts | 43 +- website/graffle/modules/select.ts | 93 +-- 32 files changed, 1350 insertions(+), 718 deletions(-) delete mode 100644 src/documentBuilder/_.js create mode 100644 src/documentBuilder/_.ts diff --git a/examples/$/graffle/modules/methods-document.ts b/examples/$/graffle/modules/methods-document.ts index 9bb35d9f7..9e52027e2 100644 --- a/examples/$/graffle/modules/methods-document.ts +++ b/examples/$/graffle/modules/methods-document.ts @@ -5,7 +5,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/package.json b/package.json index 57d73ee1d..9bf068050 100644 --- a/package.json +++ b/package.json @@ -89,12 +89,13 @@ }, "homepage": "https://github.com/graffle-js/graffle", "scripts": { + "graffle": "tsx ./src/generator/cli/generate.ts", "serve:pokemon": "tsx tests/_/services/pokemonManual.ts", - "gen:graffle": "pnpm gen:graffle:tests && pnpm build && cd website && pnpm gen:graffle", + "gen:graffle": "pnpm gen:graffle:tests && pnpm build && pnpm website:gen:graffle", "gen:graffle:tests": "tsx tests/_/schemas/generate.ts && pnpm graffle --project src/extensions/SchemaErrors/tests/fixture", "examples:gen:graffle": "pnpm build && cd examples && pnpm i && pnpm gen:graffle", "examples:link-mode": "cd examples && pnpm add ..", - "graffle": "tsx ./src/generator/cli/generate.ts", + "website:gen:graffle": "cd website && pnpm i && pnpm gen:graffle", "gen:examples": "tsx scripts/generate-examples-derivatives/generate.ts && pnpm format", "gen:examples:outputs": "tsx scripts/generate-examples-derivatives/generate.ts --outputs", "dev": "rm -rf dist && tsc --watch", diff --git a/src/documentBuilder/_.js b/src/documentBuilder/_.js deleted file mode 100644 index 4c37d1002..000000000 --- a/src/documentBuilder/_.js +++ /dev/null @@ -1 +0,0 @@ -export * from './InferResult/__.js' diff --git a/src/documentBuilder/_.ts b/src/documentBuilder/_.ts new file mode 100644 index 000000000..63ae94f19 --- /dev/null +++ b/src/documentBuilder/_.ts @@ -0,0 +1,5 @@ +export * from './InferResult/__.js' +export * from './requestMethods/document.js' +export * from './requestMethods/requestMethods.js' +export * from './Select/__.js' +export * from './SelectGraphQLMapper/__.js' diff --git a/src/entrypoints/utilities-for-generated.ts b/src/entrypoints/utilities-for-generated.ts index a62bd2715..cc39a5ee7 100644 --- a/src/entrypoints/utilities-for-generated.ts +++ b/src/entrypoints/utilities-for-generated.ts @@ -2,8 +2,7 @@ export type { Simplify } from 'type-fest' export { createConstructorWithContext } from '../client/client.js' export type { ConfigGetOutputError, HandleOutput, HandleOutputGraffleRootField } from '../client/handleOutput.js' export { useReducer } from '../client/properties/use.js' -export { type DocumentRunner } from '../documentBuilder/requestMethods/document.js' -export * from '../documentBuilder/Select/__.js' +export * from '../documentBuilder/__.js' export { type AssertExtendsObject, type Exact, type ExactNonEmpty, type UnionExpanded } from '../lib/prelude.js' export { TypeFunction } from '../lib/type-function/__.js' export type { ClientTransports } from '../types/context.js' diff --git a/src/extension/TypeHooks.ts b/src/extension/TypeHooks.ts index 6f94d5a7a..174b38157 100644 --- a/src/extension/TypeHooks.ts +++ b/src/extension/TypeHooks.ts @@ -1,5 +1,5 @@ import type { GraffleExecutionResultEnvelope } from '../client/handleOutput.js' -import type { Select } from '../entrypoints/utilities-for-generated.js' +import type { DocumentBuilder } from '../documentBuilder/__.js' import type { AssertExtends } from '../lib/prelude.js' import type { TypeFunction } from '../lib/type-function/__.js' import type { Context } from '../types/context.js' @@ -79,7 +79,7 @@ export interface TypeHooksBuilder<$TypeHooks extends TypeHooks = TypeHooksEmpty> export interface OnRequestDocumentRootType extends TypeFunction {} export namespace OnRequestDocumentRootType { export interface Params { - selectionRootType: Select.SelectionSet.RootType + selectionRootType: DocumentBuilder.Select.SelectionSet.RootType } } diff --git a/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.test.ts b/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.test.ts index a88306dd1..5c1a6825b 100644 --- a/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.test.ts +++ b/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.test.ts @@ -1,7 +1,5 @@ import { expect, test } from 'vitest' -import { graffleMappedResultToRequest } from '../../documentBuilder/requestMethods/requestMethods.js' -import { normalizeOrThrow } from '../../documentBuilder/Select/document.js' -import { SelectionSetGraphqlMapper } from '../../documentBuilder/SelectGraphQLMapper/__.js' +import { DocumentBuilder } from '../../documentBuilder/__.js' import { injectTypenameOnRootResultFields } from './injectTypenameOnRootResultFields.js' import { GraffleSchemaErrors } from './tests/fixture/graffle/__.js' @@ -35,14 +33,14 @@ test.each([ { resultNonNull: [`x`, {}] }, { resultNonNull: [`x`, { __typename: true }] }], ])(`Query %s`, (_, queryWithoutTypenameInput, queryWithTypenameInput) => { - const docWithout = SelectionSetGraphqlMapper.toGraphQL( - normalizeOrThrow({ query: { x: queryWithoutTypenameInput as any } }), + const docWithout = DocumentBuilder.SelectionSetGraphqlMapper.toGraphQL( + DocumentBuilder.Select.Document.normalizeOrThrow({ query: { x: queryWithoutTypenameInput as any } }), ) - const docWith = SelectionSetGraphqlMapper.toGraphQL( - normalizeOrThrow({ query: { x: queryWithTypenameInput as any } }), + const docWith = DocumentBuilder.SelectionSetGraphqlMapper.toGraphQL( + DocumentBuilder.Select.Document.normalizeOrThrow({ query: { x: queryWithTypenameInput as any } }), ) injectTypenameOnRootResultFields({ - request: graffleMappedResultToRequest(docWithout), + request: DocumentBuilder.graffleMappedResultToRequest(docWithout), sddm: GraffleSchemaErrors.schemaMap, }) expect(docWithout.document).toMatchObject(docWith.document) diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-document.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-document.ts index 886c5f999..ae89d6b3d 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-document.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-document.ts @@ -5,7 +5,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-root.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-root.ts index bde82c9c9..b64a168a5 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-root.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/methods-root.ts @@ -1,4 +1,3 @@ -import type { InferResult } from '../../../../../../entrypoints/schema.js' import type * as $$Utilities from '../../../../../../entrypoints/utilities-for-generated.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -12,7 +11,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationQuery<$$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']>> + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + $$Utilities.AssertExtendsObject<$SelectionSet>, + $$Schema.Schema<$Context['scalars']> + > > > > @@ -36,7 +38,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ InputObjectNested: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { InputObjectNested: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'InputObjectNested' > > @@ -53,7 +58,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ InputObjectNestedNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { InputObjectNestedNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'InputObjectNestedNonNull' > > @@ -69,7 +77,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ abcEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { abcEnum: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'abcEnum' > > @@ -86,7 +97,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ argInputObjectCircular: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { argInputObjectCircular: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'argInputObjectCircular' > > @@ -100,7 +114,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ date: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { date: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'date' > > @@ -114,7 +131,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArg' > > @@ -128,7 +148,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgInputObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgInputObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgInputObject' > > @@ -142,7 +165,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgList' > > @@ -156,7 +182,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNull' > > @@ -170,7 +199,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNullList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNullList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNullList' > > @@ -187,7 +219,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNullListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNullListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNullListNonNull' > > @@ -201,7 +236,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateInterface1: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateInterface1: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateInterface1' > > @@ -215,7 +253,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateList' > > @@ -229,7 +270,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateListList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateListList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateListList' > > @@ -243,7 +287,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateListNonNull' > > @@ -257,7 +304,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateNonNull' > > @@ -271,7 +321,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateObject1: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateObject1: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateObject1' > > @@ -285,7 +338,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateUnion: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateUnion: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateUnion' > > @@ -299,7 +355,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ error: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { error: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'error' > > @@ -313,7 +372,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -327,7 +389,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > @@ -341,7 +406,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interface: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interface: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interface' > > @@ -358,7 +426,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyChildA: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyChildA: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyChildA' > > @@ -375,7 +446,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyChildB: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyChildB: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyChildB' > > @@ -392,7 +466,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { interfaceHierarchyGrandparents: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -412,7 +486,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyParents: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyParents: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyParents' > > @@ -426,7 +503,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceNonNull' > > @@ -440,7 +520,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceWithArgs' > > @@ -454,7 +537,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listInt: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listInt: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listInt' > > @@ -468,7 +554,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listIntNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listIntNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listIntNonNull' > > @@ -482,7 +571,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listListInt: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listListInt: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listListInt' > > @@ -496,7 +588,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listListIntNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listListIntNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listListIntNonNull' > > @@ -510,7 +605,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ lowerCaseUnion: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { lowerCaseUnion: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'lowerCaseUnion' > > @@ -524,7 +622,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ object: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { object: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'object' > > @@ -538,7 +639,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectList' > > @@ -552,7 +656,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectListNonNull' > > @@ -566,7 +673,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectNested: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectNested: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectNested' > > @@ -580,7 +690,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectNonNull' > > @@ -594,7 +707,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectWithArgs' > > @@ -608,7 +724,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ result: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { result: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'result' > > @@ -622,7 +741,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ resultNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { resultNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'resultNonNull' > > @@ -636,7 +758,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ string: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { string: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'string' > > @@ -650,7 +775,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgEnum: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgEnum' > > @@ -667,7 +795,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgInputObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgInputObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgInputObject' > > @@ -684,7 +815,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { stringWithArgInputObjectEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -704,7 +835,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { stringWithArgInputObjectRequired: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -723,7 +854,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgs' > > @@ -737,7 +871,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithListArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithListArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithListArg' > > @@ -754,7 +891,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithListArgRequired: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithListArgRequired: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithListArgRequired' > > @@ -768,7 +908,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithRequiredArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithRequiredArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithRequiredArg' > > @@ -782,7 +925,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBar: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBar: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBar' > > @@ -796,7 +942,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBarNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBarNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBarNonNull' > > @@ -810,7 +959,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBarWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBarWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBarWithArgs' > > @@ -824,7 +976,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionObject' > > @@ -838,7 +993,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionObjectNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionObjectNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionObjectNonNull' > > @@ -854,7 +1012,7 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationMutation< + $$Utilities.DocumentBuilder.InferResult.OperationMutation< $$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']> > @@ -881,7 +1039,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -895,7 +1056,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/select.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/select.ts index b42dbb549..81c7bae5b 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/select.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/select.ts @@ -1,5 +1,5 @@ import type { OperationTypeNode } from 'graphql' -import type { InferResult } from '../../../../../../entrypoints/schema.js' +import type * as $$Utilities from '../../../../../../entrypoints/utilities-for-generated.js' import * as $$Data from './data.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -42,165 +42,184 @@ export namespace Select { // Root // -------------------------------------------------------------------------------------------------- // - export type Query<$SelectionSet extends $$SelectionSets.Query> = InferResult.Operation< + export type Query<$SelectionSet extends $$SelectionSets.Query> = $$Utilities.DocumentBuilder.InferResult.Operation< $SelectionSet, $$Schema.Schema, OperationTypeNode.QUERY > - export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = InferResult.Operation< - $SelectionSet, - $$Schema.Schema, - OperationTypeNode.MUTATION - > + export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = + $$Utilities.DocumentBuilder.InferResult.Operation<$SelectionSet, $$Schema.Schema, OperationTypeNode.MUTATION> // OutputObject // -------------------------------------------------------------------------------------------------- // - export type Bar<$SelectionSet extends $$SelectionSets.Bar> = InferResult.OutputObjectLike< + export type Bar<$SelectionSet extends $$SelectionSets.Bar> = $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Bar'] > - export type DateObject1<$SelectionSet extends $$SelectionSets.DateObject1> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateObject1'] - > - export type DateObject2<$SelectionSet extends $$SelectionSets.DateObject2> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateObject2'] - > - export type ErrorOne<$SelectionSet extends $$SelectionSets.ErrorOne> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ErrorOne'] - > - export type ErrorTwo<$SelectionSet extends $$SelectionSets.ErrorTwo> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ErrorTwo'] - > - export type Foo<$SelectionSet extends $$SelectionSets.Foo> = InferResult.OutputObjectLike< + export type DateObject1<$SelectionSet extends $$SelectionSets.DateObject1> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateObject1'] + > + export type DateObject2<$SelectionSet extends $$SelectionSets.DateObject2> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateObject2'] + > + export type ErrorOne<$SelectionSet extends $$SelectionSets.ErrorOne> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ErrorOne'] + > + export type ErrorTwo<$SelectionSet extends $$SelectionSets.ErrorTwo> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ErrorTwo'] + > + export type Foo<$SelectionSet extends $$SelectionSets.Foo> = $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Foo'] > - export type Object1<$SelectionSet extends $$SelectionSets.Object1> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['Object1'] - > + export type Object1<$SelectionSet extends $$SelectionSets.Object1> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Object1'] + > export type Object1ImplementingInterface<$SelectionSet extends $$SelectionSets.Object1ImplementingInterface> = - InferResult.OutputObjectLike< + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Object1ImplementingInterface'] > export type Object2ImplementingInterface<$SelectionSet extends $$SelectionSets.Object2ImplementingInterface> = - InferResult.OutputObjectLike< + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Object2ImplementingInterface'] > - export type ObjectChildA<$SelectionSet extends $$SelectionSets.ObjectChildA> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectChildA'] - > - export type ObjectChildB<$SelectionSet extends $$SelectionSets.ObjectChildB> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectChildB'] - > - export type ObjectGrandparent<$SelectionSet extends $$SelectionSets.ObjectGrandparent> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectGrandparent'] - > - export type ObjectNested<$SelectionSet extends $$SelectionSets.ObjectNested> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectNested'] - > - export type ObjectParent<$SelectionSet extends $$SelectionSets.ObjectParent> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectParent'] - > - export type ObjectUnion<$SelectionSet extends $$SelectionSets.ObjectUnion> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectUnion'] - > - export type lowerCaseObject<$SelectionSet extends $$SelectionSets.lowerCaseObject> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseObject'] - > - export type lowerCaseObject2<$SelectionSet extends $$SelectionSets.lowerCaseObject2> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseObject2'] - > + export type ObjectChildA<$SelectionSet extends $$SelectionSets.ObjectChildA> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectChildA'] + > + export type ObjectChildB<$SelectionSet extends $$SelectionSets.ObjectChildB> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectChildB'] + > + export type ObjectGrandparent<$SelectionSet extends $$SelectionSets.ObjectGrandparent> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectGrandparent'] + > + export type ObjectNested<$SelectionSet extends $$SelectionSets.ObjectNested> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectNested'] + > + export type ObjectParent<$SelectionSet extends $$SelectionSets.ObjectParent> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectParent'] + > + export type ObjectUnion<$SelectionSet extends $$SelectionSets.ObjectUnion> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectUnion'] + > + export type lowerCaseObject<$SelectionSet extends $$SelectionSets.lowerCaseObject> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseObject'] + > + export type lowerCaseObject2<$SelectionSet extends $$SelectionSets.lowerCaseObject2> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseObject2'] + > // Union // -------------------------------------------------------------------------------------------------- // - export type DateUnion<$SelectionSet extends $$SelectionSets.DateUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateUnion'] - > - export type FooBarUnion<$SelectionSet extends $$SelectionSets.FooBarUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['FooBarUnion'] - > - export type Result<$SelectionSet extends $$SelectionSets.Result> = InferResult.Union< + export type DateUnion<$SelectionSet extends $$SelectionSets.DateUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateUnion'] + > + export type FooBarUnion<$SelectionSet extends $$SelectionSets.FooBarUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['FooBarUnion'] + > + export type Result<$SelectionSet extends $$SelectionSets.Result> = $$Utilities.DocumentBuilder.InferResult.Union< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Result'] > - export type lowerCaseUnion<$SelectionSet extends $$SelectionSets.lowerCaseUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseUnion'] - > + export type lowerCaseUnion<$SelectionSet extends $$SelectionSets.lowerCaseUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseUnion'] + > // Interface // -------------------------------------------------------------------------------------------------- // - export type DateInterface1<$SelectionSet extends $$SelectionSets.DateInterface1> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateInterface1'] - > - export type Error<$SelectionSet extends $$SelectionSets.Error> = InferResult.Interface< + export type DateInterface1<$SelectionSet extends $$SelectionSets.DateInterface1> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateInterface1'] + > + export type Error<$SelectionSet extends $$SelectionSets.Error> = $$Utilities.DocumentBuilder.InferResult.Interface< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Error'] > - export type Interface<$SelectionSet extends $$SelectionSets.Interface> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['Interface'] - > - export type InterfaceChildA<$SelectionSet extends $$SelectionSets.InterfaceChildA> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceChildA'] - > - export type InterfaceChildB<$SelectionSet extends $$SelectionSets.InterfaceChildB> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceChildB'] - > - export type InterfaceGrandparent<$SelectionSet extends $$SelectionSets.InterfaceGrandparent> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceGrandparent'] - > - export type InterfaceParent<$SelectionSet extends $$SelectionSets.InterfaceParent> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceParent'] - > + export type Interface<$SelectionSet extends $$SelectionSets.Interface> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Interface'] + > + export type InterfaceChildA<$SelectionSet extends $$SelectionSets.InterfaceChildA> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceChildA'] + > + export type InterfaceChildB<$SelectionSet extends $$SelectionSets.InterfaceChildB> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceChildB'] + > + export type InterfaceGrandparent<$SelectionSet extends $$SelectionSets.InterfaceGrandparent> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceGrandparent'] + > + export type InterfaceParent<$SelectionSet extends $$SelectionSets.InterfaceParent> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceParent'] + > } diff --git a/src/generator/generator/__snapshots__/generate.test.ts.snap b/src/generator/generator/__snapshots__/generate.test.ts.snap index 0d94737db..5a4f30464 100644 --- a/src/generator/generator/__snapshots__/generate.test.ts.snap +++ b/src/generator/generator/__snapshots__/generate.test.ts.snap @@ -147,7 +147,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as @@ -164,8 +164,7 @@ export interface BuilderMethodsDocumentFn extends $$Utilities.TypeFunction { `; exports[`kitchen-sink generated modules > modules/methods-root.ts 1`] = ` -"import type { InferResult } from '../../../../../../src/entrypoints/schema.js' -import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' +"import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -178,7 +177,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationQuery<$$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']>> + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + $$Utilities.AssertExtendsObject<$SelectionSet>, + $$Schema.Schema<$Context['scalars']> + > > > > @@ -202,7 +204,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ InputObjectNested: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { InputObjectNested: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'InputObjectNested' > > @@ -219,7 +224,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ InputObjectNestedNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { InputObjectNestedNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'InputObjectNestedNonNull' > > @@ -235,7 +243,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ abcEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { abcEnum: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'abcEnum' > > @@ -252,7 +263,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ argInputObjectCircular: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { argInputObjectCircular: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'argInputObjectCircular' > > @@ -266,7 +280,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ date: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { date: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'date' > > @@ -280,7 +297,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArg' > > @@ -294,7 +314,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgInputObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgInputObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgInputObject' > > @@ -308,7 +331,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgList' > > @@ -322,7 +348,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNull' > > @@ -336,7 +365,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNullList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNullList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNullList' > > @@ -353,7 +385,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNullListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNullListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNullListNonNull' > > @@ -367,7 +402,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateInterface1: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateInterface1: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateInterface1' > > @@ -381,7 +419,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateList' > > @@ -395,7 +436,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateListList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateListList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateListList' > > @@ -409,7 +453,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateListNonNull' > > @@ -423,7 +470,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateNonNull' > > @@ -437,7 +487,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateObject1: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateObject1: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateObject1' > > @@ -451,7 +504,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateUnion: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateUnion: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateUnion' > > @@ -465,7 +521,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ error: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { error: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'error' > > @@ -479,7 +538,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -493,7 +555,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > @@ -507,7 +572,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interface: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interface: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interface' > > @@ -524,7 +592,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyChildA: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyChildA: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyChildA' > > @@ -541,7 +612,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyChildB: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyChildB: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyChildB' > > @@ -558,7 +632,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { interfaceHierarchyGrandparents: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -578,7 +652,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyParents: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyParents: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyParents' > > @@ -592,7 +669,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceNonNull' > > @@ -606,7 +686,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceWithArgs' > > @@ -620,7 +703,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listInt: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listInt: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listInt' > > @@ -634,7 +720,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listIntNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listIntNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listIntNonNull' > > @@ -648,7 +737,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listListInt: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listListInt: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listListInt' > > @@ -662,7 +754,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listListIntNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listListIntNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listListIntNonNull' > > @@ -676,7 +771,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ lowerCaseUnion: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { lowerCaseUnion: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'lowerCaseUnion' > > @@ -690,7 +788,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ object: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { object: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'object' > > @@ -704,7 +805,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectList' > > @@ -718,7 +822,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectListNonNull' > > @@ -732,7 +839,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectNested: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectNested: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectNested' > > @@ -746,7 +856,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectNonNull' > > @@ -760,7 +873,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectWithArgs' > > @@ -774,7 +890,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ result: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { result: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'result' > > @@ -788,7 +907,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ resultNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { resultNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'resultNonNull' > > @@ -802,7 +924,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ string: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { string: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'string' > > @@ -816,7 +941,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgEnum: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgEnum' > > @@ -833,7 +961,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgInputObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgInputObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgInputObject' > > @@ -850,7 +981,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { stringWithArgInputObjectEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -870,7 +1001,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { stringWithArgInputObjectRequired: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -889,7 +1020,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgs' > > @@ -903,7 +1037,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithListArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithListArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithListArg' > > @@ -920,7 +1057,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithListArgRequired: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithListArgRequired: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithListArgRequired' > > @@ -934,7 +1074,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithRequiredArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithRequiredArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithRequiredArg' > > @@ -948,7 +1091,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBar: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBar: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBar' > > @@ -962,7 +1108,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBarNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBarNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBarNonNull' > > @@ -976,7 +1125,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBarWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBarWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBarWithArgs' > > @@ -990,7 +1142,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionObject' > > @@ -1004,7 +1159,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionObjectNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionObjectNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionObjectNonNull' > > @@ -1020,7 +1178,7 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationMutation< + $$Utilities.DocumentBuilder.InferResult.OperationMutation< $$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']> > @@ -1047,7 +1205,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -1061,7 +1222,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > @@ -4652,7 +4816,7 @@ export { $schemaDrivenDataMap as schemaDrivenDataMap } exports[`kitchen-sink generated modules > modules/select.ts 1`] = ` "import type { OperationTypeNode } from 'graphql' -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Data from './data.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -4695,167 +4859,186 @@ export namespace Select { // Root // -------------------------------------------------------------------------------------------------- // - export type Query<$SelectionSet extends $$SelectionSets.Query> = InferResult.Operation< + export type Query<$SelectionSet extends $$SelectionSets.Query> = $$Utilities.DocumentBuilder.InferResult.Operation< $SelectionSet, $$Schema.Schema, OperationTypeNode.QUERY > - export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = InferResult.Operation< - $SelectionSet, - $$Schema.Schema, - OperationTypeNode.MUTATION - > + export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = + $$Utilities.DocumentBuilder.InferResult.Operation<$SelectionSet, $$Schema.Schema, OperationTypeNode.MUTATION> // OutputObject // -------------------------------------------------------------------------------------------------- // - export type Bar<$SelectionSet extends $$SelectionSets.Bar> = InferResult.OutputObjectLike< + export type Bar<$SelectionSet extends $$SelectionSets.Bar> = $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Bar'] > - export type DateObject1<$SelectionSet extends $$SelectionSets.DateObject1> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateObject1'] - > - export type DateObject2<$SelectionSet extends $$SelectionSets.DateObject2> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateObject2'] - > - export type ErrorOne<$SelectionSet extends $$SelectionSets.ErrorOne> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ErrorOne'] - > - export type ErrorTwo<$SelectionSet extends $$SelectionSets.ErrorTwo> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ErrorTwo'] - > - export type Foo<$SelectionSet extends $$SelectionSets.Foo> = InferResult.OutputObjectLike< + export type DateObject1<$SelectionSet extends $$SelectionSets.DateObject1> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateObject1'] + > + export type DateObject2<$SelectionSet extends $$SelectionSets.DateObject2> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateObject2'] + > + export type ErrorOne<$SelectionSet extends $$SelectionSets.ErrorOne> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ErrorOne'] + > + export type ErrorTwo<$SelectionSet extends $$SelectionSets.ErrorTwo> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ErrorTwo'] + > + export type Foo<$SelectionSet extends $$SelectionSets.Foo> = $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Foo'] > - export type Object1<$SelectionSet extends $$SelectionSets.Object1> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['Object1'] - > + export type Object1<$SelectionSet extends $$SelectionSets.Object1> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Object1'] + > export type Object1ImplementingInterface<$SelectionSet extends $$SelectionSets.Object1ImplementingInterface> = - InferResult.OutputObjectLike< + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Object1ImplementingInterface'] > export type Object2ImplementingInterface<$SelectionSet extends $$SelectionSets.Object2ImplementingInterface> = - InferResult.OutputObjectLike< + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Object2ImplementingInterface'] > - export type ObjectChildA<$SelectionSet extends $$SelectionSets.ObjectChildA> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectChildA'] - > - export type ObjectChildB<$SelectionSet extends $$SelectionSets.ObjectChildB> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectChildB'] - > - export type ObjectGrandparent<$SelectionSet extends $$SelectionSets.ObjectGrandparent> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectGrandparent'] - > - export type ObjectNested<$SelectionSet extends $$SelectionSets.ObjectNested> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectNested'] - > - export type ObjectParent<$SelectionSet extends $$SelectionSets.ObjectParent> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectParent'] - > - export type ObjectUnion<$SelectionSet extends $$SelectionSets.ObjectUnion> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectUnion'] - > - export type lowerCaseObject<$SelectionSet extends $$SelectionSets.lowerCaseObject> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseObject'] - > - export type lowerCaseObject2<$SelectionSet extends $$SelectionSets.lowerCaseObject2> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseObject2'] - > + export type ObjectChildA<$SelectionSet extends $$SelectionSets.ObjectChildA> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectChildA'] + > + export type ObjectChildB<$SelectionSet extends $$SelectionSets.ObjectChildB> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectChildB'] + > + export type ObjectGrandparent<$SelectionSet extends $$SelectionSets.ObjectGrandparent> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectGrandparent'] + > + export type ObjectNested<$SelectionSet extends $$SelectionSets.ObjectNested> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectNested'] + > + export type ObjectParent<$SelectionSet extends $$SelectionSets.ObjectParent> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectParent'] + > + export type ObjectUnion<$SelectionSet extends $$SelectionSets.ObjectUnion> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectUnion'] + > + export type lowerCaseObject<$SelectionSet extends $$SelectionSets.lowerCaseObject> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseObject'] + > + export type lowerCaseObject2<$SelectionSet extends $$SelectionSets.lowerCaseObject2> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseObject2'] + > // Union // -------------------------------------------------------------------------------------------------- // - export type DateUnion<$SelectionSet extends $$SelectionSets.DateUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateUnion'] - > - export type FooBarUnion<$SelectionSet extends $$SelectionSets.FooBarUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['FooBarUnion'] - > - export type Result<$SelectionSet extends $$SelectionSets.Result> = InferResult.Union< + export type DateUnion<$SelectionSet extends $$SelectionSets.DateUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateUnion'] + > + export type FooBarUnion<$SelectionSet extends $$SelectionSets.FooBarUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['FooBarUnion'] + > + export type Result<$SelectionSet extends $$SelectionSets.Result> = $$Utilities.DocumentBuilder.InferResult.Union< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Result'] > - export type lowerCaseUnion<$SelectionSet extends $$SelectionSets.lowerCaseUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseUnion'] - > + export type lowerCaseUnion<$SelectionSet extends $$SelectionSets.lowerCaseUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseUnion'] + > // Interface // -------------------------------------------------------------------------------------------------- // - export type DateInterface1<$SelectionSet extends $$SelectionSets.DateInterface1> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateInterface1'] - > - export type Error<$SelectionSet extends $$SelectionSets.Error> = InferResult.Interface< + export type DateInterface1<$SelectionSet extends $$SelectionSets.DateInterface1> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateInterface1'] + > + export type Error<$SelectionSet extends $$SelectionSets.Error> = $$Utilities.DocumentBuilder.InferResult.Interface< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Error'] > - export type Interface<$SelectionSet extends $$SelectionSets.Interface> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['Interface'] - > - export type InterfaceChildA<$SelectionSet extends $$SelectionSets.InterfaceChildA> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceChildA'] - > - export type InterfaceChildB<$SelectionSet extends $$SelectionSets.InterfaceChildB> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceChildB'] - > - export type InterfaceGrandparent<$SelectionSet extends $$SelectionSets.InterfaceGrandparent> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceGrandparent'] - > - export type InterfaceParent<$SelectionSet extends $$SelectionSets.InterfaceParent> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceParent'] - > + export type Interface<$SelectionSet extends $$SelectionSets.Interface> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Interface'] + > + export type InterfaceChildA<$SelectionSet extends $$SelectionSets.InterfaceChildA> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceChildA'] + > + export type InterfaceChildB<$SelectionSet extends $$SelectionSets.InterfaceChildB> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceChildB'] + > + export type InterfaceGrandparent<$SelectionSet extends $$SelectionSets.InterfaceGrandparent> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceGrandparent'] + > + export type InterfaceParent<$SelectionSet extends $$SelectionSets.InterfaceParent> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceParent'] + > } " `; @@ -9905,7 +10088,6 @@ exports[`root-types-mapped 2`] = ` "import * as $$SelectionSets from "./selection-sets.js"; import * as $$Schema from "./schema.js"; import type * as $$Utilities from "graffle/utilities-for-generated"; -import type { InferResult } from "graffle/schema"; export interface QueryRootMethods<$Context extends $$Utilities.Context> { $batch: $$Utilities.ClientTransports.PreflightCheck< @@ -9919,7 +10101,7 @@ export interface QueryRootMethods<$Context extends $$Utilities.Context> { (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< $$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context["scalars"]> > @@ -9949,7 +10131,7 @@ export interface QueryRootMethods<$Context extends $$Utilities.Context> { (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { id: $SelectionSet }, $$Schema.Schema<$Context["scalars"]> >, diff --git a/src/generator/generators/MethodsDocument.ts b/src/generator/generators/MethodsDocument.ts index e02e69de0..5c4d14eae 100644 --- a/src/generator/generators/MethodsDocument.ts +++ b/src/generator/generators/MethodsDocument.ts @@ -20,7 +20,7 @@ export const ModuleGeneratorMethodsDocument = createModuleGenerator( parameters: [`$Context extends ${identifiers.$$Utilities}.Context`], // dprint-ignore block: ` - <$Document>(document: ${identifiers.$$Utilities}.ExactNonEmpty<$Document, ${identifiers.$$SelectionSets}.$Document<$Context['scalars']>>): ${identifiers.$$Utilities}.DocumentRunner< + <$Document>(document: ${identifiers.$$Utilities}.ExactNonEmpty<$Document, ${identifiers.$$SelectionSets}.$Document<$Context['scalars']>>): ${identifiers.$$Utilities}.DocumentBuilder.DocumentRunner< $Context, ${identifiers.$$Schema}.${identifiers.Schema}, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/src/generator/generators/MethodsRoot.ts b/src/generator/generators/MethodsRoot.ts index d9cf1569a..a9eebe519 100644 --- a/src/generator/generators/MethodsRoot.ts +++ b/src/generator/generators/MethodsRoot.ts @@ -16,7 +16,6 @@ export const ModuleGeneratorMethodsRoot = createModuleGenerator( code(importModuleGenerator(config, ModuleGeneratorSchema)) code( `import type * as ${identifiers.$$Utilities} from '${config.paths.imports.grafflePackage.utilitiesForGenerated}';`, - `import type { InferResult } from '${config.paths.imports.grafflePackage.schema}'`, ) code() code() @@ -60,7 +59,7 @@ const renderRootType = createCodeGenerator<{ node: Grafaid.Schema.ObjectType }>( & (null | {}) & ${identifiers.$$Utilities}.HandleOutput< $Context, - InferResult.Operation${capitalizeFirstLetter(operationType)}<${identifiers.$$Utilities}.AssertExtendsObject<$SelectionSet>, ${identifiers.$$Schema}.${identifiers.Schema}<$Context['scalars']>> + ${identifiers.$$Utilities}.DocumentBuilder.InferResult.Operation${capitalizeFirstLetter(operationType)}<${identifiers.$$Utilities}.AssertExtendsObject<$SelectionSet>, ${identifiers.$$Schema}.${identifiers.Schema}<$Context['scalars']>> > > > @@ -102,7 +101,7 @@ const renderFieldMethods = createCodeGenerator<{ node: Grafaid.Schema.ObjectType & (null | {}) & ${identifiers.$$Utilities}.HandleOutputGraffleRootField< $Context, - InferResult.Operation${capitalizeFirstLetter(operationType)}<{ ${field.name}: $SelectionSet}, ${identifiers.$$Schema}.${identifiers.Schema}<$Context['scalars']>>, + ${identifiers.$$Utilities}.DocumentBuilder.InferResult.Operation${capitalizeFirstLetter(operationType)}<{ ${field.name}: $SelectionSet}, ${identifiers.$$Schema}.${identifiers.Schema}<$Context['scalars']>>, '${field.name}' > > diff --git a/src/generator/generators/Select.ts b/src/generator/generators/Select.ts index e5569d0ae..3535dc101 100644 --- a/src/generator/generators/Select.ts +++ b/src/generator/generators/Select.ts @@ -22,7 +22,7 @@ export const ModuleGeneratorSelect = createModuleGenerator( ${importModuleGenerator(config, ModuleGeneratorSchema)} ${importModuleGenerator(config, ModuleGeneratorSelectionSets)} import type { OperationTypeNode } from 'graphql' - import type { InferResult } from '${config.paths.imports.grafflePackage.schema}' + import type * as ${identifiers.$$Utilities} from '${config.paths.imports.grafflePackage.utilitiesForGenerated}' `) code() code(Tex.title1(`Runtime`)) @@ -38,26 +38,28 @@ export const ModuleGeneratorSelect = createModuleGenerator( if (!type) return null return `export type ${type.name}<$SelectionSet extends $$SelectionSets.${ renderName(type) - }> = InferResult.Operation<$SelectionSet, ${iSchema}, OperationTypeNode.${enumMemberName[operationType]}>` + }> = ${identifiers.$$Utilities}.DocumentBuilder.InferResult.Operation<$SelectionSet, ${iSchema}, OperationTypeNode.${ + enumMemberName[operationType] + }>` }), ) code(Tex.title2(`OutputObject`)) code(...config.schema.kindMap.list.OutputObject.map((type) => { return `export type ${type.name}<$SelectionSet extends $$SelectionSets.${ renderName(type) - }> = InferResult.OutputObjectLike<$SelectionSet, ${iSchema}, ${iSchema}['allTypes']['${type.name}']>` + }> = ${identifiers.$$Utilities}.DocumentBuilder.InferResult.OutputObjectLike<$SelectionSet, ${iSchema}, ${iSchema}['allTypes']['${type.name}']>` })) code(Tex.title2(`Union`)) code(...config.schema.kindMap.list.Union.map((type) => { return `export type ${type.name}<$SelectionSet extends $$SelectionSets.${ renderName(type) - }> = InferResult.Union<$SelectionSet, ${iSchema}, ${iSchema}['allTypes']['${type.name}']>` + }> = ${identifiers.$$Utilities}.DocumentBuilder.InferResult.Union<$SelectionSet, ${iSchema}, ${iSchema}['allTypes']['${type.name}']>` })) code(Tex.title2(`Interface`)) code(...config.schema.kindMap.list.Interface.map((type) => { return `export type ${type.name}<$SelectionSet extends $$SelectionSets.${ renderName(type) - }> = InferResult.Interface<$SelectionSet, ${iSchema}, ${iSchema}['allTypes']['${type.name}']>` + }> = ${identifiers.$$Utilities}.DocumentBuilder.InferResult.Interface<$SelectionSet, ${iSchema}, ${iSchema}['allTypes']['${type.name}']>` })) code(`}`) diff --git a/src/generator/generators/SelectionSets.ts b/src/generator/generators/SelectionSets.ts index fd6622608..8f00bfaf7 100644 --- a/src/generator/generators/SelectionSets.ts +++ b/src/generator/generators/SelectionSets.ts @@ -1,7 +1,7 @@ // todo: generate in JSDoc how the feature maps to GQL syntax. // todo: on union fields, JSDoc that mentions the syntax `on*` -import { Select } from '../../documentBuilder/Select/__.js' +import { DocumentBuilder } from '../../documentBuilder/__.js' import { Code } from '../../lib/Code.js' import { Grafaid } from '../../lib/grafaid/__.js' import { analyzeArgsNullability } from '../../lib/grafaid/schema/args.js' @@ -98,7 +98,9 @@ export const ModuleGeneratorSelectionSets = createModuleGenerator( const Union = createCodeGenerator<{ type: Grafaid.Schema.UnionType }>( ({ config, type, code }) => { const fragmentsInlineType = type.getTypes().map((type) => - `${Select.InlineFragment.typeConditionPRefix}${type.name}?: ${H.forwardTypeParameter$Scalars(type)}` + `${DocumentBuilder.Select.InlineFragment.typeConditionPRefix}${type.name}?: ${ + H.forwardTypeParameter$Scalars(type) + }` ).join(`\n`) code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), @@ -145,7 +147,10 @@ const Interface = createCodeGenerator<{ type: Grafaid.Schema.InterfaceType }>( }).join(`\n`) const implementorTypes = Grafaid.Schema.KindMap.getInterfaceImplementors(config.schema.kindMap, type) const onTypesRendered = implementorTypes.map(type => - H.outputFieldReference(`${Select.InlineFragment.typeConditionPRefix}${type.name}`, renderName(type)) + H.outputFieldReference( + `${DocumentBuilder.Select.InlineFragment.typeConditionPRefix}${type.name}`, + renderName(type), + ) ).join(`\n`) code() code(Tex.title2(type.name)) @@ -313,7 +318,7 @@ const renderFieldPropertyArguments = createCodeGenerator< ? `${lead} are required so you may omit this.` : `${lead} are required so you must include this.` const tsDoc = `Arguments for \`${field.name}\` field. ${tsDocMessageAboutRequired}` - code(Code.field(Select.Arguments.key, argFieldsRendered, { + code(Code.field(DocumentBuilder.Select.Arguments.key, argFieldsRendered, { optional: argsAnalysis.isAllNullable, tsDoc, })) @@ -334,7 +339,7 @@ const getInputFieldLike = (config: Config, inputFieldLike: Grafaid.Schema.Argume const getInputFieldKey = (inputFieldLike: Grafaid.Schema.Argument | Grafaid.Schema.InputField) => { return Grafaid.Schema.isEnumType(Grafaid.Schema.getNamedType(inputFieldLike.type)) - ? Select.Arguments.enumKeyPrefix + inputFieldLike.name + ? DocumentBuilder.Select.Arguments.enumKeyPrefix + inputFieldLike.name : inputFieldLike.name } diff --git a/src/requestPipeline/CustomScalars/decode.test.ts b/src/requestPipeline/CustomScalars/decode.test.ts index 6d4302f31..3d1be615f 100644 --- a/src/requestPipeline/CustomScalars/decode.test.ts +++ b/src/requestPipeline/CustomScalars/decode.test.ts @@ -3,8 +3,7 @@ import { DateScalar } from '../../../tests/_/fixtures/scalars.js' import { createResponse, test } from '../../../tests/_/helpers.js' import { db } from '../../../tests/_/schemas/db.js' import type { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' -import { Select } from '../../documentBuilder/Select/__.js' -import { SelectionSetGraphqlMapper } from '../../documentBuilder/SelectGraphQLMapper/__.js' +import { DocumentBuilder } from '../../documentBuilder/__.js' import { Grafaid } from '../../lib/grafaid/__.js' import type { Schema } from '../../types/Schema/__.js' @@ -36,8 +35,8 @@ const withGqlDocument: TestCaseWith = [ {}, async ([_, query, responseData, expectedData], { fetch, kitchenSinkHttp: kitchenSink }) => { fetch.mockResolvedValueOnce(createResponse({ data: responseData })) - const { document } = SelectionSetGraphqlMapper.toGraphQL( - Select.Document.createDocumentNormalizedFromQuerySelection(query as any), + const { document } = DocumentBuilder.SelectionSetGraphqlMapper.toGraphQL( + DocumentBuilder.Select.Document.createDocumentNormalizedFromQuerySelection(query as any), ) expect(await kitchenSink.scalar(DateScalar).gql(document).send()).toEqual(expectedData) }, @@ -48,8 +47,8 @@ const withGqlString: TestCaseWith = [ {}, async ([_, query, responseData, expectedData], { fetch, kitchenSinkHttp: kitchenSink }) => { fetch.mockResolvedValueOnce(createResponse({ data: responseData })) - const { document } = SelectionSetGraphqlMapper.toGraphQL( - Select.Document.normalizeOrThrow({ query: { foo: query as any } }), + const { document } = DocumentBuilder.SelectionSetGraphqlMapper.toGraphQL( + DocumentBuilder.Select.Document.normalizeOrThrow({ query: { foo: query as any } }), ) expect(await kitchenSink.scalar(DateScalar).gql(Grafaid.Document.print(document)).send()).toEqual(expectedData) }, diff --git a/src/requestPipeline/CustomScalars/encode.test.ts b/src/requestPipeline/CustomScalars/encode.test.ts index e0e1a7d5a..f1ed0adac 100644 --- a/src/requestPipeline/CustomScalars/encode.test.ts +++ b/src/requestPipeline/CustomScalars/encode.test.ts @@ -5,8 +5,7 @@ import { db } from '../../../tests/_/schemas/db.js' import type { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' import { schemaDrivenDataMap } from '../../../tests/_/schemas/kitchen-sink/graffle/modules/schema-driven-data-map.js' import { Spy } from '../../../tests/_/SpyExtension.js' -import { Select } from '../../documentBuilder/Select/__.js' -import { SelectionSetGraphqlMapper } from '../../documentBuilder/SelectGraphQLMapper/__.js' +import { DocumentBuilder } from '../../documentBuilder/__.js' import { Grafaid } from '../../lib/grafaid/__.js' import type { Schema } from '../../types/Schema/__.js' @@ -37,8 +36,8 @@ const testCases = test.for([ testCases(`%s`, async ([_, query, expectedVariables], { kitchenSink }) => { const g = kitchenSink.use(Spy()).scalar(DateScalar) - const { document, operationsVariables } = SelectionSetGraphqlMapper.toGraphQL( - Select.Document.createDocumentNormalizedFromQuerySelection(query as any), + const { document, operationsVariables } = DocumentBuilder.SelectionSetGraphqlMapper.toGraphQL( + DocumentBuilder.Select.Document.createDocumentNormalizedFromQuerySelection(query as any), { sddm: schemaDrivenDataMap, operationVariables: true, diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/methods-document.ts b/tests/_/schemas/kitchen-sink/graffle/modules/methods-document.ts index 4ee8f3b80..71df619ea 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/methods-document.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/methods-document.ts @@ -5,7 +5,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/methods-root.ts b/tests/_/schemas/kitchen-sink/graffle/modules/methods-root.ts index e1fe8add1..4e72aa938 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/methods-root.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/methods-root.ts @@ -1,4 +1,3 @@ -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -12,7 +11,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationQuery<$$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']>> + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + $$Utilities.AssertExtendsObject<$SelectionSet>, + $$Schema.Schema<$Context['scalars']> + > > > > @@ -36,7 +38,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ InputObjectNested: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { InputObjectNested: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'InputObjectNested' > > @@ -53,7 +58,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ InputObjectNestedNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { InputObjectNestedNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'InputObjectNestedNonNull' > > @@ -69,7 +77,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ abcEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { abcEnum: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'abcEnum' > > @@ -86,7 +97,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ argInputObjectCircular: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { argInputObjectCircular: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'argInputObjectCircular' > > @@ -100,7 +114,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ date: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { date: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'date' > > @@ -114,7 +131,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArg' > > @@ -128,7 +148,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgInputObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgInputObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgInputObject' > > @@ -142,7 +165,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgList' > > @@ -156,7 +182,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNull' > > @@ -170,7 +199,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNullList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNullList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNullList' > > @@ -187,7 +219,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateArgNonNullListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateArgNonNullListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateArgNonNullListNonNull' > > @@ -201,7 +236,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateInterface1: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateInterface1: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateInterface1' > > @@ -215,7 +253,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateList' > > @@ -229,7 +270,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateListList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateListList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateListList' > > @@ -243,7 +287,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateListNonNull' > > @@ -257,7 +304,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateNonNull' > > @@ -271,7 +321,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateObject1: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateObject1: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateObject1' > > @@ -285,7 +338,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ dateUnion: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { dateUnion: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'dateUnion' > > @@ -299,7 +355,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ error: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { error: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'error' > > @@ -313,7 +372,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -327,7 +389,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > @@ -341,7 +406,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interface: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interface: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interface' > > @@ -358,7 +426,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyChildA: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyChildA: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyChildA' > > @@ -375,7 +446,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyChildB: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyChildB: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyChildB' > > @@ -392,7 +466,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { interfaceHierarchyGrandparents: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -412,7 +486,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceHierarchyParents: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceHierarchyParents: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceHierarchyParents' > > @@ -426,7 +503,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceNonNull' > > @@ -440,7 +520,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ interfaceWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { interfaceWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'interfaceWithArgs' > > @@ -454,7 +537,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listInt: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listInt: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listInt' > > @@ -468,7 +554,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listIntNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listIntNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listIntNonNull' > > @@ -482,7 +571,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listListInt: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listListInt: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listListInt' > > @@ -496,7 +588,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ listListIntNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { listListIntNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'listListIntNonNull' > > @@ -510,7 +605,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ lowerCaseUnion: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { lowerCaseUnion: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'lowerCaseUnion' > > @@ -524,7 +622,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ object: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { object: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'object' > > @@ -538,7 +639,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectList: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectList: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectList' > > @@ -552,7 +656,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectListNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectListNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectListNonNull' > > @@ -566,7 +673,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectNested: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectNested: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectNested' > > @@ -580,7 +690,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectNonNull' > > @@ -594,7 +707,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ objectWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { objectWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'objectWithArgs' > > @@ -608,7 +724,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ result: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { result: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'result' > > @@ -622,7 +741,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ resultNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { resultNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'resultNonNull' > > @@ -636,7 +758,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ string: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { string: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'string' > > @@ -650,7 +775,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgEnum: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgEnum' > > @@ -667,7 +795,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgInputObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgInputObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgInputObject' > > @@ -684,7 +815,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { stringWithArgInputObjectEnum: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -704,7 +835,7 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery< + $$Utilities.DocumentBuilder.InferResult.OperationQuery< { stringWithArgInputObjectRequired: $SelectionSet }, $$Schema.Schema<$Context['scalars']> >, @@ -723,7 +854,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithArgs' > > @@ -737,7 +871,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithListArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithListArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithListArg' > > @@ -754,7 +891,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithListArgRequired: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithListArgRequired: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithListArgRequired' > > @@ -768,7 +908,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ stringWithRequiredArg: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { stringWithRequiredArg: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'stringWithRequiredArg' > > @@ -782,7 +925,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBar: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBar: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBar' > > @@ -796,7 +942,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBarNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBarNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBarNonNull' > > @@ -810,7 +959,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionFooBarWithArgs: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionFooBarWithArgs: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionFooBarWithArgs' > > @@ -824,7 +976,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionObject: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionObject: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionObject' > > @@ -838,7 +993,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ unionObjectNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { unionObjectNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'unionObjectNonNull' > > @@ -854,7 +1012,7 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationMutation< + $$Utilities.DocumentBuilder.InferResult.OperationMutation< $$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']> > @@ -881,7 +1039,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -895,7 +1056,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/select.ts b/tests/_/schemas/kitchen-sink/graffle/modules/select.ts index 64c215c55..d77331b62 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/select.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/select.ts @@ -1,5 +1,5 @@ import type { OperationTypeNode } from 'graphql' -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Data from './data.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -42,165 +42,184 @@ export namespace Select { // Root // -------------------------------------------------------------------------------------------------- // - export type Query<$SelectionSet extends $$SelectionSets.Query> = InferResult.Operation< + export type Query<$SelectionSet extends $$SelectionSets.Query> = $$Utilities.DocumentBuilder.InferResult.Operation< $SelectionSet, $$Schema.Schema, OperationTypeNode.QUERY > - export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = InferResult.Operation< - $SelectionSet, - $$Schema.Schema, - OperationTypeNode.MUTATION - > + export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = + $$Utilities.DocumentBuilder.InferResult.Operation<$SelectionSet, $$Schema.Schema, OperationTypeNode.MUTATION> // OutputObject // -------------------------------------------------------------------------------------------------- // - export type Bar<$SelectionSet extends $$SelectionSets.Bar> = InferResult.OutputObjectLike< + export type Bar<$SelectionSet extends $$SelectionSets.Bar> = $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Bar'] > - export type DateObject1<$SelectionSet extends $$SelectionSets.DateObject1> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateObject1'] - > - export type DateObject2<$SelectionSet extends $$SelectionSets.DateObject2> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateObject2'] - > - export type ErrorOne<$SelectionSet extends $$SelectionSets.ErrorOne> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ErrorOne'] - > - export type ErrorTwo<$SelectionSet extends $$SelectionSets.ErrorTwo> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ErrorTwo'] - > - export type Foo<$SelectionSet extends $$SelectionSets.Foo> = InferResult.OutputObjectLike< + export type DateObject1<$SelectionSet extends $$SelectionSets.DateObject1> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateObject1'] + > + export type DateObject2<$SelectionSet extends $$SelectionSets.DateObject2> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateObject2'] + > + export type ErrorOne<$SelectionSet extends $$SelectionSets.ErrorOne> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ErrorOne'] + > + export type ErrorTwo<$SelectionSet extends $$SelectionSets.ErrorTwo> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ErrorTwo'] + > + export type Foo<$SelectionSet extends $$SelectionSets.Foo> = $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Foo'] > - export type Object1<$SelectionSet extends $$SelectionSets.Object1> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['Object1'] - > + export type Object1<$SelectionSet extends $$SelectionSets.Object1> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Object1'] + > export type Object1ImplementingInterface<$SelectionSet extends $$SelectionSets.Object1ImplementingInterface> = - InferResult.OutputObjectLike< + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Object1ImplementingInterface'] > export type Object2ImplementingInterface<$SelectionSet extends $$SelectionSets.Object2ImplementingInterface> = - InferResult.OutputObjectLike< + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Object2ImplementingInterface'] > - export type ObjectChildA<$SelectionSet extends $$SelectionSets.ObjectChildA> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectChildA'] - > - export type ObjectChildB<$SelectionSet extends $$SelectionSets.ObjectChildB> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectChildB'] - > - export type ObjectGrandparent<$SelectionSet extends $$SelectionSets.ObjectGrandparent> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectGrandparent'] - > - export type ObjectNested<$SelectionSet extends $$SelectionSets.ObjectNested> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectNested'] - > - export type ObjectParent<$SelectionSet extends $$SelectionSets.ObjectParent> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectParent'] - > - export type ObjectUnion<$SelectionSet extends $$SelectionSets.ObjectUnion> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['ObjectUnion'] - > - export type lowerCaseObject<$SelectionSet extends $$SelectionSets.lowerCaseObject> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseObject'] - > - export type lowerCaseObject2<$SelectionSet extends $$SelectionSets.lowerCaseObject2> = InferResult.OutputObjectLike< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseObject2'] - > + export type ObjectChildA<$SelectionSet extends $$SelectionSets.ObjectChildA> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectChildA'] + > + export type ObjectChildB<$SelectionSet extends $$SelectionSets.ObjectChildB> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectChildB'] + > + export type ObjectGrandparent<$SelectionSet extends $$SelectionSets.ObjectGrandparent> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectGrandparent'] + > + export type ObjectNested<$SelectionSet extends $$SelectionSets.ObjectNested> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectNested'] + > + export type ObjectParent<$SelectionSet extends $$SelectionSets.ObjectParent> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectParent'] + > + export type ObjectUnion<$SelectionSet extends $$SelectionSets.ObjectUnion> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['ObjectUnion'] + > + export type lowerCaseObject<$SelectionSet extends $$SelectionSets.lowerCaseObject> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseObject'] + > + export type lowerCaseObject2<$SelectionSet extends $$SelectionSets.lowerCaseObject2> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseObject2'] + > // Union // -------------------------------------------------------------------------------------------------- // - export type DateUnion<$SelectionSet extends $$SelectionSets.DateUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateUnion'] - > - export type FooBarUnion<$SelectionSet extends $$SelectionSets.FooBarUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['FooBarUnion'] - > - export type Result<$SelectionSet extends $$SelectionSets.Result> = InferResult.Union< + export type DateUnion<$SelectionSet extends $$SelectionSets.DateUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateUnion'] + > + export type FooBarUnion<$SelectionSet extends $$SelectionSets.FooBarUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['FooBarUnion'] + > + export type Result<$SelectionSet extends $$SelectionSets.Result> = $$Utilities.DocumentBuilder.InferResult.Union< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Result'] > - export type lowerCaseUnion<$SelectionSet extends $$SelectionSets.lowerCaseUnion> = InferResult.Union< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['lowerCaseUnion'] - > + export type lowerCaseUnion<$SelectionSet extends $$SelectionSets.lowerCaseUnion> = + $$Utilities.DocumentBuilder.InferResult.Union< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['lowerCaseUnion'] + > // Interface // -------------------------------------------------------------------------------------------------- // - export type DateInterface1<$SelectionSet extends $$SelectionSets.DateInterface1> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['DateInterface1'] - > - export type Error<$SelectionSet extends $$SelectionSets.Error> = InferResult.Interface< + export type DateInterface1<$SelectionSet extends $$SelectionSets.DateInterface1> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['DateInterface1'] + > + export type Error<$SelectionSet extends $$SelectionSets.Error> = $$Utilities.DocumentBuilder.InferResult.Interface< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Error'] > - export type Interface<$SelectionSet extends $$SelectionSets.Interface> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['Interface'] - > - export type InterfaceChildA<$SelectionSet extends $$SelectionSets.InterfaceChildA> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceChildA'] - > - export type InterfaceChildB<$SelectionSet extends $$SelectionSets.InterfaceChildB> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceChildB'] - > - export type InterfaceGrandparent<$SelectionSet extends $$SelectionSets.InterfaceGrandparent> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceGrandparent'] - > - export type InterfaceParent<$SelectionSet extends $$SelectionSets.InterfaceParent> = InferResult.Interface< - $SelectionSet, - $$Schema.Schema, - $$Schema.Schema['allTypes']['InterfaceParent'] - > + export type Interface<$SelectionSet extends $$SelectionSets.Interface> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Interface'] + > + export type InterfaceChildA<$SelectionSet extends $$SelectionSets.InterfaceChildA> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceChildA'] + > + export type InterfaceChildB<$SelectionSet extends $$SelectionSets.InterfaceChildB> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceChildB'] + > + export type InterfaceGrandparent<$SelectionSet extends $$SelectionSets.InterfaceGrandparent> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceGrandparent'] + > + export type InterfaceParent<$SelectionSet extends $$SelectionSets.InterfaceParent> = + $$Utilities.DocumentBuilder.InferResult.Interface< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['InterfaceParent'] + > } diff --git a/tests/_/schemas/mutation-only/graffle/modules/methods-document.ts b/tests/_/schemas/mutation-only/graffle/modules/methods-document.ts index 4ee8f3b80..71df619ea 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/methods-document.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/methods-document.ts @@ -5,7 +5,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/tests/_/schemas/mutation-only/graffle/modules/methods-root.ts b/tests/_/schemas/mutation-only/graffle/modules/methods-root.ts index 938bf74e5..8729a2cc0 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/methods-root.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/methods-root.ts @@ -1,4 +1,3 @@ -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -12,7 +11,7 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationMutation< + $$Utilities.DocumentBuilder.InferResult.OperationMutation< $$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']> > @@ -39,7 +38,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -53,7 +55,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > diff --git a/tests/_/schemas/mutation-only/graffle/modules/select.ts b/tests/_/schemas/mutation-only/graffle/modules/select.ts index a5ccc9e37..77c70aeb0 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/select.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/select.ts @@ -1,5 +1,5 @@ import type { OperationTypeNode } from 'graphql' -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Data from './data.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -42,11 +42,8 @@ export namespace Select { // Root // -------------------------------------------------------------------------------------------------- // - export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = InferResult.Operation< - $SelectionSet, - $$Schema.Schema, - OperationTypeNode.MUTATION - > + export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = + $$Utilities.DocumentBuilder.InferResult.Operation<$SelectionSet, $$Schema.Schema, OperationTypeNode.MUTATION> // OutputObject // -------------------------------------------------------------------------------------------------- // diff --git a/tests/_/schemas/pokemon/graffle/modules/methods-document.ts b/tests/_/schemas/pokemon/graffle/modules/methods-document.ts index 4ee8f3b80..71df619ea 100644 --- a/tests/_/schemas/pokemon/graffle/modules/methods-document.ts +++ b/tests/_/schemas/pokemon/graffle/modules/methods-document.ts @@ -5,7 +5,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/tests/_/schemas/pokemon/graffle/modules/methods-root.ts b/tests/_/schemas/pokemon/graffle/modules/methods-root.ts index 84fb1c73d..819ea380e 100644 --- a/tests/_/schemas/pokemon/graffle/modules/methods-root.ts +++ b/tests/_/schemas/pokemon/graffle/modules/methods-root.ts @@ -1,4 +1,3 @@ -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -12,7 +11,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationQuery<$$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']>> + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + $$Utilities.AssertExtendsObject<$SelectionSet>, + $$Schema.Schema<$Context['scalars']> + > > > > @@ -36,7 +38,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ battles: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { battles: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'battles' > > @@ -50,7 +55,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ beings: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { beings: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'beings' > > @@ -64,7 +72,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ pokemonByName: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { pokemonByName: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'pokemonByName' > > @@ -78,7 +89,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ pokemons: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { pokemons: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'pokemons' > > @@ -92,7 +106,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ trainerByName: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { trainerByName: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'trainerByName' > > @@ -106,7 +123,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ trainers: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { trainers: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'trainers' > > @@ -122,7 +142,7 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationMutation< + $$Utilities.DocumentBuilder.InferResult.OperationMutation< $$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']> > @@ -149,7 +169,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ addPokemon: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { addPokemon: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'addPokemon' > > diff --git a/tests/_/schemas/pokemon/graffle/modules/select.ts b/tests/_/schemas/pokemon/graffle/modules/select.ts index 067d8ad92..883f20ca8 100644 --- a/tests/_/schemas/pokemon/graffle/modules/select.ts +++ b/tests/_/schemas/pokemon/graffle/modules/select.ts @@ -1,5 +1,5 @@ import type { OperationTypeNode } from 'graphql' -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Data from './data.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -42,57 +42,68 @@ export namespace Select { // Root // -------------------------------------------------------------------------------------------------- // - export type Query<$SelectionSet extends $$SelectionSets.Query> = InferResult.Operation< + export type Query<$SelectionSet extends $$SelectionSets.Query> = $$Utilities.DocumentBuilder.InferResult.Operation< $SelectionSet, $$Schema.Schema, OperationTypeNode.QUERY > - export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = InferResult.Operation< - $SelectionSet, - $$Schema.Schema, - OperationTypeNode.MUTATION - > + export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = + $$Utilities.DocumentBuilder.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 BattleRoyale<$SelectionSet extends $$SelectionSets.BattleRoyale> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['BattleRoyale'] + > + export type BattleTrainer<$SelectionSet extends $$SelectionSets.BattleTrainer> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['BattleTrainer'] + > + export type BattleWild<$SelectionSet extends $$SelectionSets.BattleWild> = + $$Utilities.DocumentBuilder.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']> + $$Utilities.DocumentBuilder.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'] - > + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['CombatantSinglePokemon'] + > + export type Patron<$SelectionSet extends $$SelectionSets.Patron> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Patron'] + > + export type Pokemon<$SelectionSet extends $$SelectionSets.Pokemon> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Pokemon'] + > + export type Trainer<$SelectionSet extends $$SelectionSets.Trainer> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema['allTypes']['Trainer'] + > // Union // -------------------------------------------------------------------------------------------------- // - export type Battle<$SelectionSet extends $$SelectionSets.Battle> = InferResult.Union< + export type Battle<$SelectionSet extends $$SelectionSets.Battle> = $$Utilities.DocumentBuilder.InferResult.Union< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Battle'] @@ -100,7 +111,7 @@ export namespace Select { // Interface // -------------------------------------------------------------------------------------------------- // - export type Being<$SelectionSet extends $$SelectionSets.Being> = InferResult.Interface< + export type Being<$SelectionSet extends $$SelectionSets.Being> = $$Utilities.DocumentBuilder.InferResult.Interface< $SelectionSet, $$Schema.Schema, $$Schema.Schema['allTypes']['Being'] diff --git a/tests/_/schemas/query-only/graffle/modules/methods-document.ts b/tests/_/schemas/query-only/graffle/modules/methods-document.ts index 4ee8f3b80..71df619ea 100644 --- a/tests/_/schemas/query-only/graffle/modules/methods-document.ts +++ b/tests/_/schemas/query-only/graffle/modules/methods-document.ts @@ -5,7 +5,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/tests/_/schemas/query-only/graffle/modules/methods-root.ts b/tests/_/schemas/query-only/graffle/modules/methods-root.ts index ebf5db684..2b3b2ab14 100644 --- a/tests/_/schemas/query-only/graffle/modules/methods-root.ts +++ b/tests/_/schemas/query-only/graffle/modules/methods-root.ts @@ -1,4 +1,3 @@ -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -12,7 +11,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationQuery<$$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context['scalars']>> + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + $$Utilities.AssertExtendsObject<$SelectionSet>, + $$Schema.Schema<$Context['scalars']> + > > > > @@ -36,7 +38,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ id: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { id: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'id' > > @@ -50,7 +55,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ idNonNull: $SelectionSet }, $$Schema.Schema<$Context['scalars']>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { idNonNull: $SelectionSet }, + $$Schema.Schema<$Context['scalars']> + >, 'idNonNull' > > diff --git a/tests/_/schemas/query-only/graffle/modules/select.ts b/tests/_/schemas/query-only/graffle/modules/select.ts index 041366980..f4ea46dd4 100644 --- a/tests/_/schemas/query-only/graffle/modules/select.ts +++ b/tests/_/schemas/query-only/graffle/modules/select.ts @@ -1,5 +1,5 @@ import type { OperationTypeNode } from 'graphql' -import type { InferResult } from '../../../../../../src/entrypoints/schema.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $$Data from './data.js' import * as $$Schema from './schema.js' import * as $$SelectionSets from './selection-sets.js' @@ -42,7 +42,7 @@ export namespace Select { // Root // -------------------------------------------------------------------------------------------------- // - export type Query<$SelectionSet extends $$SelectionSets.Query> = InferResult.Operation< + export type Query<$SelectionSet extends $$SelectionSets.Query> = $$Utilities.DocumentBuilder.InferResult.Operation< $SelectionSet, $$Schema.Schema, OperationTypeNode.QUERY diff --git a/website/graffle/modules/methods-document.ts b/website/graffle/modules/methods-document.ts index a4884aab1..57b012c0a 100644 --- a/website/graffle/modules/methods-document.ts +++ b/website/graffle/modules/methods-document.ts @@ -5,7 +5,7 @@ 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< + ): $$Utilities.DocumentBuilder.DocumentRunner< $Context, $$Schema.Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as diff --git a/website/graffle/modules/methods-root.ts b/website/graffle/modules/methods-root.ts index e8ef24ed0..5d4ff82ac 100644 --- a/website/graffle/modules/methods-root.ts +++ b/website/graffle/modules/methods-root.ts @@ -1,4 +1,3 @@ -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"; @@ -12,7 +11,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationQuery<$$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context["scalars"]>> + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + $$Utilities.AssertExtendsObject<$SelectionSet>, + $$Schema.Schema<$Context["scalars"]> + > > > >; @@ -36,7 +38,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ battles: $SelectionSet }, $$Schema.Schema<$Context["scalars"]>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { battles: $SelectionSet }, + $$Schema.Schema<$Context["scalars"]> + >, "battles" > > @@ -50,7 +55,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ beings: $SelectionSet }, $$Schema.Schema<$Context["scalars"]>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { beings: $SelectionSet }, + $$Schema.Schema<$Context["scalars"]> + >, "beings" > > @@ -64,7 +72,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ pokemonByName: $SelectionSet }, $$Schema.Schema<$Context["scalars"]>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { pokemonByName: $SelectionSet }, + $$Schema.Schema<$Context["scalars"]> + >, "pokemonByName" > > @@ -78,7 +89,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ pokemons: $SelectionSet }, $$Schema.Schema<$Context["scalars"]>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { pokemons: $SelectionSet }, + $$Schema.Schema<$Context["scalars"]> + >, "pokemons" > > @@ -92,7 +106,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ trainerByName: $SelectionSet }, $$Schema.Schema<$Context["scalars"]>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { trainerByName: $SelectionSet }, + $$Schema.Schema<$Context["scalars"]> + >, "trainerByName" > > @@ -106,7 +123,10 @@ export interface QueryMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationQuery<{ trainers: $SelectionSet }, $$Schema.Schema<$Context["scalars"]>>, + $$Utilities.DocumentBuilder.InferResult.OperationQuery< + { trainers: $SelectionSet }, + $$Schema.Schema<$Context["scalars"]> + >, "trainers" > > @@ -122,7 +142,7 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutput< $Context, - InferResult.OperationMutation< + $$Utilities.DocumentBuilder.InferResult.OperationMutation< $$Utilities.AssertExtendsObject<$SelectionSet>, $$Schema.Schema<$Context["scalars"]> > @@ -149,7 +169,10 @@ export interface MutationMethods<$Context extends $$Utilities.Context> { & (null | {}) & $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.OperationMutation<{ addPokemon: $SelectionSet }, $$Schema.Schema<$Context["scalars"]>>, + $$Utilities.DocumentBuilder.InferResult.OperationMutation< + { addPokemon: $SelectionSet }, + $$Schema.Schema<$Context["scalars"]> + >, "addPokemon" > > diff --git a/website/graffle/modules/select.ts b/website/graffle/modules/select.ts index 6cbdc38ec..b7c668174 100644 --- a/website/graffle/modules/select.ts +++ b/website/graffle/modules/select.ts @@ -1,4 +1,4 @@ -import type { InferResult } from "graffle/schema"; +import type * as $$Utilities from "graffle/utilities-for-generated"; import type { OperationTypeNode } from "graphql"; import * as $$Data from "./data.js"; import * as $$Schema from "./schema.js"; @@ -42,57 +42,68 @@ export namespace Select { // Root // -------------------------------------------------------------------------------------------------- // - export type Query<$SelectionSet extends $$SelectionSets.Query> = InferResult.Operation< + export type Query<$SelectionSet extends $$SelectionSets.Query> = $$Utilities.DocumentBuilder.InferResult.Operation< $SelectionSet, $$Schema.Schema, OperationTypeNode.QUERY >; - export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = InferResult.Operation< - $SelectionSet, - $$Schema.Schema, - OperationTypeNode.MUTATION - >; + export type Mutation<$SelectionSet extends $$SelectionSets.Mutation> = + $$Utilities.DocumentBuilder.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 BattleRoyale<$SelectionSet extends $$SelectionSets.BattleRoyale> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema["allTypes"]["BattleRoyale"] + >; + export type BattleTrainer<$SelectionSet extends $$SelectionSets.BattleTrainer> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema["allTypes"]["BattleTrainer"] + >; + export type BattleWild<$SelectionSet extends $$SelectionSets.BattleWild> = + $$Utilities.DocumentBuilder.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"]>; + $$Utilities.DocumentBuilder.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"] - >; + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema["allTypes"]["CombatantSinglePokemon"] + >; + export type Patron<$SelectionSet extends $$SelectionSets.Patron> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema["allTypes"]["Patron"] + >; + export type Pokemon<$SelectionSet extends $$SelectionSets.Pokemon> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema["allTypes"]["Pokemon"] + >; + export type Trainer<$SelectionSet extends $$SelectionSets.Trainer> = + $$Utilities.DocumentBuilder.InferResult.OutputObjectLike< + $SelectionSet, + $$Schema.Schema, + $$Schema.Schema["allTypes"]["Trainer"] + >; // Union // -------------------------------------------------------------------------------------------------- // - export type Battle<$SelectionSet extends $$SelectionSets.Battle> = InferResult.Union< + export type Battle<$SelectionSet extends $$SelectionSets.Battle> = $$Utilities.DocumentBuilder.InferResult.Union< $SelectionSet, $$Schema.Schema, $$Schema.Schema["allTypes"]["Battle"] @@ -100,7 +111,7 @@ export namespace Select { // Interface // -------------------------------------------------------------------------------------------------- // - export type Being<$SelectionSet extends $$SelectionSets.Being> = InferResult.Interface< + export type Being<$SelectionSet extends $$SelectionSets.Being> = $$Utilities.DocumentBuilder.InferResult.Interface< $SelectionSet, $$Schema.Schema, $$Schema.Schema["allTypes"]["Being"]