From 4fd8f681aa0382b32bc0f9e0d83c98687b8b4c30 Mon Sep 17 00:00:00 2001 From: Jason Kuhrt Date: Mon, 21 Oct 2024 13:56:50 -0400 Subject: [PATCH] refactor(generator): kind map clean up --- src/extensions/SchemaErrors/generator.ts | 2 +- .../tests/fixture/graffle/modules/Global.ts | 2 +- .../fixture/graffle/modules/MethodsSelect.ts | 2 +- .../tests/fixture/graffle/modules/Schema.ts | 274 ++++----- .../graffle/modules/SchemaDrivenDataMap.ts | 76 +-- .../tests/fixture/graffle/modules/Select.ts | 4 +- .../fixture/graffle/modules/SelectionSets.ts | 544 +++++++++--------- src/generator/config/config.ts | 2 +- src/generator/generators/MethodsRoot.ts | 4 +- src/generator/generators/MethodsSelect.ts | 25 +- src/generator/generators/Scalar.ts | 6 +- src/generator/generators/Schema.ts | 42 +- .../generators/SchemaDrivenDataMap.ts | 72 +-- src/generator/generators/Select.ts | 11 +- src/generator/generators/SelectionSets.ts | 65 +-- src/generator/generators/global.ts | 4 +- src/generator/helpers/identifiers.ts | 2 +- src/generator/helpers/render.ts | 19 +- src/generator/helpers/types.ts | 3 + src/lib/grafaid/graphql.ts | 62 +- .../schema/{kindMap.ts => KindMap/_.ts} | 74 +-- src/lib/grafaid/schema/KindMap/__.ts | 21 + src/lib/grafaid/schema/customScalars.ts | 10 +- src/lib/grafaid/schema/schema.ts | 16 +- src/types/Schema/nodes/OutputField.ts | 6 +- src/types/Schema/nodes/OutputObject.ts | 4 +- src/types/SchemaDrivenDataMap/InlineType.ts | 13 + .../SchemaDrivenDataMap.ts | 17 +- .../kitchen-sink/graffle/modules/Global.ts | 2 +- .../graffle/modules/MethodsSelect.ts | 2 +- .../kitchen-sink/graffle/modules/Schema.ts | 274 ++++----- .../graffle/modules/SchemaDrivenDataMap.ts | 76 +-- .../kitchen-sink/graffle/modules/Select.ts | 4 +- .../graffle/modules/SelectionSets.ts | 544 +++++++++--------- .../graffle/modules/MethodsSelect.ts | 48 ++ .../mutation-only/graffle/modules/Schema.ts | 10 +- .../graffle/modules/SchemaDrivenDataMap.ts | 34 +- .../mutation-only/graffle/modules/Select.ts | 4 +- .../graffle/modules/SelectionSets.ts | 8 +- .../pokemon/graffle/modules/MethodsSelect.ts | 2 +- .../schemas/pokemon/graffle/modules/Schema.ts | 184 +++--- .../graffle/modules/SchemaDrivenDataMap.ts | 58 +- .../schemas/pokemon/graffle/modules/Select.ts | 4 +- .../pokemon/graffle/modules/SelectionSets.ts | 298 +++++----- .../graffle/modules/MethodsSelect.ts | 48 ++ .../query-only/graffle/modules/Schema.ts | 10 +- .../graffle/modules/SchemaDrivenDataMap.ts | 34 +- .../query-only/graffle/modules/Select.ts | 4 +- .../graffle/modules/SelectionSets.ts | 8 +- 49 files changed, 1567 insertions(+), 1471 deletions(-) create mode 100644 src/generator/helpers/types.ts rename src/lib/grafaid/schema/{kindMap.ts => KindMap/_.ts} (51%) create mode 100644 src/lib/grafaid/schema/KindMap/__.ts create mode 100644 src/types/SchemaDrivenDataMap/InlineType.ts diff --git a/src/extensions/SchemaErrors/generator.ts b/src/extensions/SchemaErrors/generator.ts index 7b152db05..fb285b26b 100644 --- a/src/extensions/SchemaErrors/generator.ts +++ b/src/extensions/SchemaErrors/generator.ts @@ -57,5 +57,5 @@ export const SchemaErrors = (input?: Input) => { // todo memoize const getErrorObjects = (config: Config, genConfig: GeneratorConfig) => { - return Object.values(genConfig.schema.kindMap.GraphQLObjectType).filter(config.isErrorType) + return Object.values(genConfig.schema.kindMap.OutputObject).filter(config.isErrorType) } diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Global.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Global.ts index 2659a6fcf..f1c810e02 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Global.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Global.ts @@ -2,7 +2,7 @@ import type * as Data from './Data.js' import type * as MethodsDocument from './MethodsDocument.js' import type * as MethodsRoot from './MethodsRoot.js' import type * as MethodsSelect from './MethodsSelect.js' -import type * as Scalar from './Scalar.js' +import type * as $Scalar from './Scalar.js' import type { Schema } from './Schema.js' declare global { diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts index 1944a1a06..41c7532a2 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts @@ -73,7 +73,7 @@ export interface Query { // // // ================================================================================================== -// Object +// OutputObject // ================================================================================================== // // diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts index 4a1ff7f26..ae0c26345 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts @@ -21,19 +21,19 @@ export namespace Schema { // export type Mutation = $.StandardTypes.Mutation<{ - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - idNonNull: $.Field<'idNonNull', $Scalar.ID, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + idNonNull: $.OutputField<'idNonNull', $Scalar.ID, null> }> export type Query = $.StandardTypes.Query<{ - InputObjectNested: $.Field< + InputObjectNested: $.OutputField< 'InputObjectNested', $.Nullable<$Scalar.ID>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - InputObjectNestedNonNull: $.Field< + InputObjectNestedNonNull: $.OutputField< 'InputObjectNestedNonNull', $.Nullable<$Scalar.ID>, $.Args<{ @@ -43,93 +43,93 @@ export namespace Schema { /** * Query enum field documentation. */ - abcEnum: $.Field<'abcEnum', $.Nullable, null> - argInputObjectCircular: $.Field< + abcEnum: $.OutputField<'abcEnum', $.Nullable, null> + argInputObjectCircular: $.OutputField< 'argInputObjectCircular', $.Nullable<$Scalar.String>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - date: $.Field<'date', $.Nullable<$Scalar.Date>, null> - dateArg: $.Field< + date: $.OutputField<'date', $.Nullable<$Scalar.Date>, null> + dateArg: $.OutputField< 'dateArg', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.Nullable<$Scalar.Date>> }, true> > - dateArgInputObject: $.Field< + dateArgInputObject: $.OutputField< 'dateArgInputObject', $.Nullable<$Scalar.Date>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - dateArgList: $.Field< + dateArgList: $.OutputField< 'dateArgList', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.Nullable<$.List<$Scalar.Date>>> }, true> > - dateArgNonNull: $.Field< + dateArgNonNull: $.OutputField< 'dateArgNonNull', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$Scalar.Date> }, false> > - dateArgNonNullList: $.Field< + dateArgNonNullList: $.OutputField< 'dateArgNonNullList', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.List<$.Nullable<$Scalar.Date>>> }, false> > - dateArgNonNullListNonNull: $.Field< + dateArgNonNullListNonNull: $.OutputField< 'dateArgNonNullListNonNull', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.List<$Scalar.Date>> }, false> > - dateInterface1: $.Field<'dateInterface1', $.Nullable, null> - dateList: $.Field<'dateList', $.Nullable<$.List<$Scalar.Date>>, null> - dateListList: $.Field<'dateListList', $.Nullable<$.List<$.List<$Scalar.Date>>>, null> - dateListNonNull: $.Field<'dateListNonNull', $.List<$Scalar.Date>, null> - dateNonNull: $.Field<'dateNonNull', $Scalar.Date, null> - dateObject1: $.Field<'dateObject1', $.Nullable, null> - dateUnion: $.Field<'dateUnion', $.Nullable, null> - error: $.Field< + dateInterface1: $.OutputField<'dateInterface1', $.Nullable, null> + dateList: $.OutputField<'dateList', $.Nullable<$.List<$Scalar.Date>>, null> + dateListList: $.OutputField<'dateListList', $.Nullable<$.List<$.List<$Scalar.Date>>>, null> + dateListNonNull: $.OutputField<'dateListNonNull', $.List<$Scalar.Date>, null> + dateNonNull: $.OutputField<'dateNonNull', $Scalar.Date, null> + dateObject1: $.OutputField<'dateObject1', $.Nullable, null> + dateUnion: $.OutputField<'dateUnion', $.Nullable, null> + error: $.OutputField< 'error', $.Nullable<$Scalar.String>, $.Args<{ case: $.InputField<$.Nullable<$Scalar.String>> }, true> > - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - idNonNull: $.Field<'idNonNull', $Scalar.ID, null> - interface: $.Field<'interface', $.Nullable, null> - interfaceNonNull: $.Field<'interfaceNonNull', Interface, null> - interfaceWithArgs: $.Field< + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + idNonNull: $.OutputField<'idNonNull', $Scalar.ID, null> + interface: $.OutputField<'interface', $.Nullable, null> + interfaceNonNull: $.OutputField<'interfaceNonNull', Interface, null> + interfaceWithArgs: $.OutputField< 'interfaceWithArgs', $.Nullable, $.Args<{ id: $.InputField<$Scalar.ID> }, false> > - listInt: $.Field<'listInt', $.Nullable<$.List<$.Nullable<$Scalar.Int>>>, null> - listIntNonNull: $.Field<'listIntNonNull', $.List<$Scalar.Int>, null> - listListInt: $.Field<'listListInt', $.Nullable<$.List<$.Nullable<$.List<$.Nullable<$Scalar.Int>>>>>, null> - listListIntNonNull: $.Field<'listListIntNonNull', $.List<$.List<$Scalar.Int>>, null> - lowerCaseUnion: $.Field<'lowerCaseUnion', $.Nullable, null> - object: $.Field<'object', $.Nullable, null> - objectList: $.Field<'objectList', $.Nullable<$.List>, null> - objectListNonNull: $.Field<'objectListNonNull', $.List, null> - objectNested: $.Field<'objectNested', $.Nullable, null> - objectNonNull: $.Field<'objectNonNull', Object1, null> - objectWithArgs: $.Field< + listInt: $.OutputField<'listInt', $.Nullable<$.List<$.Nullable<$Scalar.Int>>>, null> + listIntNonNull: $.OutputField<'listIntNonNull', $.List<$Scalar.Int>, null> + listListInt: $.OutputField<'listListInt', $.Nullable<$.List<$.Nullable<$.List<$.Nullable<$Scalar.Int>>>>>, null> + listListIntNonNull: $.OutputField<'listListIntNonNull', $.List<$.List<$Scalar.Int>>, null> + lowerCaseUnion: $.OutputField<'lowerCaseUnion', $.Nullable, null> + object: $.OutputField<'object', $.Nullable, null> + objectList: $.OutputField<'objectList', $.Nullable<$.List>, null> + objectListNonNull: $.OutputField<'objectListNonNull', $.List, null> + objectNested: $.OutputField<'objectNested', $.Nullable, null> + objectNonNull: $.OutputField<'objectNonNull', Object1, null> + objectWithArgs: $.OutputField< 'objectWithArgs', $.Nullable, $.Args<{ @@ -140,36 +140,36 @@ export namespace Schema { string: $.InputField<$.Nullable<$Scalar.String>> }, true> > - result: $.Field< + result: $.OutputField< 'result', $.Nullable, $.Args<{ case: $.InputField }, false> > - resultNonNull: $.Field< + resultNonNull: $.OutputField< 'resultNonNull', Result, $.Args<{ case: $.InputField<$.Nullable> }, true> > - string: $.Field<'string', $.Nullable<$Scalar.String>, null> - stringWithArgEnum: $.Field< + string: $.OutputField<'string', $.Nullable<$Scalar.String>, null> + stringWithArgEnum: $.OutputField< 'stringWithArgEnum', $.Nullable<$Scalar.String>, $.Args<{ ABCEnum: $.InputField<$.Nullable> }, true> > - stringWithArgInputObject: $.Field< + stringWithArgInputObject: $.OutputField< 'stringWithArgInputObject', $.Nullable<$Scalar.String>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - stringWithArgInputObjectRequired: $.Field< + stringWithArgInputObjectRequired: $.OutputField< 'stringWithArgInputObjectRequired', $.Nullable<$Scalar.String>, $.Args<{ @@ -179,7 +179,7 @@ export namespace Schema { /** * The given arguments are reflected back as a JSON string. */ - stringWithArgs: $.Field< + stringWithArgs: $.OutputField< 'stringWithArgs', $.Nullable<$Scalar.String>, $.Args<{ @@ -190,38 +190,38 @@ export namespace Schema { string: $.InputField<$.Nullable<$Scalar.String>> }, true> > - stringWithListArg: $.Field< + stringWithListArg: $.OutputField< 'stringWithListArg', $.Nullable<$Scalar.String>, $.Args<{ ints: $.InputField<$.Nullable<$.List<$.Nullable<$Scalar.Int>>>> }, true> > - stringWithListArgRequired: $.Field< + stringWithListArgRequired: $.OutputField< 'stringWithListArgRequired', $.Nullable<$Scalar.String>, $.Args<{ ints: $.InputField<$.List<$Scalar.Int>> }, false> > - stringWithRequiredArg: $.Field< + stringWithRequiredArg: $.OutputField< 'stringWithRequiredArg', $.Nullable<$Scalar.String>, $.Args<{ string: $.InputField<$Scalar.String> }, false> > - unionFooBar: $.Field<'unionFooBar', $.Nullable, null> - unionFooBarNonNull: $.Field<'unionFooBarNonNull', FooBarUnion, null> - unionFooBarWithArgs: $.Field< + unionFooBar: $.OutputField<'unionFooBar', $.Nullable, null> + unionFooBarNonNull: $.OutputField<'unionFooBarNonNull', FooBarUnion, null> + unionFooBarWithArgs: $.OutputField< 'unionFooBarWithArgs', $.Nullable, $.Args<{ id: $.InputField<$.Nullable<$Scalar.ID>> }, true> > - unionObject: $.Field<'unionObject', $.Nullable, null> - unionObjectNonNull: $.Field<'unionObjectNonNull', ObjectUnion, null> + unionObject: $.OutputField<'unionObject', $.Nullable, null> + unionObjectNonNull: $.OutputField<'unionObjectNonNull', ObjectUnion, null> }> // @@ -231,7 +231,7 @@ export namespace Schema { // // // ================================================================================================== - // Enum + // OutputObject // ================================================================================================== // // @@ -240,17 +240,75 @@ export namespace Schema { // // + export type Bar = $.OutputObject<'Bar', { + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + }> + + export type DateObject1 = $.OutputObject<'DateObject1', { + date1: $.OutputField<'date1', $.Nullable<$Scalar.Date>, null> + }> + + export type DateObject2 = $.OutputObject<'DateObject2', { + date2: $.OutputField<'date2', $.Nullable<$Scalar.Date>, null> + }> + + export type ErrorOne = $.OutputObject<'ErrorOne', { + infoId: $.OutputField<'infoId', $.Nullable<$Scalar.ID>, null> + message: $.OutputField<'message', $Scalar.String, null> + }> + + export type ErrorTwo = $.OutputObject<'ErrorTwo', { + infoInt: $.OutputField<'infoInt', $.Nullable<$Scalar.Int>, null> + message: $.OutputField<'message', $Scalar.String, null> + }> + /** - * Enum documentation. - * - * Members - * "A" - (DEPRECATED: Enum value A is deprecated.) - * "B" - Enum B member documentation. - * "C" - (DEPRECATED: Enum value C is deprecated.) + * Object documentation. */ - export type ABCEnum = $.Enum<'ABCEnum', ['A', 'B', 'C']> + export type Foo = $.OutputObject<'Foo', { + /** + * Field documentation. + * + * @deprecated Field a is deprecated. + */ + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + }> - export type Case = $.Enum<'Case', ['ErrorOne', 'ErrorTwo', 'Object1']> + export type Object1 = $.OutputObject<'Object1', { + ABCEnum: $.OutputField<'ABCEnum', $.Nullable, null> + boolean: $.OutputField<'boolean', $.Nullable<$Scalar.Boolean>, null> + float: $.OutputField<'float', $.Nullable<$Scalar.Float>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + string: $.OutputField<'string', $.Nullable<$Scalar.String>, null> + }> + + export type Object1ImplementingInterface = $.OutputObject<'Object1ImplementingInterface', { + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + }> + + export type Object2ImplementingInterface = $.OutputObject<'Object2ImplementingInterface', { + boolean: $.OutputField<'boolean', $.Nullable<$Scalar.Boolean>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + }> + + export type ObjectNested = $.OutputObject<'ObjectNested', { + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + object: $.OutputField<'object', $.Nullable, null> + }> + + export type ObjectUnion = $.OutputObject<'ObjectUnion', { + fooBarUnion: $.OutputField<'fooBarUnion', $.Nullable, null> + }> + + export type lowerCaseObject = $.OutputObject<'lowerCaseObject', { + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + }> + + export type lowerCaseObject2 = $.OutputObject<'lowerCaseObject2', { + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + }> // // @@ -305,15 +363,15 @@ export namespace Schema { // export type DateInterface1 = $.Interface<'DateInterface1', { - date1: $.Field<'date1', $.Nullable<$Scalar.Date>, null> + date1: $.OutputField<'date1', $.Nullable<$Scalar.Date>, null> }, [DateObject1]> export type Error = $.Interface<'Error', { - message: $.Field<'message', $Scalar.String, null> + message: $.OutputField<'message', $Scalar.String, null> }, [ErrorOne, ErrorTwo]> export type Interface = $.Interface<'Interface', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> }, [Object1ImplementingInterface, Object2ImplementingInterface]> // @@ -323,7 +381,7 @@ export namespace Schema { // // // ================================================================================================== - // Object + // Union // ================================================================================================== // // @@ -332,75 +390,16 @@ export namespace Schema { // // - export type Bar = $.OutputObject<'Bar', { - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - }> - - export type DateObject1 = $.OutputObject<'DateObject1', { - date1: $.Field<'date1', $.Nullable<$Scalar.Date>, null> - }> - - export type DateObject2 = $.OutputObject<'DateObject2', { - date2: $.Field<'date2', $.Nullable<$Scalar.Date>, null> - }> - - export type ErrorOne = $.OutputObject<'ErrorOne', { - infoId: $.Field<'infoId', $.Nullable<$Scalar.ID>, null> - message: $.Field<'message', $Scalar.String, null> - }> - - export type ErrorTwo = $.OutputObject<'ErrorTwo', { - infoInt: $.Field<'infoInt', $.Nullable<$Scalar.Int>, null> - message: $.Field<'message', $Scalar.String, null> - }> + export type DateUnion = $.Union<'DateUnion', [DateObject1, DateObject2]> /** - * Object documentation. + * Union documentation. */ - export type Foo = $.OutputObject<'Foo', { - /** - * Field documentation. - * - * @deprecated Field a is deprecated. - */ - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - }> - - export type Object1 = $.OutputObject<'Object1', { - ABCEnum: $.Field<'ABCEnum', $.Nullable, null> - boolean: $.Field<'boolean', $.Nullable<$Scalar.Boolean>, null> - float: $.Field<'float', $.Nullable<$Scalar.Float>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - string: $.Field<'string', $.Nullable<$Scalar.String>, null> - }> - - export type Object1ImplementingInterface = $.OutputObject<'Object1ImplementingInterface', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - }> - - export type Object2ImplementingInterface = $.OutputObject<'Object2ImplementingInterface', { - boolean: $.Field<'boolean', $.Nullable<$Scalar.Boolean>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - }> - - export type ObjectNested = $.OutputObject<'ObjectNested', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - object: $.Field<'object', $.Nullable, null> - }> - - export type ObjectUnion = $.OutputObject<'ObjectUnion', { - fooBarUnion: $.Field<'fooBarUnion', $.Nullable, null> - }> + export type FooBarUnion = $.Union<'FooBarUnion', [Bar, Foo]> - export type lowerCaseObject = $.OutputObject<'lowerCaseObject', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - }> + export type Result = $.Union<'Result', [ErrorOne, ErrorTwo, Object1]> - export type lowerCaseObject2 = $.OutputObject<'lowerCaseObject2', { - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - }> + export type lowerCaseUnion = $.Union<'lowerCaseUnion', [lowerCaseObject, lowerCaseObject2]> // // @@ -409,7 +408,7 @@ export namespace Schema { // // // ================================================================================================== - // Union + // Enum // ================================================================================================== // // @@ -418,16 +417,17 @@ export namespace Schema { // // - export type DateUnion = $.Union<'DateUnion', [DateObject1, DateObject2]> - /** - * Union documentation. + * Enum documentation. + * + * Members + * "A" - (DEPRECATED: Enum value A is deprecated.) + * "B" - Enum B member documentation. + * "C" - (DEPRECATED: Enum value C is deprecated.) */ - export type FooBarUnion = $.Union<'FooBarUnion', [Bar, Foo]> - - export type Result = $.Union<'Result', [ErrorOne, ErrorTwo, Object1]> + export type ABCEnum = $.Enum<'ABCEnum', ['A', 'B', 'C']> - export type lowerCaseUnion = $.Union<'lowerCaseUnion', [lowerCaseObject, lowerCaseObject2]> + export type Case = $.Enum<'Case', ['ErrorOne', 'ErrorTwo', 'Object1']> } // diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts index a08e59e1f..3a66b5744 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts @@ -1,4 +1,4 @@ -import type * as $Utilities from '../../../../../../entrypoints/utilities-for-generated.js' +import type * as $$Utilities from '../../../../../../entrypoints/utilities-for-generated.js' import * as $Scalar from './Scalar.js' // // @@ -7,7 +7,7 @@ import * as $Scalar from './Scalar.js' // // // ================================================================================================== -// GraphQLScalarTypeStandard +// ScalarStandard // ================================================================================================== // // @@ -33,7 +33,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLScalarTypeCustom +// ScalarCustom // ================================================================================================== // // @@ -51,7 +51,7 @@ const Date = 'Date' // // // ================================================================================================== -// GraphQLEnumType +// Enum // ================================================================================================== // // @@ -60,12 +60,12 @@ const Date = 'Date' // // -const ABCEnum: $Utilities.SchemaDrivenDataMap.Enum = { +const ABCEnum: $$Utilities.SchemaDrivenDataMap.Enum = { k: 'enum', n: 'ABCEnum', } -const Case: $Utilities.SchemaDrivenDataMap.Enum = { +const Case: $$Utilities.SchemaDrivenDataMap.Enum = { k: 'enum', n: 'Case', } @@ -77,7 +77,7 @@ const Case: $Utilities.SchemaDrivenDataMap.Enum = { // // // ================================================================================================== -// GraphQLInputObjectType +// InputObject // ================================================================================================== // // @@ -86,7 +86,7 @@ const Case: $Utilities.SchemaDrivenDataMap.Enum = { // // -const InputObject: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObject: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObject', fcs: ['date', 'dateRequired'], f: { @@ -101,7 +101,7 @@ const InputObject: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const InputObjectCircular: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObjectCircular: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObjectCircular', fcs: ['circular', 'date'], f: { @@ -114,7 +114,7 @@ const InputObjectCircular: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const InputObjectNested: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObjectNested: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObjectNested', fcs: ['InputObject'], f: { @@ -124,7 +124,7 @@ const InputObjectNested: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const InputObjectNestedNonNull: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObjectNestedNonNull: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObjectNestedNonNull', fcs: ['InputObject'], f: { @@ -141,7 +141,7 @@ const InputObjectNestedNonNull: $Utilities.SchemaDrivenDataMap.InputObject = { // // // ================================================================================================== -// GraphQLObjectType +// OutputObject // ================================================================================================== // // @@ -150,13 +150,13 @@ const InputObjectNestedNonNull: $Utilities.SchemaDrivenDataMap.InputObject = { // // -const Bar: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Bar: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { int: {}, }, } -const DateObject1: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateObject1: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { date1: { nt: Date, @@ -164,7 +164,7 @@ const DateObject1: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const DateObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateObject2: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { date2: { nt: Date, @@ -172,7 +172,7 @@ const DateObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const ErrorOne: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ErrorOne: $$Utilities.SchemaDrivenDataMap.OutputObject = { e: 1, f: { infoId: {}, @@ -180,7 +180,7 @@ const ErrorOne: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const ErrorTwo: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ErrorTwo: $$Utilities.SchemaDrivenDataMap.OutputObject = { e: 1, f: { infoInt: {}, @@ -188,13 +188,13 @@ const ErrorTwo: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const Foo: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Foo: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, }, } -const Object1: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Object1: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { ABCEnum: {}, boolean: {}, @@ -205,21 +205,21 @@ const Object1: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const Object1ImplementingInterface: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Object1ImplementingInterface: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, int: {}, }, } -const Object2ImplementingInterface: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Object2ImplementingInterface: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { boolean: {}, id: {}, }, } -const ObjectNested: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ObjectNested: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, object: { @@ -228,7 +228,7 @@ const ObjectNested: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const ObjectUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ObjectUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { fooBarUnion: { // nt: FooBarUnion, <-- Assigned later to avoid potential circular dependency. @@ -236,13 +236,13 @@ const ObjectUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const lowerCaseObject: $Utilities.SchemaDrivenDataMap.OutputObject = { +const lowerCaseObject: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, }, } -const lowerCaseObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { +const lowerCaseObject2: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { int: {}, }, @@ -255,7 +255,7 @@ const lowerCaseObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLInterfaceType +// Interface // ================================================================================================== // // @@ -264,17 +264,17 @@ const lowerCaseObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const DateInterface1: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateInterface1: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { ...DateObject1.f, }, } -const Error: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Error: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } -const Interface: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Interface: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } @@ -285,7 +285,7 @@ const Interface: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLUnionType +// Union // ================================================================================================== // // @@ -294,22 +294,22 @@ const Interface: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const DateUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { ...DateObject1.f, ...DateObject2.f, }, } -const FooBarUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const FooBarUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } -const Result: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Result: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } -const lowerCaseUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const lowerCaseUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } @@ -320,7 +320,7 @@ const lowerCaseUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLRootType +// Root // ================================================================================================== // // @@ -329,14 +329,14 @@ const lowerCaseUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, idNonNull: {}, }, } -const Query: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { InputObjectNested: { a: { @@ -689,7 +689,7 @@ Query.f[`unionObjectNonNull`]!.nt = ObjectUnion // // -const $schemaDrivenDataMap: $Utilities.SchemaDrivenDataMap = { +const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { roots: { Mutation, Query, diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts index 03b38ab5f..d4fe27f4e 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts @@ -46,8 +46,8 @@ export namespace Select { 'Mutation' > export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // Object Types - // ------------ + // OutputObject Types + // ------------------ export type Bar<$SelectionSet extends SelectionSets.Bar> = InferResult.Object< $SelectionSet, Schema, diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts index 969f87a9f..b914a1466 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts @@ -31,7 +31,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // ================================================================================================== -// GraphQLObjectType Types +// Root // ================================================================================================== // // @@ -45,7 +45,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Mutation // -------------------------------------------------------------------------------------------------- @@ -56,11 +56,11 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap export interface Mutation<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { /** - * Select the `id` field on the `Mutation` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Mutation` object. Its type is ScalarStandard. */ id?: Mutation.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `Scalar`). + * Select the `idNonNull` field on the `Mutation` object. Its type is ScalarStandard. */ idNonNull?: Mutation.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -141,7 +141,7 @@ export namespace Mutation { // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- @@ -152,13 +152,13 @@ export namespace Mutation { export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { /** - * Select the `InputObjectNested` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `InputObjectNested` field on the `Query` object. Its type is ScalarStandard. */ InputObjectNested?: | Query.InputObjectNested$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `InputObjectNestedNonNull` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `InputObjectNestedNonNull` field on the `Query` object. Its type is ScalarStandard. */ InputObjectNestedNonNull?: | Query.InputObjectNestedNonNull<$Scalars> @@ -168,41 +168,41 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ abcEnum?: Query.abcEnum$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `argInputObjectCircular` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `argInputObjectCircular` field on the `Query` object. Its type is ScalarStandard. */ argInputObjectCircular?: | Query.argInputObjectCircular$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `date` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `date` field on the `Query` object. Its type is ScalarCustom. */ date?: Query.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArg` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArg` field on the `Query` object. Its type is ScalarCustom. */ dateArg?: Query.dateArg$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgInputObject` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgInputObject` field on the `Query` object. Its type is ScalarCustom. */ dateArgInputObject?: | Query.dateArgInputObject$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgList` field on the `Query` object. Its type is ScalarCustom. */ dateArgList?: Query.dateArgList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateArgNonNull?: Query.dateArgNonNull<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgNonNullList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgNonNullList` field on the `Query` object. Its type is ScalarCustom. */ dateArgNonNullList?: | Query.dateArgNonNullList<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgNonNullListNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgNonNullListNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateArgNonNullListNonNull?: | Query.dateArgNonNullListNonNull<$Scalars> @@ -214,25 +214,25 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.dateInterface1$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateList` field on the `Query` object. Its type is ScalarCustom. */ dateList?: Query.dateList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateListList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateListList` field on the `Query` object. Its type is ScalarCustom. */ dateListList?: Query.dateListList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateListNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateListNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateListNonNull?: | Query.dateListNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateNonNull?: Query.dateNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateObject1` field on the `Query` object. Its type is Object. + * Select the `dateObject1` field on the `Query` object. Its type is OutputObject. */ dateObject1?: Query.dateObject1$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** @@ -240,15 +240,15 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ dateUnion?: Query.dateUnion$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `error` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `error` field on the `Query` object. Its type is ScalarStandard. */ error?: Query.error$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Query` object. Its type is ScalarStandard. */ id?: Query.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `idNonNull` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `idNonNull` field on the `Query` object. Its type is ScalarStandard. */ idNonNull?: Query.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** @@ -268,21 +268,21 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.interfaceWithArgs<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listInt` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listInt` field on the `Query` object. Its type is ScalarStandard. */ listInt?: Query.listInt$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listIntNonNull` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listIntNonNull` field on the `Query` object. Its type is ScalarStandard. */ listIntNonNull?: | Query.listIntNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listListInt` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listListInt` field on the `Query` object. Its type is ScalarStandard. */ listListInt?: Query.listListInt$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listListIntNonNull` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listListIntNonNull` field on the `Query` object. Its type is ScalarStandard. */ listListIntNonNull?: | Query.listListIntNonNull$Expanded<$Scalars> @@ -294,31 +294,31 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.lowerCaseUnion$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `object` field on the `Query` object. Its type is Object. + * Select the `object` field on the `Query` object. Its type is OutputObject. */ object?: Query.$object$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectList` field on the `Query` object. Its type is Object. + * Select the `objectList` field on the `Query` object. Its type is OutputObject. */ objectList?: Query.objectList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectListNonNull` field on the `Query` object. Its type is Object. + * Select the `objectListNonNull` field on the `Query` object. Its type is OutputObject. */ objectListNonNull?: | Query.objectListNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectNested` field on the `Query` object. Its type is Object. + * Select the `objectNested` field on the `Query` object. Its type is OutputObject. */ objectNested?: Query.objectNested$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectNonNull` field on the `Query` object. Its type is Object. + * Select the `objectNonNull` field on the `Query` object. Its type is OutputObject. */ objectNonNull?: | Query.objectNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectWithArgs` field on the `Query` object. Its type is Object. + * Select the `objectWithArgs` field on the `Query` object. Its type is OutputObject. */ objectWithArgs?: | Query.objectWithArgs$Expanded<$Scalars> @@ -334,47 +334,47 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.resultNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `string` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `string` field on the `Query` object. Its type is ScalarStandard. */ string?: Query.$string$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgEnum` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgEnum` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgEnum?: | Query.stringWithArgEnum$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgInputObject` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgInputObject` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgInputObject?: | Query.stringWithArgInputObject$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgInputObjectRequired` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgInputObjectRequired` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgInputObjectRequired?: | Query.stringWithArgInputObjectRequired<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgs` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgs` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgs?: | Query.stringWithArgs$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithListArg` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithListArg` field on the `Query` object. Its type is ScalarStandard. */ stringWithListArg?: | Query.stringWithListArg$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithListArgRequired` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithListArgRequired` field on the `Query` object. Its type is ScalarStandard. */ stringWithListArgRequired?: | Query.stringWithListArgRequired<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithRequiredArg` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithRequiredArg` field on the `Query` object. Its type is ScalarStandard. */ stringWithRequiredArg?: | Query.stringWithRequiredArg<$Scalars> @@ -396,11 +396,11 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.unionFooBarWithArgs$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `unionObject` field on the `Query` object. Its type is Object. + * Select the `unionObject` field on the `Query` object. Its type is OutputObject. */ unionObject?: Query.unionObject$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `unionObjectNonNull` field on the `Query` object. Its type is Object. + * Select the `unionObjectNonNull` field on the `Query` object. Its type is OutputObject. */ unionObjectNonNull?: | Query.unionObjectNonNull$Expanded<$Scalars> @@ -1748,7 +1748,7 @@ export namespace Query { // // // ================================================================================================== -// GraphQLEnumType Types +// Enum // ================================================================================================== // // @@ -1776,7 +1776,7 @@ export type Case = 'ErrorOne' | 'ErrorTwo' | 'Object1' // // // ================================================================================================== -// GraphQLInputObjectType Types +// InputObject // ================================================================================================== // // @@ -1824,195 +1824,7 @@ export interface InputObjectNestedNonNull<$Scalars extends $$Utilities.Schema.Sc // // // ================================================================================================== -// GraphQLInterfaceType Types -// ================================================================================================== -// -// -// -// -// -// - -// Interface Type: DateInterface1 -// -------------------------------------------------------------------------------------------------- - -export interface DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ - date1?: DateInterface1.date1<$Scalars> - ___on_DateObject1?: DateObject1<$Scalars> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | DateInterface1$FragmentInline<$Scalars> - | DateInterface1$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, - * the name is one of the implementor type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface DateInterface1$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends DateInterface1<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -export namespace DateInterface1 { - export type date1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | date1$SelectionSet<$Scalars> - - export interface date1$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `date1` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type date1$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | date1$SelectionSet<$Scalars> - > -} - -// Interface Type: Error -// -------------------------------------------------------------------------------------------------- - -export interface Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { - message?: Error.message<$Scalars> - ___on_ErrorOne?: ErrorOne<$Scalars> - ___on_ErrorTwo?: ErrorTwo<$Scalars> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Error$FragmentInline<$Scalars> - | Error$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, - * the name is one of the implementor type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Error$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Error<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -export namespace Error { - export type message<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | message$SelectionSet<$Scalars> - - export interface message$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `message` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type message$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | message$SelectionSet<$Scalars> - > -} - -// Interface Type: Interface -// -------------------------------------------------------------------------------------------------- - -export interface Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { - id?: Interface.id<$Scalars> - ___on_Object1ImplementingInterface?: Object1ImplementingInterface<$Scalars> - ___on_Object2ImplementingInterface?: Object2ImplementingInterface<$Scalars> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Interface$FragmentInline<$Scalars> - | Interface$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, - * the name is one of the implementor type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Interface$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Interface<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -export namespace Interface { - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `id` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > -} - -// -// -// -// -// -// -// ================================================================================================== -// GraphQLObjectType Types +// OutputObject // ================================================================================================== // // @@ -2026,7 +1838,7 @@ export namespace Interface { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Bar // -------------------------------------------------------------------------------------------------- @@ -2037,7 +1849,7 @@ export namespace Interface { export interface Bar<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `int` field on the `Bar` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `Bar` object. Its type is ScalarStandard. */ int?: Bar.int$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2096,7 +1908,7 @@ export namespace Bar { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // DateObject1 // -------------------------------------------------------------------------------------------------- @@ -2109,7 +1921,7 @@ export interface DateObject1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMa extends $Select.Bases.ObjectLike { /** - * Select the `date1` field on the `DateObject1` object. Its type is `Date` (a `Scalar`). + * Select the `date1` field on the `DateObject1` object. Its type is ScalarCustom. */ date1?: DateObject1.date1$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2168,7 +1980,7 @@ export namespace DateObject1 { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // DateObject2 // -------------------------------------------------------------------------------------------------- @@ -2181,7 +1993,7 @@ export interface DateObject2<$Scalars extends $$Utilities.Schema.Scalar.ScalarMa extends $Select.Bases.ObjectLike { /** - * Select the `date2` field on the `DateObject2` object. Its type is `Date` (a `Scalar`). + * Select the `date2` field on the `DateObject2` object. Its type is ScalarCustom. */ date2?: DateObject2.date2$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2240,7 +2052,7 @@ export namespace DateObject2 { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ErrorOne // -------------------------------------------------------------------------------------------------- @@ -2251,11 +2063,11 @@ export namespace DateObject2 { export interface ErrorOne<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `infoId` field on the `ErrorOne` object. Its type is `ID` (a `Scalar`). + * Select the `infoId` field on the `ErrorOne` object. Its type is ScalarStandard. */ infoId?: ErrorOne.infoId$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `message` field on the `ErrorOne` object. Its type is `String` (a `Scalar`). + * Select the `message` field on the `ErrorOne` object. Its type is ScalarStandard. */ message?: ErrorOne.message$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2336,7 +2148,7 @@ export namespace ErrorOne { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ErrorTwo // -------------------------------------------------------------------------------------------------- @@ -2347,11 +2159,11 @@ export namespace ErrorOne { export interface ErrorTwo<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `infoInt` field on the `ErrorTwo` object. Its type is `Int` (a `Scalar`). + * Select the `infoInt` field on the `ErrorTwo` object. Its type is ScalarStandard. */ infoInt?: ErrorTwo.infoInt$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `message` field on the `ErrorTwo` object. Its type is `String` (a `Scalar`). + * Select the `message` field on the `ErrorTwo` object. Its type is ScalarStandard. */ message?: ErrorTwo.message$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2432,7 +2244,7 @@ export namespace ErrorTwo { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Foo // -------------------------------------------------------------------------------------------------- @@ -2446,7 +2258,7 @@ export namespace ErrorTwo { */ export interface Foo<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `Foo` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Foo` object. Its type is ScalarStandard. */ id?: Foo.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2505,7 +2317,7 @@ export namespace Foo { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Object1 // -------------------------------------------------------------------------------------------------- @@ -2520,23 +2332,23 @@ export interface Object1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = */ ABCEnum?: Object1.ABCEnum$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `boolean` field on the `Object1` object. Its type is `Boolean` (a `Scalar`). + * Select the `boolean` field on the `Object1` object. Its type is ScalarStandard. */ boolean?: Object1.$boolean$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `float` field on the `Object1` object. Its type is `Float` (a `Scalar`). + * Select the `float` field on the `Object1` object. Its type is ScalarStandard. */ float?: Object1.float$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Object1` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Object1` object. Its type is ScalarStandard. */ id?: Object1.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `int` field on the `Object1` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `Object1` object. Its type is ScalarStandard. */ int?: Object1.int$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `string` field on the `Object1` object. Its type is `String` (a `Scalar`). + * Select the `string` field on the `Object1` object. Its type is ScalarStandard. */ string?: Object1.$string$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2705,7 +2517,7 @@ export namespace Object1 { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Object1ImplementingInterface // -------------------------------------------------------------------------------------------------- @@ -2718,13 +2530,13 @@ export interface Object1ImplementingInterface<$Scalars extends $$Utilities.Schem extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `Object1ImplementingInterface` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Object1ImplementingInterface` object. Its type is ScalarStandard. */ id?: | Object1ImplementingInterface.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `int` field on the `Object1ImplementingInterface` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `Object1ImplementingInterface` object. Its type is ScalarStandard. */ int?: | Object1ImplementingInterface.int$Expanded<$Scalars> @@ -2807,7 +2619,7 @@ export namespace Object1ImplementingInterface { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Object2ImplementingInterface // -------------------------------------------------------------------------------------------------- @@ -2820,13 +2632,13 @@ export interface Object2ImplementingInterface<$Scalars extends $$Utilities.Schem extends $Select.Bases.ObjectLike { /** - * Select the `boolean` field on the `Object2ImplementingInterface` object. Its type is `Boolean` (a `Scalar`). + * Select the `boolean` field on the `Object2ImplementingInterface` object. Its type is ScalarStandard. */ boolean?: | Object2ImplementingInterface.$boolean$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Object2ImplementingInterface` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Object2ImplementingInterface` object. Its type is ScalarStandard. */ id?: | Object2ImplementingInterface.id$Expanded<$Scalars> @@ -2909,7 +2721,7 @@ export namespace Object2ImplementingInterface { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ObjectNested // -------------------------------------------------------------------------------------------------- @@ -2922,11 +2734,11 @@ export interface ObjectNested<$Scalars extends $$Utilities.Schema.Scalar.ScalarM extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `ObjectNested` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `ObjectNested` object. Its type is ScalarStandard. */ id?: ObjectNested.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `object` field on the `ObjectNested` object. Its type is Object. + * Select the `object` field on the `ObjectNested` object. Its type is OutputObject. */ object?: ObjectNested.$object$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -3004,7 +2816,7 @@ export namespace ObjectNested { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ObjectUnion // -------------------------------------------------------------------------------------------------- @@ -3077,7 +2889,7 @@ export namespace ObjectUnion { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // lowerCaseObject // -------------------------------------------------------------------------------------------------- @@ -3090,7 +2902,7 @@ export interface lowerCaseObject<$Scalars extends $$Utilities.Schema.Scalar.Scal extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `lowerCaseObject` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `lowerCaseObject` object. Its type is ScalarStandard. */ id?: lowerCaseObject.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -3149,7 +2961,7 @@ export namespace lowerCaseObject { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // lowerCaseObject2 // -------------------------------------------------------------------------------------------------- @@ -3162,7 +2974,7 @@ export interface lowerCaseObject2<$Scalars extends $$Utilities.Schema.Scalar.Sca extends $Select.Bases.ObjectLike { /** - * Select the `int` field on the `lowerCaseObject2` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `lowerCaseObject2` object. Its type is ScalarStandard. */ int?: lowerCaseObject2.int$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -3223,7 +3035,7 @@ export namespace lowerCaseObject2 { // // // ================================================================================================== -// GraphQLUnionType Types +// Union // ================================================================================================== // // @@ -3356,6 +3168,194 @@ export interface lowerCaseUnion$FragmentInline<$Scalars extends $$Utilities.Sche extends lowerCaseUnion<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields {} +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// + +// Interface Type: DateInterface1 +// -------------------------------------------------------------------------------------------------- + +export interface DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.ObjectLike +{ + date1?: DateInterface1.date1<$Scalars> + ___on_DateObject1?: DateObject1<$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | DateInterface1$FragmentInline<$Scalars> + | DateInterface1$FragmentInline<$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface DateInterface1$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends DateInterface1<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields +{} + +export namespace DateInterface1 { + export type date1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | date1$SelectionSet<$Scalars> + + export interface date1$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `date1` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type date1$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | date1$SelectionSet<$Scalars> + > +} + +// Interface Type: Error +// -------------------------------------------------------------------------------------------------- + +export interface Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { + message?: Error.message<$Scalars> + ___on_ErrorOne?: ErrorOne<$Scalars> + ___on_ErrorTwo?: ErrorTwo<$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Error$FragmentInline<$Scalars> + | Error$FragmentInline<$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Error$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends Error<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields +{} + +export namespace Error { + export type message<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | message$SelectionSet<$Scalars> + + export interface message$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `message` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type message$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | message$SelectionSet<$Scalars> + > +} + +// Interface Type: Interface +// -------------------------------------------------------------------------------------------------- + +export interface Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { + id?: Interface.id<$Scalars> + ___on_Object1ImplementingInterface?: Object1ImplementingInterface<$Scalars> + ___on_Object2ImplementingInterface?: Object2ImplementingInterface<$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Interface$FragmentInline<$Scalars> + | Interface$FragmentInline<$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Interface$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends Interface<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields +{} + +export namespace Interface { + export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<$Scalars> + + export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<$Scalars> + > +} + /** * [1] These definitions serve to allow field selection interfaces to extend their respective object type without * name clashing between the field name and the object name. @@ -3377,9 +3377,6 @@ export namespace $NamedTypes { > export type $InputObjectNestedNonNull<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = InputObjectNestedNonNull<$Scalars> - export type $DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateInterface1<$Scalars> - export type $Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Error<$Scalars> - export type $Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Interface<$Scalars> export type $Bar<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Bar<$Scalars> export type $DateObject1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateObject1<$Scalars> export type $DateObject2<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateObject2<$Scalars> @@ -3399,4 +3396,7 @@ export namespace $NamedTypes { export type $FooBarUnion<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = FooBarUnion<$Scalars> export type $Result<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Result<$Scalars> export type $lowerCaseUnion<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = lowerCaseUnion<$Scalars> + export type $DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateInterface1<$Scalars> + export type $Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Error<$Scalars> + export type $Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Interface<$Scalars> } diff --git a/src/generator/config/config.ts b/src/generator/config/config.ts index 1c93fb3ed..ca8060c5f 100644 --- a/src/generator/config/config.ts +++ b/src/generator/config/config.ts @@ -63,7 +63,7 @@ interface ConfigSchema { sdl: string sdlFilePath: null | string instance: Grafaid.Schema.Schema - kindMap: Grafaid.Schema.KindMap.KindMap + kindMap: Grafaid.Schema.KindMap } export const createConfig = async (input: Input): Promise => { diff --git a/src/generator/generators/MethodsRoot.ts b/src/generator/generators/MethodsRoot.ts index b8bb81c0a..c29cc1733 100644 --- a/src/generator/generators/MethodsRoot.ts +++ b/src/generator/generators/MethodsRoot.ts @@ -21,7 +21,7 @@ export const ModuleGeneratorMethodsRoot = createModuleGenerator( code() - config.schema.kindMap.GraphQLRootType.forEach(node => { + config.schema.kindMap.Root.forEach(node => { code(renderRootType({ config, node })) code() }) @@ -29,7 +29,7 @@ export const ModuleGeneratorMethodsRoot = createModuleGenerator( code(` export interface BuilderMethodsRoot<$Context extends ${identifiers.$$Utilities}.ClientContext> { ${ - config.schema.kindMap.GraphQLRootType.map(node => { + config.schema.kindMap.Root.map(node => { const operationName = Grafaid.RootTypeNameToOperationName[node.name as keyof typeof Grafaid.RootTypeNameToOperationName] return `${operationName}: ${node.name}Methods<$Context>` diff --git a/src/generator/generators/MethodsSelect.ts b/src/generator/generators/MethodsSelect.ts index c133990ac..3890e8f64 100644 --- a/src/generator/generators/MethodsSelect.ts +++ b/src/generator/generators/MethodsSelect.ts @@ -1,5 +1,7 @@ // todo jsdoc +import { pick } from 'es-toolkit' import { Grafaid } from '../../lib/grafaid/__.js' +import { entries } from '../../lib/prelude.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { renderName, title1 } from '../helpers/render.js' import { ModuleGeneratorSelectionSets } from './SelectionSets.js' @@ -7,37 +9,32 @@ import { ModuleGeneratorSelectionSets } from './SelectionSets.js' export const ModuleGeneratorMethodsSelect = createModuleGenerator( `MethodsSelect`, ({ config, code }) => { + const kindMap = pick(config.schema.kindMap, [`Root`, `OutputObject`, `Union`, `Interface`]) + const kinds = entries(kindMap) + code(`import type * as $SelectionSets from './${ModuleGeneratorSelectionSets.name}.js'`) code(`import type * as $Utilities from '${config.paths.imports.grafflePackage.utilitiesForGenerated}'`) code() - const graphqlTypeGroups = [ - config.schema.kindMap.GraphQLRootType, - config.schema.kindMap.GraphQLObjectType, - config.schema.kindMap.GraphQLUnionType, - config.schema.kindMap.GraphQLInterfaceType, - ].filter(_ => _.length > 0) - code(title1(`Select Methods Interface`)) code() code(`export interface $MethodsSelect {`) - for (const graphqlTypeGroup of graphqlTypeGroups) { - for (const graphqlType of graphqlTypeGroup) { + for (const [_, kind] of kinds) { + for (const type of kind) { // dprint-ignore - code(`${graphqlType.name}: ${renderName(graphqlType)}`) + code(`${type.name}: ${renderName(type)}`) } } code(`}`) code() - for (const graphqlTypeGroup of graphqlTypeGroups) { - const { kind } = Grafaid.getTypeNameAndKind(graphqlTypeGroup[0]!) - const titleText = Grafaid.Schema.isRootType(graphqlTypeGroup[0]!) ? `Root` : kind + for (const [name, kind] of kinds) { + const titleText = Grafaid.Schema.isRootType(kind[0]!) ? `Root` : name code(title1(titleText)) code() - for (const graphqlType of graphqlTypeGroup) { + for (const graphqlType of kind) { // dprint-ignore code(` export interface ${renderName(graphqlType)} { diff --git a/src/generator/generators/Scalar.ts b/src/generator/generators/Scalar.ts index 43be923fb..ab57c0fcb 100644 --- a/src/generator/generators/Scalar.ts +++ b/src/generator/generators/Scalar.ts @@ -19,9 +19,9 @@ export const ModuleGeneratorScalar = createModuleGenerator( code(`import * as ${identifiers.CustomScalars} from '${config.paths.imports.customScalarCodecs}'`) code() code(`export * from '${config.paths.imports.customScalarCodecs}'`) - const names = config.schema.kindMap.GraphQLScalarTypeCustom.map((scalar) => scalar.name).join(`, `) + const names = config.schema.kindMap.ScalarCustom.map((scalar) => scalar.name).join(`, `) code(`export { ${names} } from '${config.paths.imports.customScalarCodecs}'`) - for (const scalar of config.schema.kindMap.GraphQLScalarTypeCustom) { + for (const scalar of config.schema.kindMap.ScalarCustom) { code(typeTitle2(`custom scalar type`)(scalar)) code() code(`export type ${scalar.name} = typeof ${identifiers.CustomScalars}.${scalar.name}`) @@ -50,7 +50,7 @@ export const ModuleGeneratorScalar = createModuleGenerator( ) } - for (const scalar of config.schema.kindMap.GraphQLScalarTypeCustom) { + for (const scalar of config.schema.kindMap.ScalarCustom) { code(typeTitle2(`custom scalar type`)(scalar)) code() code(`export type ${scalar.name} = ${identifiers.$$Utilities}.Schema.Scalar.ScalarCodecless<'Date'>`) diff --git a/src/generator/generators/Schema.ts b/src/generator/generators/Schema.ts index 6ff2b7400..1666d4d74 100644 --- a/src/generator/generators/Schema.ts +++ b/src/generator/generators/Schema.ts @@ -1,3 +1,4 @@ +import { omit } from 'es-toolkit' import { Code } from '../../lib/Code.js' import { Grafaid } from '../../lib/grafaid/__.js' import { entries, isObjectEmpty, values } from '../../lib/prelude.js' @@ -13,6 +14,9 @@ import { ModuleGeneratorScalar } from './Scalar.js' export const ModuleGeneratorSchema = createModuleGenerator( `Schema`, ({ config, code }) => { + const kindMap = omit(config.schema.kindMap, [`ScalarCustom`, `ScalarStandard`]) + const kinds = entries(kindMap) + // todo methods root is unused code(` import type * as Data from './${ModuleGeneratorData.name}.js' @@ -23,14 +27,9 @@ export const ModuleGeneratorSchema = createModuleGenerator( `) code(`export namespace ${identifiers.Schema} {`) - for (const [name, types] of entries(config.schema.kindMap)) { - if (name === `GraphQLScalarType`) continue - if (name === `GraphQLScalarTypeCustom`) continue - if (name === `GraphQLScalarTypeStandard`) continue - - const namespaceName = name === `GraphQLRootType` ? `Root` : namespaceNames[name] + for (const [name, types] of kinds) { code() - code(title1(namespaceName)) + code(title1(name)) code() code( types.length === 0 @@ -57,23 +56,21 @@ export const SchemaGenerator = createCodeGenerator( Subscription: Grafaid.Schema.KindMap.hasSubscription(config.schema.kindMap), } - const root = config.schema.kindMap.GraphQLRootType.map(_ => [_.name, `${identifiers.Schema}.${_.name}`] as const) + const root = config.schema.kindMap.Root.map(_ => [_.name, `${identifiers.Schema}.${_.name}`] as const) - const objects = config.schema.kindMap.GraphQLObjectType.map(_ => - [_.name, `${identifiers.Schema}.${_.name}`] as const - ) - const unions = config.schema.kindMap.GraphQLUnionType.map(_ => [_.name, `${identifiers.Schema}.${_.name}`] as const) - const interfaces = config.schema.kindMap.GraphQLInterfaceType.map( + const objects = config.schema.kindMap.OutputObject.map(_ => [_.name, `${identifiers.Schema}.${_.name}`] as const) + const unions = config.schema.kindMap.Union.map(_ => [_.name, `${identifiers.Schema}.${_.name}`] as const) + const interfaces = config.schema.kindMap.Interface.map( _ => [_.name, `${identifiers.Schema}.${_.name}`] as const, ) - const enums = config.schema.kindMap.GraphQLEnumType.map( + const enums = config.schema.kindMap.Enum.map( _ => [_.name, `${identifiers.Schema}.${_.name}`] as const, ) const schema: Code.TermObject = { name: `Data.Name`, - RootTypesPresent: `[${config.schema.kindMap.GraphQLRootType.map((_) => Code.string(_.name)).join(`, `)}]`, - RootUnion: config.schema.kindMap.GraphQLRootType.map(_ => `${identifiers.Schema}.${_.name}`) + RootTypesPresent: `[${config.schema.kindMap.Root.map((_) => Code.string(_.name)).join(`, `)}]`, + RootUnion: config.schema.kindMap.Root.map(_ => `${identifiers.Schema}.${_.name}`) .join(`|`), Root: { Query: rootTypesPresence.Query ? `${identifiers.Schema}.Query` : null, @@ -116,15 +113,6 @@ export const SchemaGenerator = createCodeGenerator( }, ) -const namespaceNames = { - GraphQLEnumType: `Enum`, - GraphQLInputObjectType: `InputObject`, - GraphQLInterfaceType: `Interface`, - GraphQLObjectType: `Object`, - GraphQLScalarType: `Scalar`, - GraphQLUnionType: `Union`, -} satisfies Record - type AnyGraphQLFieldsType = | Grafaid.Schema.ObjectType | Grafaid.Schema.InterfaceType @@ -292,11 +280,11 @@ const renderInputFields = (config: Config, node: AnyGraphQLFieldsType): string = const renderOutputField = (config: Config, field: Grafaid.Schema.InputOrOutputField): string => { const type = buildType(config, field.type) - const args = Grafaid.Schema.isGraphQLOutputField(field) && field.args.length > 0 + const args = Grafaid.Schema.isOutputField(field) && field.args.length > 0 ? renderArgs(config, field.args) : null - return `$.Field<'${field.name}', ${type}${args ? `, ${args}` : `, null`}>` + return `$.OutputField<'${field.name}', ${type}${args ? `, ${args}` : `, null`}>` } const renderInputField = (config: Config, field: Grafaid.Schema.InputOrOutputField): string => { diff --git a/src/generator/generators/SchemaDrivenDataMap.ts b/src/generator/generators/SchemaDrivenDataMap.ts index 76a7222fc..4617e324a 100644 --- a/src/generator/generators/SchemaDrivenDataMap.ts +++ b/src/generator/generators/SchemaDrivenDataMap.ts @@ -3,15 +3,13 @@ import { Grafaid } from '../../lib/grafaid/__.js' import { entries } from '../../lib/prelude.js' import { nullabilityFlags, propertyNames } from '../../types/SchemaDrivenDataMap/SchemaDrivenDataMap.js' import type { Config } from '../config/config.js' +import { identifiers } from '../helpers/identifiers.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { createCodeGenerator } from '../helpers/moduleGeneratorRunner.js' import { title1 } from '../helpers/render.js' +import type { KindRenderers } from '../helpers/types.js' import { ModuleGeneratorScalar } from './Scalar.js' -const identifiers = { - $Scalar: `$Scalar`, -} - type ReferenceAssignments = string[] export const ModuleGeneratorSchemaDrivenDataMap = createModuleGenerator( @@ -19,15 +17,15 @@ export const ModuleGeneratorSchemaDrivenDataMap = createModuleGenerator( ({ config, code }) => { code(` import * as ${identifiers.$Scalar} from './${ModuleGeneratorScalar.name}.js' - import type * as $Utilities from '${config.paths.imports.grafflePackage.utilitiesForGenerated}' + import type * as ${identifiers.$$Utilities} from '${config.paths.imports.grafflePackage.utilitiesForGenerated}' `) - const kinds = getKinds(config) - const kindsList = entries(kinds) + const kindMap: Grafaid.Schema.KindMap = getKindMap(config) + const kinds = entries(kindMap) const referenceAssignments: ReferenceAssignments = [] - for (const [kindName, nodes] of kindsList) { + for (const [kindName, nodes] of kinds) { code(title1(kindName)) code() if (nodes.length === 0) { @@ -53,15 +51,15 @@ export const ModuleGeneratorSchemaDrivenDataMap = createModuleGenerator( code(title1(`Index`)) code() - code(`const $schemaDrivenDataMap: $Utilities.SchemaDrivenDataMap =`) + code(`const $schemaDrivenDataMap: ${identifiers.$$Utilities}.SchemaDrivenDataMap =`) code(Code.termObject({ roots: Code.directiveTermObject({ - $literal: kinds.GraphQLRootType.map(type => type.name + `,`).join(`\n`), + $literal: kindMap.Root.map(type => type.name + `,`).join(`\n`), }), directives: `{}`, types: Code.directiveTermObject({ $literal: [ - ...kindsList.map(([, _]) => _).flat().map((_) => _.name), + ...kinds.map(([, _]) => _).flat().map((_) => _.name), // We also include the custom scalars here to facilitate encoding. Encoding has names of variables and // that need to be looked up to determine which are/have custom scalars. // ...config.schema.typeMapByKind.GraphQLScalarTypeCustom.map(_ => { @@ -91,21 +89,19 @@ export const ModuleGeneratorSchemaDrivenDataMap = createModuleGenerator( * If feature customScalars is enabled then we need to emit all paths to customs scalar inputs AND outputs. * If both are enabled the merged requirement is: all paths to inputs AND custom scalar outputs. */ -const getKinds = (config: Config) => { +const getKindMap = (config: Config) => { const { schema: { kindMap } } = config const condition = typeCondition(config) return { // When "variables" enabled, we need to know all named types to be able to write them out. - GraphQLScalarTypeStandard: kindMap.GraphQLScalarTypeStandard.filter(() => - config.runtimeFeatures.operationVariables - ), - GraphQLScalarTypeCustom: kindMap.GraphQLScalarTypeCustom.filter(() => config.runtimeFeatures.customScalars), - GraphQLEnumType: kindMap.GraphQLEnumType.filter(() => config.runtimeFeatures.operationVariables), - GraphQLInputObjectType: kindMap.GraphQLInputObjectType.filter(condition), - GraphQLObjectType: kindMap.GraphQLObjectType.filter(condition), - GraphQLInterfaceType: kindMap.GraphQLInterfaceType.filter(condition), - GraphQLUnionType: kindMap.GraphQLUnionType.filter(condition), - GraphQLRootType: kindMap.GraphQLRootType.filter(condition), + ScalarStandard: kindMap.ScalarStandard.filter(() => config.runtimeFeatures.operationVariables), + ScalarCustom: kindMap.ScalarCustom.filter(() => config.runtimeFeatures.customScalars), + Enum: kindMap.Enum.filter(() => config.runtimeFeatures.operationVariables), + InputObject: kindMap.InputObject.filter(condition), + OutputObject: kindMap.OutputObject.filter(condition), + Interface: kindMap.Interface.filter(condition), + Union: kindMap.Union.filter(condition), + Root: kindMap.Root.filter(condition), } } @@ -182,7 +178,7 @@ const UnionType = createCodeGenerator< // that they could never conflict. code(Code.termConstTyped( type.name, - `$Utilities.SchemaDrivenDataMap.OutputObject`, + `${identifiers.$$Utilities}.SchemaDrivenDataMap.OutputObject`, Code.termObject({ [propertyNames.f]: Code.directiveTermObject({ $spread: type.getTypes().filter(Grafaid.Schema.CustomScalars.isHasCustomScalars).map(memberType => @@ -201,7 +197,7 @@ const InterfaceType = createCodeGenerator< const implementorTypes = Grafaid.Schema.KindMap.getInterfaceImplementors(config.schema.kindMap, type) code(Code.termConstTyped( type.name, - `$Utilities.SchemaDrivenDataMap.OutputObject`, + `${identifiers.$$Utilities}.SchemaDrivenDataMap.OutputObject`, Code.termObject({ [propertyNames.f]: Code.directiveTermObject({ $spread: implementorTypes.filter(Grafaid.Schema.CustomScalars.isHasCustomScalars).map(memberType => @@ -299,7 +295,9 @@ const ObjectType = createCodeGenerator< } } - code(Code.termConstTyped(type.name, `$Utilities.SchemaDrivenDataMap.OutputObject`, Code.termObject(o))) + code( + Code.termConstTyped(type.name, `${identifiers.$$Utilities}.SchemaDrivenDataMap.OutputObject`, Code.termObject(o)), + ) }, ) @@ -309,7 +307,7 @@ const EnumType = createCodeGenerator< ({ code, type }) => { code(Code.termConstTyped( type.name, - `$Utilities.SchemaDrivenDataMap.Enum`, + `${identifiers.$$Utilities}.SchemaDrivenDataMap.Enum`, Code.termObject({ [propertyNames.k]: Code.string(`enum`), [propertyNames.n]: Code.string(type.name), @@ -370,20 +368,22 @@ const InputObjectType = createCodeGenerator< } } - code(Code.termConstTyped(type.name, `$Utilities.SchemaDrivenDataMap.InputObject`, Code.termObject(o))) + code( + Code.termConstTyped(type.name, `${identifiers.$$Utilities}.SchemaDrivenDataMap.InputObject`, Code.termObject(o)), + ) }, ) const kindRenders = { - GraphQLScalarTypeStandard: ScalarType, - GraphQLScalarTypeCustom: ScalarTypeCustom, - GraphQLEnumType: EnumType, - GraphQLUnionType: UnionType, - GraphQLInterfaceType: InterfaceType, - GraphQLInputObjectType: InputObjectType, - GraphQLObjectType: ObjectType, - GraphQLRootType: ObjectType, -} + ScalarStandard: ScalarType, + ScalarCustom: ScalarTypeCustom, + Enum: EnumType, + Union: UnionType, + Interface: InterfaceType, + InputObject: InputObjectType, + OutputObject: ObjectType, + Root: ObjectType, +} satisfies KindRenderers const inlineType = (type: Grafaid.Schema.InputTypes): string => { const [ofType, nonNull] = Grafaid.Schema.isNonNullType(type) diff --git a/src/generator/generators/Select.ts b/src/generator/generators/Select.ts index 64048feb9..540da1ff2 100644 --- a/src/generator/generators/Select.ts +++ b/src/generator/generators/Select.ts @@ -27,16 +27,15 @@ export const ModuleGeneratorSelect = createModuleGenerator( code(typeTitle(config, `Root`)) - code(...config.schema.kindMap.GraphQLRootType.map((type) => { + code(...config.schema.kindMap.Root.map((type) => { return `export type ${type.name}<$SelectionSet extends SelectionSets.${ renderName(type) }> = InferResult.Root<$SelectionSet, ${identifiers.Schema}, '${type.name}'>` })) - code(typeTitle(config, `Object`)) + code(typeTitle(config, `OutputObject`)) - // TODO propagate descriptions to JSDoc - code(...config.schema.kindMap.GraphQLObjectType.map((type) => { + code(...config.schema.kindMap.OutputObject.map((type) => { return `export type ${type.name}<$SelectionSet extends SelectionSets.${ renderName(type) }> = InferResult.Object<$SelectionSet, ${identifiers.Schema}, ${identifiers.Schema}['allTypes']['${type.name}']>` @@ -44,7 +43,7 @@ export const ModuleGeneratorSelect = createModuleGenerator( code(typeTitle(config, `Union`)) - code(...config.schema.kindMap.GraphQLUnionType.map((type) => { + code(...config.schema.kindMap.Union.map((type) => { return `export type ${type.name}<$SelectionSet extends SelectionSets.${ renderName(type) }> = InferResult.Union<$SelectionSet, ${identifiers.Schema}, ${identifiers.Schema}['allTypes']['${type.name}']>` @@ -52,7 +51,7 @@ export const ModuleGeneratorSelect = createModuleGenerator( code(typeTitle(config, `Interface`)) - code(...config.schema.kindMap.GraphQLInterfaceType.map((type) => { + code(...config.schema.kindMap.Interface.map((type) => { return `export type ${type.name}<$SelectionSet extends SelectionSets.${ renderName(type) }> = InferResult.Interface<$SelectionSet, ${identifiers.Schema}, ${identifiers.Schema}['allTypes']['${type.name}']>` diff --git a/src/generator/generators/SelectionSets.ts b/src/generator/generators/SelectionSets.ts index e77647f8d..30d5c581f 100644 --- a/src/generator/generators/SelectionSets.ts +++ b/src/generator/generators/SelectionSets.ts @@ -1,42 +1,42 @@ // todo: generate in JSDoc how the feature maps to GQL syntax. // todo: on union fields, JSDoc that mentions the syntax `on*` +import { pick } from 'es-toolkit' import { Select } from '../../layers/2_Select/__.js' import { Code } from '../../lib/Code.js' import { Grafaid } from '../../lib/grafaid/__.js' import { analyzeArgsNullability } from '../../lib/grafaid/schema/args.js' import { RootTypeName } from '../../lib/grafaid/schema/schema.js' -import { isString } from '../../lib/prelude.js' +import { entries, isString } from '../../lib/prelude.js' import { borderThinFullWidth } from '../../lib/text.js' import { identifiers } from '../helpers/identifiers.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { createCodeGenerator } from '../helpers/moduleGeneratorRunner.js' import { getDocumentation, renderDocumentation, renderName, title1, typeTitle2SelectionSet } from '../helpers/render.js' +import type { KindRenderers } from '../helpers/types.js' import { ModuleGeneratorScalar } from './Scalar.js' const $ScalarsTypeParameter = `$Scalars extends ${identifiers.$$Utilities}.Schema.Scalar.ScalarMap = {}` -// `$Scalars extends ${identifiers.$$Utilities}.Schema.Scalar.ScalarMap` export const ModuleGeneratorSelectionSets = createModuleGenerator( `SelectionSets`, ({ config, code }) => { - code() + const kindMap = pick(config.schema.kindMap, [`Root`, `Enum`, `InputObject`, `OutputObject`, `Union`, `Interface`]) + const kindEntries = entries(kindMap).filter(_ => _[1].length > 0) + const kinds = kindEntries.map(_ => _[1]) - code(`import type { Select as $Select } from '${config.paths.imports.grafflePackage.schema}'`) code( + `import type { Select as $Select } from '${config.paths.imports.grafflePackage.schema}'`, `import type * as ${identifiers.$$Utilities} from '${config.paths.imports.grafflePackage.utilitiesForGenerated}'`, ) if (Grafaid.Schema.KindMap.hasCustomScalars(config.schema.kindMap)) { code(`import type * as $Scalar from './${ModuleGeneratorScalar.name}.js'`) } code() - code(title1(`Document`)) code() code( `// Prefix with $ because this is not a schema type. A user could have a schema type named "Document" that this would conflict with.`, - ) - code( `export interface $Document<${$ScalarsTypeParameter}> {`, Grafaid.Schema.KindMap.hasQuery(config.schema.kindMap) ? `query?: Record>` : null, Grafaid.Schema.KindMap.hasMutation(config.schema.kindMap) @@ -46,23 +46,11 @@ export const ModuleGeneratorSelectionSets = createModuleGenerator( ) code() - const typesToRender = [ - config.schema.kindMap.GraphQLRootType, - config.schema.kindMap.GraphQLEnumType, - config.schema.kindMap.GraphQLInputObjectType, - config.schema.kindMap.GraphQLInterfaceType, - config.schema.kindMap.GraphQLObjectType, - config.schema.kindMap.GraphQLUnionType, - ].filter(_ => _.length > 0) - - typesToRender.forEach((types) => { - const kind = Grafaid.Schema.getTypeKind(types[0]!) - - code(title1(`${kind} Types`)) + kindEntries.forEach(([name, kind]) => { + code(title1(name)) code() - - types.forEach(type => { - code(GraphQLKindRenderMap[kind]({ config, type: type as never })) + kind.forEach(type => { + code(kindRenderMap[name]({ config, type: type as never })) code() }) }) @@ -76,7 +64,7 @@ export const ModuleGeneratorSelectionSets = createModuleGenerator( * would end up with an error of \`export interface Foo extends Foo ...\` */ `) - code(renderNamedTypesIndex({ config, types: typesToRender.flat() })) + code(renderNamedTypesIndex({ config, types: kinds.flat() })) }, ) @@ -172,7 +160,7 @@ const renderKindInterface = createCodeGenerator<{ type: Grafaid.Schema.Interface }, ) -const renderKindObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>( +const renderKindOutputObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>( ({ config, type, code }) => { const fields = Object.values(type.getFields()) @@ -183,12 +171,13 @@ const renderKindObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType } code() const fieldKeys = fields.map(field => { - const fieldTypeInfo = Grafaid.getTypeNameAndKind(Grafaid.Schema.getNamedType(field.type)) - const fieldKindOrScalarType = fieldTypeInfo.kind === `Scalar` + const fieldTypeInfo = Grafaid.getTypeAndKind(Grafaid.Schema.getNamedType(field.type)) + const fieldTypeKindOrScalarType = fieldTypeInfo.kindName === Grafaid.Schema.KindMap.Name.ScalarCustom + || fieldTypeInfo.kindName === Grafaid.Schema.KindMap.Name.ScalarStandard ? `\`${fieldTypeInfo.name}\` (a \`Scalar\`)` - : fieldTypeInfo.kind + : fieldTypeInfo.kindName const doc = Code.TSDoc(` - Select the \`${field.name}\` field on the \`${type.name}\` object. Its type is ${fieldKindOrScalarType}. + Select the \`${field.name}\` field on the \`${type.name}\` object. Its type is ${fieldTypeKindOrScalarType}. `) const key = H.outputFieldKey( field.name, @@ -231,14 +220,16 @@ const renderKindObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType } }, ) -const GraphQLKindRenderMap = { - GraphQLInputObjectType: renderKindInputObject, - GraphQLRootType: renderKindObject, - GraphQLObjectType: renderKindObject, - GraphQLEnumType: renderKindEnum, - GraphQLInterfaceType: renderKindInterface, - GraphQLUnionType: renderKindUnion, -} +const kindRenderMap = { + OutputObject: renderKindOutputObject, + InputObject: renderKindInputObject, + Enum: renderKindEnum, + Root: renderKindOutputObject, + Interface: renderKindInterface, + Union: renderKindUnion, + ScalarCustom: null, + ScalarStandard: null, +} satisfies KindRenderers const renderOutputField = createCodeGenerator<{ field: Grafaid.Schema.Field }>( ({ config, field, code }) => { diff --git a/src/generator/generators/global.ts b/src/generator/generators/global.ts index 5d264ca9b..bbc06d665 100644 --- a/src/generator/generators/global.ts +++ b/src/generator/generators/global.ts @@ -19,8 +19,8 @@ export const ModuleGeneratorGlobal = createModuleGenerator( `import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js'`, ) - if (config.schema.kindMap.GraphQLScalarTypeCustom.length > 0) { - code(`import type * as ${identifiers.Scalar} from './${ModuleGeneratorScalar.name}.js'`) + if (config.schema.kindMap.ScalarCustom.length > 0) { + code(`import type * as ${identifiers.$Scalar} from './${ModuleGeneratorScalar.name}.js'`) } code() diff --git a/src/generator/helpers/identifiers.ts b/src/generator/helpers/identifiers.ts index 86055164c..b9d364b7a 100644 --- a/src/generator/helpers/identifiers.ts +++ b/src/generator/helpers/identifiers.ts @@ -3,7 +3,7 @@ export const identifiers = { $Schema: `$Schema`, $$Utilities: `$$Utilities`, MethodsRoot: `MethodsRoot`, - Scalar: `Scalar`, + $Scalar: `$Scalar`, CustomScalars: `CustomScalars`, StandardScalar: `StandardScalar`, } diff --git a/src/generator/helpers/render.ts b/src/generator/helpers/render.ts index a5fc67368..7f2170381 100644 --- a/src/generator/helpers/render.ts +++ b/src/generator/helpers/render.ts @@ -1,6 +1,5 @@ import { Code } from '../../lib/Code.js' import { Grafaid } from '../../lib/grafaid/__.js' -import { getNodeDisplayName } from '../../lib/grafaid/graphql.js' import { borderThickFullWidth, borderThinFullWidth, centerTo } from '../../lib/text.js' import type { Config } from '../config/config.js' @@ -26,8 +25,10 @@ export const title1 = (title: string, subTitle?: string) => { } export const typeTitle2 = (category: string) => (type: Grafaid.Schema.NamedTypes) => { - const typeKind = Grafaid.getTypeNameAndKind(type) - const nameOrKind = typeKind.kind === `Scalar` ? typeKind.name : typeKind.kind + const typeKind = Grafaid.getTypeAndKind(type) + const nameOrKind = typeKind.kindName === `ScalarCustom` || typeKind.kindName === `ScalarStandard` + ? typeKind.name + : typeKind.kindName const typeLabel = nameOrKind const title = ` // @@ -48,9 +49,9 @@ export const typeTitle2 = (category: string) => (type: Grafaid.Schema.NamedTypes export const typeTitle2SelectionSet = typeTitle2(`GRAPHQL SELECTION SET`) -export const typeTitle = (config: Config, typeKind: Grafaid.Schema.NamedTypeKind) => { - const hasItems = config.schema.kindMap[`GraphQL${typeKind}Type`].length > 0 - const title = `${typeKind} Types` +export const typeTitle = (config: Config, kindName: Grafaid.Schema.KindMap.KindName) => { + const hasItems = config.schema.kindMap[kindName].length > 0 + const title = `${kindName} Types` const titleDecorated = `// ${title}\n// ${`-`.repeat(title.length)}\n` if (hasItems) { return titleDecorated @@ -59,8 +60,10 @@ export const typeTitle = (config: Config, typeKind: Grafaid.Schema.NamedTypeKind } } -const defaultDescription = (node: Grafaid.Schema.DescribableTypes) => - `There is no documentation for this ${getNodeDisplayName(node)}.` +const defaultDescription = (node: Grafaid.Schema.DescribableTypes) => { + const entity = Grafaid.Schema.isField(node) ? `Field` : Grafaid.getTypeAndKind(node).kindName + return `There is no documentation for this ${entity}.` +} export const renderDocumentation = (config: Config, node: Grafaid.Schema.DescribableTypes) => { return Code.TSDoc(getDocumentation(config, node)) diff --git a/src/generator/helpers/types.ts b/src/generator/helpers/types.ts new file mode 100644 index 000000000..aa55c15d9 --- /dev/null +++ b/src/generator/helpers/types.ts @@ -0,0 +1,3 @@ +import type { Grafaid } from '../../lib/grafaid/__.js' + +export type KindRenderers = Record diff --git a/src/lib/grafaid/graphql.ts b/src/lib/grafaid/graphql.ts index e2613d10b..914fd94ec 100644 --- a/src/lib/grafaid/graphql.ts +++ b/src/lib/grafaid/graphql.ts @@ -8,7 +8,9 @@ import { isUnionType, OperationTypeNode, } from 'graphql' -import type { DescribableTypes, NodeNamePlus } from './schema/schema.js' +import { casesExhausted } from '../prelude.js' +import type { KindMap } from './schema/schema.js' +import { isRootType, isScalarTypeCustom } from './schema/schema.js' export * from './_Nodes.js' export * from './request.js' @@ -63,42 +65,32 @@ export const isStandardScalarType = (type: GraphQLScalarType) => { * Groups */ -export const getTypeNameAndKind = ( +export const getTypeAndKind = ( node: GraphQLNamedType, -): { name: string; kind: 'Object' | 'Interface' | 'Union' | 'Enum' | 'Scalar' } => { +): { + name: string + kindName: KindMap.KindName +} => { const name = node.name - const kind = getNodeKindOld(node).replace(`GraphQL`, ``).replace(`Type`, ``) as - | 'Object' - | 'Interface' - | 'Union' - | 'Enum' - | 'Scalar' - return { name, kind } -} - -export const getNodeKindOld = (node: DescribableTypes): NodeNamePlus => { - switch (true) { - case isObjectType(node): - return `GraphQLObjectType` - case isInputObjectType(node): - return `GraphQLInputObjectType` - case isUnionType(node): - return `GraphQLUnionType` - case isInterfaceType(node): - return `GraphQLInterfaceType` - case isEnumType(node): - return `GraphQLEnumType` - case isScalarType(node): - return `GraphQLScalarType` - default: - return `GraphQLField` - } -} -export const getNodeDisplayName = (node: DescribableTypes) => { - return toDisplayName(getNodeKindOld(node)) -} + let kindName: KindMap.KindName -const toDisplayName = (nodeName: NodeNamePlus) => { - return nodeName.replace(/^GraphQL/, ``).replace(/Type$/, ``) + if (isRootType(node)) { + kindName = `Root` + } else if (isScalarType(node)) { + kindName = isScalarTypeCustom(node) ? `ScalarCustom` : `ScalarStandard` + } else if (isUnionType(node)) { + kindName = `Union` + } else if (isInterfaceType(node)) { + kindName = `Interface` + } else if (isObjectType(node)) { + kindName = `OutputObject` + } else if (isInputObjectType(node)) { + kindName = `InputObject` + } else if (isEnumType(node)) { + kindName = `Enum` + } else { + throw casesExhausted(node) + } + return { name, kindName } } diff --git a/src/lib/grafaid/schema/kindMap.ts b/src/lib/grafaid/schema/KindMap/_.ts similarity index 51% rename from src/lib/grafaid/schema/kindMap.ts rename to src/lib/grafaid/schema/KindMap/_.ts index bf0dc53c6..62dc1b478 100644 --- a/src/lib/grafaid/schema/kindMap.ts +++ b/src/lib/grafaid/schema/KindMap/_.ts @@ -7,59 +7,64 @@ import { type GraphQLSchema, GraphQLUnionType, } from 'graphql' -import { isScalarTypeAndCustom, type NameToClassNamedType } from './schema.js' +import { isScalarTypeAndCustom } from '../schema.js' -export type KindMap = - & { - [Name in keyof NameToClassNamedType]: InstanceType[] - } - & { GraphQLRootType: GraphQLObjectType[] } - & { GraphQLScalarTypeCustom: GraphQLScalarType[] } - & { GraphQLScalarTypeStandard: GraphQLScalarType[] } +import type { KindMap } from './__.js' + +export const Name = { + Root: `Root`, + ScalarCustom: `ScalarCustom`, + ScalarStandard: `ScalarStandard`, + Enum: `Enum`, + InputObject: `InputObject`, + OutputObject: `OutputObject`, + Interface: `Interface`, + Union: `Union`, +} satisfies Record + +export type KindName = keyof KindMap export const getKindMap = (schema: GraphQLSchema): KindMap => { const typeMap = schema.getTypeMap() const typeMapValues = Object.values(typeMap) const kindMap: KindMap = { - GraphQLRootType: [], - GraphQLScalarType: [], - GraphQLScalarTypeCustom: [], - GraphQLScalarTypeStandard: [], - GraphQLEnumType: [], - GraphQLInputObjectType: [], - GraphQLInterfaceType: [], - GraphQLObjectType: [], - GraphQLUnionType: [], + Root: [], + OutputObject: [], + InputObject: [], + Interface: [], + Union: [], + Enum: [], + ScalarCustom: [], + ScalarStandard: [], } for (const type of typeMapValues) { if (type.name.startsWith(`__`)) continue switch (true) { case type instanceof GraphQLScalarType: - kindMap.GraphQLScalarType.push(type) if (isScalarTypeAndCustom(type)) { - kindMap.GraphQLScalarTypeCustom.push(type) + kindMap.ScalarCustom.push(type) } else { - kindMap.GraphQLScalarTypeStandard.push(type) + kindMap.ScalarStandard.push(type) } break case type instanceof GraphQLEnumType: - kindMap.GraphQLEnumType.push(type) + kindMap.Enum.push(type) break case type instanceof GraphQLInputObjectType: - kindMap.GraphQLInputObjectType.push(type) + kindMap.InputObject.push(type) break case type instanceof GraphQLInterfaceType: - kindMap.GraphQLInterfaceType.push(type) + kindMap.Interface.push(type) break case type instanceof GraphQLObjectType: if (type.name === `Query` || type.name === `Mutation` || type.name === `Subscription`) { - kindMap.GraphQLRootType.push(type) + kindMap.Root.push(type) } else { - kindMap.GraphQLObjectType.push(type) + kindMap.OutputObject.push(type) } break case type instanceof GraphQLUnionType: - kindMap.GraphQLUnionType.push(type) + kindMap.Union.push(type) break default: // skip @@ -69,19 +74,18 @@ export const getKindMap = (schema: GraphQLSchema): KindMap => { return kindMap } -export const hasMutation = (typeMapByKind: KindMap) => typeMapByKind.GraphQLRootType.find((_) => _.name === `Mutation`) +export const hasMutation = (typeMapByKind: KindMap) => typeMapByKind.Root.some((_) => _.name === `Mutation`) -export const hasSubscription = (typeMapByKind: KindMap) => - typeMapByKind.GraphQLRootType.find((_) => _.name === `Subscription`) +export const hasSubscription = (typeMapByKind: KindMap) => typeMapByKind.Root.some((_) => _.name === `Subscription`) -export const hasQuery = (typeMapByKind: KindMap) => typeMapByKind.GraphQLRootType.find((_) => _.name === `Query`) +export const hasQuery = (typeMapByKind: KindMap) => typeMapByKind.Root.some((_) => _.name === `Query`) + +export const hasCustomScalars = (typeMapByKind: KindMap) => { + return typeMapByKind.ScalarCustom.length > 0 +} export const getInterfaceImplementors = (typeMap: KindMap, interfaceTypeSearch: GraphQLInterfaceType) => { - return typeMap.GraphQLObjectType.filter(objectType => + return typeMap.OutputObject.filter(objectType => objectType.getInterfaces().filter(interfaceType => interfaceType.name === interfaceTypeSearch.name).length > 0 ) } - -export const hasCustomScalars = (typeMapByKind: KindMap) => { - return typeMapByKind.GraphQLScalarTypeCustom.length > 0 -} diff --git a/src/lib/grafaid/schema/KindMap/__.ts b/src/lib/grafaid/schema/KindMap/__.ts new file mode 100644 index 000000000..cf67d3df5 --- /dev/null +++ b/src/lib/grafaid/schema/KindMap/__.ts @@ -0,0 +1,21 @@ +import type { + GraphQLEnumType, + GraphQLInputObjectType, + GraphQLInterfaceType, + GraphQLObjectType, + GraphQLScalarType, + GraphQLUnionType, +} from 'graphql' + +export * as KindMap from './_.js' + +export interface KindMap { + Root: GraphQLObjectType[] + OutputObject: GraphQLObjectType[] + InputObject: GraphQLInputObjectType[] + Interface: GraphQLInterfaceType[] + Union: GraphQLUnionType[] + Enum: GraphQLEnumType[] + ScalarCustom: GraphQLScalarType[] + ScalarStandard: GraphQLScalarType[] +} diff --git a/src/lib/grafaid/schema/customScalars.ts b/src/lib/grafaid/schema/customScalars.ts index a2c51e91a..ae056dbad 100644 --- a/src/lib/grafaid/schema/customScalars.ts +++ b/src/lib/grafaid/schema/customScalars.ts @@ -12,12 +12,12 @@ import { } from 'graphql' import type { GraphQLInputObjectType, GraphQLNamedOutputType } from 'graphql' import { casesExhausted } from '../../prelude.js' -import { isGraphQLArgumentOrInputField, isGraphQLField, isScalarTypeAndCustom } from './schema.js' +import { isInputFieldLike, isOutputField, isScalarTypeAndCustom } from './schema.js' export const isHasCustomScalars = ( node: GraphQLNamedOutputType | GraphQLField | GraphQLInputObjectType | GraphQLInputField | GraphQLArgument, ): boolean => { - if (isInputObjectType(node) || isGraphQLArgumentOrInputField(node)) { + if (isInputObjectType(node) || isInputFieldLike(node)) { return isHasCustomScalarInputs(node) } @@ -36,7 +36,7 @@ const isHasCustomScalarOutputs_ = ( node: GraphQLNamedOutputType | GraphQLField, typePath: string[], ): boolean => { - if (isGraphQLField(node)) { + if (isOutputField(node)) { const fieldType = getNamedType(node.type) return isHasCustomScalarOutputs_(fieldType, typePath) } @@ -82,11 +82,11 @@ const isHasCustomScalarInputs_ = ( node: GraphQLInputObjectType | GraphQLNamedOutputType | GraphQLArgument | GraphQLField, typePath: string[], ): boolean => { - if (isGraphQLArgumentOrInputField(node)) { + if (isInputFieldLike(node)) { return isHasCustomScalarInputs_(getNamedType(node.type), typePath) } - if (isGraphQLField(node)) { + if (isOutputField(node)) { const fieldType = getNamedType(node.type) return node.args.some(arg => isHasCustomScalarInputs_(arg, typePath)) || (isObjectType(fieldType) && isHasCustomScalarInputs_(fieldType, typePath)) diff --git a/src/lib/grafaid/schema/schema.ts b/src/lib/grafaid/schema/schema.ts index dc32bab60..fcccfb9b3 100644 --- a/src/lib/grafaid/schema/schema.ts +++ b/src/lib/grafaid/schema/schema.ts @@ -58,7 +58,7 @@ export { export * as Args from './args.js' export * as CustomScalars from './customScalars.js' -export * as KindMap from './kindMap.js' +export * from './KindMap/__.js' export type DeprecatableNodes = GraphQLEnumValue | InputOrOutputField @@ -93,15 +93,17 @@ export type DescribableTypes = | GraphQLNamedType | InputOrOutputField -export const isGraphQLOutputField = (object: object): object is GraphQLField => { - return `args` in object -} +type InputFieldLikeTypes = GraphQLArgument | GraphQLInputField -export const isGraphQLArgumentOrInputField = (value: object): value is GraphQLArgument | GraphQLInputField => { +export const isInputFieldLike = (value: object): value is InputFieldLikeTypes => { return `defaultValue` in value } -export const isGraphQLField = (value: object): value is GraphQLField => { +export const isField = (value: object): value is GraphQLField | InputFieldLikeTypes => { + return isOutputField(value) || isInputFieldLike(value) +} + +export const isOutputField = (value: object): value is GraphQLField => { return `args` in value } @@ -166,8 +168,6 @@ export const isRootType = (value: unknown): value is GraphQLObjectType => { export type NodeName = keyof NameToClass -export type NodeNamePlus = NodeName | 'GraphQLField' - // export type AnyClass = InstanceType // dprint-ignore diff --git a/src/types/Schema/nodes/OutputField.ts b/src/types/Schema/nodes/OutputField.ts index 899921b93..9bc3c23cd 100644 --- a/src/types/Schema/nodes/OutputField.ts +++ b/src/types/Schema/nodes/OutputField.ts @@ -9,7 +9,7 @@ import type { OutputObject } from './OutputObject.js' import type { ScalarCodecless } from './Scalar/_.js' import type { Union } from './Union.js' -export type Field< +export type OutputField< $Name extends string, $Type extends OutputTypes, $Args extends Args | null, @@ -29,10 +29,10 @@ type FieldType = | Nullable | OutputObject | Union - | Interface | null>>, [any, ...any[]]> + | Interface | null>>, [any, ...any[]]> // todo test non null interface fields -export type SomeField = Field | null> +export type SomeField = OutputField | null> export type SomeFields<$Keys extends SomeKey = SomeKey> = Record<$Keys, SomeField> diff --git a/src/types/Schema/nodes/OutputObject.ts b/src/types/Schema/nodes/OutputObject.ts index 8d9789965..f2eb417e0 100644 --- a/src/types/Schema/nodes/OutputObject.ts +++ b/src/types/Schema/nodes/OutputObject.ts @@ -1,5 +1,5 @@ import type { __typename } from './__typename.js' -import type { Field, SomeFields } from './OutputField.js' +import type { OutputField, SomeFields } from './OutputField.js' export interface OutputObject< $Name extends string = string, @@ -7,6 +7,6 @@ export interface OutputObject< > { kind: 'Object' fields: { - __typename: Field<'__typename', __typename<$Name>, null> + __typename: OutputField<'__typename', __typename<$Name>, null> } & $Fields } diff --git a/src/types/SchemaDrivenDataMap/InlineType.ts b/src/types/SchemaDrivenDataMap/InlineType.ts new file mode 100644 index 000000000..18527a85e --- /dev/null +++ b/src/types/SchemaDrivenDataMap/InlineType.ts @@ -0,0 +1,13 @@ +/** + * Inline types for a field-like (directive argument, field argument, input/output field) type. + * + * Recursive tuple. Each nesting represents a list. First tuple member represents nullability of the list. + * + * The outer most tuple DOES NOT represent a list, but the nullability of the named type itself. E.g. `[0]` would indicate + * that a scalar field is nullable while `[1]` would indicate that it is non-nullable. + */ +export type InlineType = [Nullable | NonNull, InlineType?] + +export type Nullable = 0 + +export type NonNull = 1 diff --git a/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts b/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts index 390c2de28..9c3ecf9f3 100644 --- a/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts +++ b/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts @@ -1,6 +1,9 @@ import type { Grafaid } from '../../lib/grafaid/__.js' import { isString } from '../../lib/prelude.js' import { Schema } from '../Schema/__.js' +import type { InlineType } from './InlineType.js' + +export * from './InlineType.js' declare global { namespace GraffleGlobal { @@ -114,20 +117,6 @@ export const propertyNames = { nt: `nt`, } as const -/** - * Inline types for a field-like (directive argument, field argument, input/output field) type. - * - * Nested tuple. Each nesting represents a list. First tuple member represents nullability of the list. - * - * The outer most tuple represents not a list but the nullability for the named type itself. E.g. `[0]` would indicate - * that a scalar field is nullable while `[1]` would indicate that it is non-nullable. - */ -export type InlineType = [Nullable | NonNull, InlineType?] - -export type Nullable = 0 - -export type NonNull = 1 - export const isEnum = ( node?: Node, ): node is Enum => { diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/Global.ts b/tests/_/schemas/kitchen-sink/graffle/modules/Global.ts index 0089c3a62..429d77e68 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/Global.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/Global.ts @@ -2,7 +2,7 @@ import type * as Data from './Data.js' import type * as MethodsDocument from './MethodsDocument.js' import type * as MethodsRoot from './MethodsRoot.js' import type * as MethodsSelect from './MethodsSelect.js' -import type * as Scalar from './Scalar.js' +import type * as $Scalar from './Scalar.js' import type { Schema } from './Schema.js' declare global { diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts index 8f12ae488..8c26b9ecb 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts @@ -73,7 +73,7 @@ export interface Query { // // // ================================================================================================== -// Object +// OutputObject // ================================================================================================== // // diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts b/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts index 489914d2c..c0e669a3d 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts @@ -21,19 +21,19 @@ export namespace Schema { // export type Mutation = $.StandardTypes.Mutation<{ - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - idNonNull: $.Field<'idNonNull', $Scalar.ID, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + idNonNull: $.OutputField<'idNonNull', $Scalar.ID, null> }> export type Query = $.StandardTypes.Query<{ - InputObjectNested: $.Field< + InputObjectNested: $.OutputField< 'InputObjectNested', $.Nullable<$Scalar.ID>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - InputObjectNestedNonNull: $.Field< + InputObjectNestedNonNull: $.OutputField< 'InputObjectNestedNonNull', $.Nullable<$Scalar.ID>, $.Args<{ @@ -43,93 +43,93 @@ export namespace Schema { /** * Query enum field documentation. */ - abcEnum: $.Field<'abcEnum', $.Nullable, null> - argInputObjectCircular: $.Field< + abcEnum: $.OutputField<'abcEnum', $.Nullable, null> + argInputObjectCircular: $.OutputField< 'argInputObjectCircular', $.Nullable<$Scalar.String>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - date: $.Field<'date', $.Nullable<$Scalar.Date>, null> - dateArg: $.Field< + date: $.OutputField<'date', $.Nullable<$Scalar.Date>, null> + dateArg: $.OutputField< 'dateArg', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.Nullable<$Scalar.Date>> }, true> > - dateArgInputObject: $.Field< + dateArgInputObject: $.OutputField< 'dateArgInputObject', $.Nullable<$Scalar.Date>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - dateArgList: $.Field< + dateArgList: $.OutputField< 'dateArgList', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.Nullable<$.List<$Scalar.Date>>> }, true> > - dateArgNonNull: $.Field< + dateArgNonNull: $.OutputField< 'dateArgNonNull', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$Scalar.Date> }, false> > - dateArgNonNullList: $.Field< + dateArgNonNullList: $.OutputField< 'dateArgNonNullList', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.List<$.Nullable<$Scalar.Date>>> }, false> > - dateArgNonNullListNonNull: $.Field< + dateArgNonNullListNonNull: $.OutputField< 'dateArgNonNullListNonNull', $.Nullable<$Scalar.Date>, $.Args<{ date: $.InputField<$.List<$Scalar.Date>> }, false> > - dateInterface1: $.Field<'dateInterface1', $.Nullable, null> - dateList: $.Field<'dateList', $.Nullable<$.List<$Scalar.Date>>, null> - dateListList: $.Field<'dateListList', $.Nullable<$.List<$.List<$Scalar.Date>>>, null> - dateListNonNull: $.Field<'dateListNonNull', $.List<$Scalar.Date>, null> - dateNonNull: $.Field<'dateNonNull', $Scalar.Date, null> - dateObject1: $.Field<'dateObject1', $.Nullable, null> - dateUnion: $.Field<'dateUnion', $.Nullable, null> - error: $.Field< + dateInterface1: $.OutputField<'dateInterface1', $.Nullable, null> + dateList: $.OutputField<'dateList', $.Nullable<$.List<$Scalar.Date>>, null> + dateListList: $.OutputField<'dateListList', $.Nullable<$.List<$.List<$Scalar.Date>>>, null> + dateListNonNull: $.OutputField<'dateListNonNull', $.List<$Scalar.Date>, null> + dateNonNull: $.OutputField<'dateNonNull', $Scalar.Date, null> + dateObject1: $.OutputField<'dateObject1', $.Nullable, null> + dateUnion: $.OutputField<'dateUnion', $.Nullable, null> + error: $.OutputField< 'error', $.Nullable<$Scalar.String>, $.Args<{ case: $.InputField<$.Nullable<$Scalar.String>> }, true> > - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - idNonNull: $.Field<'idNonNull', $Scalar.ID, null> - interface: $.Field<'interface', $.Nullable, null> - interfaceNonNull: $.Field<'interfaceNonNull', Interface, null> - interfaceWithArgs: $.Field< + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + idNonNull: $.OutputField<'idNonNull', $Scalar.ID, null> + interface: $.OutputField<'interface', $.Nullable, null> + interfaceNonNull: $.OutputField<'interfaceNonNull', Interface, null> + interfaceWithArgs: $.OutputField< 'interfaceWithArgs', $.Nullable, $.Args<{ id: $.InputField<$Scalar.ID> }, false> > - listInt: $.Field<'listInt', $.Nullable<$.List<$.Nullable<$Scalar.Int>>>, null> - listIntNonNull: $.Field<'listIntNonNull', $.List<$Scalar.Int>, null> - listListInt: $.Field<'listListInt', $.Nullable<$.List<$.Nullable<$.List<$.Nullable<$Scalar.Int>>>>>, null> - listListIntNonNull: $.Field<'listListIntNonNull', $.List<$.List<$Scalar.Int>>, null> - lowerCaseUnion: $.Field<'lowerCaseUnion', $.Nullable, null> - object: $.Field<'object', $.Nullable, null> - objectList: $.Field<'objectList', $.Nullable<$.List>, null> - objectListNonNull: $.Field<'objectListNonNull', $.List, null> - objectNested: $.Field<'objectNested', $.Nullable, null> - objectNonNull: $.Field<'objectNonNull', Object1, null> - objectWithArgs: $.Field< + listInt: $.OutputField<'listInt', $.Nullable<$.List<$.Nullable<$Scalar.Int>>>, null> + listIntNonNull: $.OutputField<'listIntNonNull', $.List<$Scalar.Int>, null> + listListInt: $.OutputField<'listListInt', $.Nullable<$.List<$.Nullable<$.List<$.Nullable<$Scalar.Int>>>>>, null> + listListIntNonNull: $.OutputField<'listListIntNonNull', $.List<$.List<$Scalar.Int>>, null> + lowerCaseUnion: $.OutputField<'lowerCaseUnion', $.Nullable, null> + object: $.OutputField<'object', $.Nullable, null> + objectList: $.OutputField<'objectList', $.Nullable<$.List>, null> + objectListNonNull: $.OutputField<'objectListNonNull', $.List, null> + objectNested: $.OutputField<'objectNested', $.Nullable, null> + objectNonNull: $.OutputField<'objectNonNull', Object1, null> + objectWithArgs: $.OutputField< 'objectWithArgs', $.Nullable, $.Args<{ @@ -140,36 +140,36 @@ export namespace Schema { string: $.InputField<$.Nullable<$Scalar.String>> }, true> > - result: $.Field< + result: $.OutputField< 'result', $.Nullable, $.Args<{ case: $.InputField }, false> > - resultNonNull: $.Field< + resultNonNull: $.OutputField< 'resultNonNull', Result, $.Args<{ case: $.InputField<$.Nullable> }, true> > - string: $.Field<'string', $.Nullable<$Scalar.String>, null> - stringWithArgEnum: $.Field< + string: $.OutputField<'string', $.Nullable<$Scalar.String>, null> + stringWithArgEnum: $.OutputField< 'stringWithArgEnum', $.Nullable<$Scalar.String>, $.Args<{ ABCEnum: $.InputField<$.Nullable> }, true> > - stringWithArgInputObject: $.Field< + stringWithArgInputObject: $.OutputField< 'stringWithArgInputObject', $.Nullable<$Scalar.String>, $.Args<{ input: $.InputField<$.Nullable> }, true> > - stringWithArgInputObjectRequired: $.Field< + stringWithArgInputObjectRequired: $.OutputField< 'stringWithArgInputObjectRequired', $.Nullable<$Scalar.String>, $.Args<{ @@ -179,7 +179,7 @@ export namespace Schema { /** * The given arguments are reflected back as a JSON string. */ - stringWithArgs: $.Field< + stringWithArgs: $.OutputField< 'stringWithArgs', $.Nullable<$Scalar.String>, $.Args<{ @@ -190,38 +190,38 @@ export namespace Schema { string: $.InputField<$.Nullable<$Scalar.String>> }, true> > - stringWithListArg: $.Field< + stringWithListArg: $.OutputField< 'stringWithListArg', $.Nullable<$Scalar.String>, $.Args<{ ints: $.InputField<$.Nullable<$.List<$.Nullable<$Scalar.Int>>>> }, true> > - stringWithListArgRequired: $.Field< + stringWithListArgRequired: $.OutputField< 'stringWithListArgRequired', $.Nullable<$Scalar.String>, $.Args<{ ints: $.InputField<$.List<$Scalar.Int>> }, false> > - stringWithRequiredArg: $.Field< + stringWithRequiredArg: $.OutputField< 'stringWithRequiredArg', $.Nullable<$Scalar.String>, $.Args<{ string: $.InputField<$Scalar.String> }, false> > - unionFooBar: $.Field<'unionFooBar', $.Nullable, null> - unionFooBarNonNull: $.Field<'unionFooBarNonNull', FooBarUnion, null> - unionFooBarWithArgs: $.Field< + unionFooBar: $.OutputField<'unionFooBar', $.Nullable, null> + unionFooBarNonNull: $.OutputField<'unionFooBarNonNull', FooBarUnion, null> + unionFooBarWithArgs: $.OutputField< 'unionFooBarWithArgs', $.Nullable, $.Args<{ id: $.InputField<$.Nullable<$Scalar.ID>> }, true> > - unionObject: $.Field<'unionObject', $.Nullable, null> - unionObjectNonNull: $.Field<'unionObjectNonNull', ObjectUnion, null> + unionObject: $.OutputField<'unionObject', $.Nullable, null> + unionObjectNonNull: $.OutputField<'unionObjectNonNull', ObjectUnion, null> }> // @@ -231,7 +231,7 @@ export namespace Schema { // // // ================================================================================================== - // Enum + // OutputObject // ================================================================================================== // // @@ -240,17 +240,75 @@ export namespace Schema { // // + export type Bar = $.OutputObject<'Bar', { + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + }> + + export type DateObject1 = $.OutputObject<'DateObject1', { + date1: $.OutputField<'date1', $.Nullable<$Scalar.Date>, null> + }> + + export type DateObject2 = $.OutputObject<'DateObject2', { + date2: $.OutputField<'date2', $.Nullable<$Scalar.Date>, null> + }> + + export type ErrorOne = $.OutputObject<'ErrorOne', { + infoId: $.OutputField<'infoId', $.Nullable<$Scalar.ID>, null> + message: $.OutputField<'message', $Scalar.String, null> + }> + + export type ErrorTwo = $.OutputObject<'ErrorTwo', { + infoInt: $.OutputField<'infoInt', $.Nullable<$Scalar.Int>, null> + message: $.OutputField<'message', $Scalar.String, null> + }> + /** - * Enum documentation. - * - * Members - * "A" - (DEPRECATED: Enum value A is deprecated.) - * "B" - Enum B member documentation. - * "C" - (DEPRECATED: Enum value C is deprecated.) + * Object documentation. */ - export type ABCEnum = $.Enum<'ABCEnum', ['A', 'B', 'C']> + export type Foo = $.OutputObject<'Foo', { + /** + * Field documentation. + * + * @deprecated Field a is deprecated. + */ + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + }> - export type Case = $.Enum<'Case', ['ErrorOne', 'ErrorTwo', 'Object1']> + export type Object1 = $.OutputObject<'Object1', { + ABCEnum: $.OutputField<'ABCEnum', $.Nullable, null> + boolean: $.OutputField<'boolean', $.Nullable<$Scalar.Boolean>, null> + float: $.OutputField<'float', $.Nullable<$Scalar.Float>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + string: $.OutputField<'string', $.Nullable<$Scalar.String>, null> + }> + + export type Object1ImplementingInterface = $.OutputObject<'Object1ImplementingInterface', { + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + }> + + export type Object2ImplementingInterface = $.OutputObject<'Object2ImplementingInterface', { + boolean: $.OutputField<'boolean', $.Nullable<$Scalar.Boolean>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + }> + + export type ObjectNested = $.OutputObject<'ObjectNested', { + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + object: $.OutputField<'object', $.Nullable, null> + }> + + export type ObjectUnion = $.OutputObject<'ObjectUnion', { + fooBarUnion: $.OutputField<'fooBarUnion', $.Nullable, null> + }> + + export type lowerCaseObject = $.OutputObject<'lowerCaseObject', { + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + }> + + export type lowerCaseObject2 = $.OutputObject<'lowerCaseObject2', { + int: $.OutputField<'int', $.Nullable<$Scalar.Int>, null> + }> // // @@ -305,15 +363,15 @@ export namespace Schema { // export type DateInterface1 = $.Interface<'DateInterface1', { - date1: $.Field<'date1', $.Nullable<$Scalar.Date>, null> + date1: $.OutputField<'date1', $.Nullable<$Scalar.Date>, null> }, [DateObject1]> export type Error = $.Interface<'Error', { - message: $.Field<'message', $Scalar.String, null> + message: $.OutputField<'message', $Scalar.String, null> }, [ErrorOne, ErrorTwo]> export type Interface = $.Interface<'Interface', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> }, [Object1ImplementingInterface, Object2ImplementingInterface]> // @@ -323,7 +381,7 @@ export namespace Schema { // // // ================================================================================================== - // Object + // Union // ================================================================================================== // // @@ -332,75 +390,16 @@ export namespace Schema { // // - export type Bar = $.OutputObject<'Bar', { - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - }> - - export type DateObject1 = $.OutputObject<'DateObject1', { - date1: $.Field<'date1', $.Nullable<$Scalar.Date>, null> - }> - - export type DateObject2 = $.OutputObject<'DateObject2', { - date2: $.Field<'date2', $.Nullable<$Scalar.Date>, null> - }> - - export type ErrorOne = $.OutputObject<'ErrorOne', { - infoId: $.Field<'infoId', $.Nullable<$Scalar.ID>, null> - message: $.Field<'message', $Scalar.String, null> - }> - - export type ErrorTwo = $.OutputObject<'ErrorTwo', { - infoInt: $.Field<'infoInt', $.Nullable<$Scalar.Int>, null> - message: $.Field<'message', $Scalar.String, null> - }> + export type DateUnion = $.Union<'DateUnion', [DateObject1, DateObject2]> /** - * Object documentation. + * Union documentation. */ - export type Foo = $.OutputObject<'Foo', { - /** - * Field documentation. - * - * @deprecated Field a is deprecated. - */ - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - }> - - export type Object1 = $.OutputObject<'Object1', { - ABCEnum: $.Field<'ABCEnum', $.Nullable, null> - boolean: $.Field<'boolean', $.Nullable<$Scalar.Boolean>, null> - float: $.Field<'float', $.Nullable<$Scalar.Float>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - string: $.Field<'string', $.Nullable<$Scalar.String>, null> - }> - - export type Object1ImplementingInterface = $.OutputObject<'Object1ImplementingInterface', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - }> - - export type Object2ImplementingInterface = $.OutputObject<'Object2ImplementingInterface', { - boolean: $.Field<'boolean', $.Nullable<$Scalar.Boolean>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - }> - - export type ObjectNested = $.OutputObject<'ObjectNested', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - object: $.Field<'object', $.Nullable, null> - }> - - export type ObjectUnion = $.OutputObject<'ObjectUnion', { - fooBarUnion: $.Field<'fooBarUnion', $.Nullable, null> - }> + export type FooBarUnion = $.Union<'FooBarUnion', [Bar, Foo]> - export type lowerCaseObject = $.OutputObject<'lowerCaseObject', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - }> + export type Result = $.Union<'Result', [ErrorOne, ErrorTwo, Object1]> - export type lowerCaseObject2 = $.OutputObject<'lowerCaseObject2', { - int: $.Field<'int', $.Nullable<$Scalar.Int>, null> - }> + export type lowerCaseUnion = $.Union<'lowerCaseUnion', [lowerCaseObject, lowerCaseObject2]> // // @@ -409,7 +408,7 @@ export namespace Schema { // // // ================================================================================================== - // Union + // Enum // ================================================================================================== // // @@ -418,16 +417,17 @@ export namespace Schema { // // - export type DateUnion = $.Union<'DateUnion', [DateObject1, DateObject2]> - /** - * Union documentation. + * Enum documentation. + * + * Members + * "A" - (DEPRECATED: Enum value A is deprecated.) + * "B" - Enum B member documentation. + * "C" - (DEPRECATED: Enum value C is deprecated.) */ - export type FooBarUnion = $.Union<'FooBarUnion', [Bar, Foo]> - - export type Result = $.Union<'Result', [ErrorOne, ErrorTwo, Object1]> + export type ABCEnum = $.Enum<'ABCEnum', ['A', 'B', 'C']> - export type lowerCaseUnion = $.Union<'lowerCaseUnion', [lowerCaseObject, lowerCaseObject2]> + export type Case = $.Enum<'Case', ['ErrorOne', 'ErrorTwo', 'Object1']> } // diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts index f780d455b..0d9497821 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts @@ -1,4 +1,4 @@ -import type * as $Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $Scalar from './Scalar.js' // // @@ -7,7 +7,7 @@ import * as $Scalar from './Scalar.js' // // // ================================================================================================== -// GraphQLScalarTypeStandard +// ScalarStandard // ================================================================================================== // // @@ -33,7 +33,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLScalarTypeCustom +// ScalarCustom // ================================================================================================== // // @@ -51,7 +51,7 @@ const Date = 'Date' // // // ================================================================================================== -// GraphQLEnumType +// Enum // ================================================================================================== // // @@ -60,12 +60,12 @@ const Date = 'Date' // // -const ABCEnum: $Utilities.SchemaDrivenDataMap.Enum = { +const ABCEnum: $$Utilities.SchemaDrivenDataMap.Enum = { k: 'enum', n: 'ABCEnum', } -const Case: $Utilities.SchemaDrivenDataMap.Enum = { +const Case: $$Utilities.SchemaDrivenDataMap.Enum = { k: 'enum', n: 'Case', } @@ -77,7 +77,7 @@ const Case: $Utilities.SchemaDrivenDataMap.Enum = { // // // ================================================================================================== -// GraphQLInputObjectType +// InputObject // ================================================================================================== // // @@ -86,7 +86,7 @@ const Case: $Utilities.SchemaDrivenDataMap.Enum = { // // -const InputObject: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObject: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObject', fcs: ['date', 'dateRequired'], f: { @@ -101,7 +101,7 @@ const InputObject: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const InputObjectCircular: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObjectCircular: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObjectCircular', fcs: ['circular', 'date'], f: { @@ -114,7 +114,7 @@ const InputObjectCircular: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const InputObjectNested: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObjectNested: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObjectNested', fcs: ['InputObject'], f: { @@ -124,7 +124,7 @@ const InputObjectNested: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const InputObjectNestedNonNull: $Utilities.SchemaDrivenDataMap.InputObject = { +const InputObjectNestedNonNull: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'InputObjectNestedNonNull', fcs: ['InputObject'], f: { @@ -141,7 +141,7 @@ const InputObjectNestedNonNull: $Utilities.SchemaDrivenDataMap.InputObject = { // // // ================================================================================================== -// GraphQLObjectType +// OutputObject // ================================================================================================== // // @@ -150,13 +150,13 @@ const InputObjectNestedNonNull: $Utilities.SchemaDrivenDataMap.InputObject = { // // -const Bar: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Bar: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { int: {}, }, } -const DateObject1: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateObject1: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { date1: { nt: Date, @@ -164,7 +164,7 @@ const DateObject1: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const DateObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateObject2: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { date2: { nt: Date, @@ -172,27 +172,27 @@ const DateObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const ErrorOne: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ErrorOne: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { infoId: {}, message: {}, }, } -const ErrorTwo: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ErrorTwo: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { infoInt: {}, message: {}, }, } -const Foo: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Foo: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, }, } -const Object1: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Object1: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { ABCEnum: {}, boolean: {}, @@ -203,21 +203,21 @@ const Object1: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const Object1ImplementingInterface: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Object1ImplementingInterface: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, int: {}, }, } -const Object2ImplementingInterface: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Object2ImplementingInterface: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { boolean: {}, id: {}, }, } -const ObjectNested: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ObjectNested: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, object: { @@ -226,7 +226,7 @@ const ObjectNested: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const ObjectUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const ObjectUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { fooBarUnion: { // nt: FooBarUnion, <-- Assigned later to avoid potential circular dependency. @@ -234,13 +234,13 @@ const ObjectUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const lowerCaseObject: $Utilities.SchemaDrivenDataMap.OutputObject = { +const lowerCaseObject: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, }, } -const lowerCaseObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { +const lowerCaseObject2: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { int: {}, }, @@ -253,7 +253,7 @@ const lowerCaseObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLInterfaceType +// Interface // ================================================================================================== // // @@ -262,17 +262,17 @@ const lowerCaseObject2: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const DateInterface1: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateInterface1: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { ...DateObject1.f, }, } -const Error: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Error: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } -const Interface: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Interface: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } @@ -283,7 +283,7 @@ const Interface: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLUnionType +// Union // ================================================================================================== // // @@ -292,22 +292,22 @@ const Interface: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const DateUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const DateUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { ...DateObject1.f, ...DateObject2.f, }, } -const FooBarUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const FooBarUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } -const Result: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Result: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } -const lowerCaseUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { +const lowerCaseUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } @@ -318,7 +318,7 @@ const lowerCaseUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLRootType +// Root // ================================================================================================== // // @@ -327,14 +327,14 @@ const lowerCaseUnion: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, idNonNull: {}, }, } -const Query: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { InputObjectNested: { a: { @@ -685,7 +685,7 @@ Query.f[`unionObjectNonNull`]!.nt = ObjectUnion // // -const $schemaDrivenDataMap: $Utilities.SchemaDrivenDataMap = { +const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { roots: { Mutation, Query, diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts b/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts index 86107abad..fc1fdb314 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts @@ -46,8 +46,8 @@ export namespace Select { 'Mutation' > export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // Object Types - // ------------ + // OutputObject Types + // ------------------ export type Bar<$SelectionSet extends SelectionSets.Bar> = InferResult.Object< $SelectionSet, Schema, diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts b/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts index c670f146d..3833ab58c 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts @@ -31,7 +31,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // ================================================================================================== -// GraphQLObjectType Types +// Root // ================================================================================================== // // @@ -45,7 +45,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Mutation // -------------------------------------------------------------------------------------------------- @@ -56,11 +56,11 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap export interface Mutation<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { /** - * Select the `id` field on the `Mutation` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Mutation` object. Its type is ScalarStandard. */ id?: Mutation.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `Scalar`). + * Select the `idNonNull` field on the `Mutation` object. Its type is ScalarStandard. */ idNonNull?: Mutation.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -141,7 +141,7 @@ export namespace Mutation { // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- @@ -152,13 +152,13 @@ export namespace Mutation { export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { /** - * Select the `InputObjectNested` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `InputObjectNested` field on the `Query` object. Its type is ScalarStandard. */ InputObjectNested?: | Query.InputObjectNested$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `InputObjectNestedNonNull` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `InputObjectNestedNonNull` field on the `Query` object. Its type is ScalarStandard. */ InputObjectNestedNonNull?: | Query.InputObjectNestedNonNull<$Scalars> @@ -168,41 +168,41 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ abcEnum?: Query.abcEnum$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `argInputObjectCircular` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `argInputObjectCircular` field on the `Query` object. Its type is ScalarStandard. */ argInputObjectCircular?: | Query.argInputObjectCircular$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `date` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `date` field on the `Query` object. Its type is ScalarCustom. */ date?: Query.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArg` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArg` field on the `Query` object. Its type is ScalarCustom. */ dateArg?: Query.dateArg$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgInputObject` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgInputObject` field on the `Query` object. Its type is ScalarCustom. */ dateArgInputObject?: | Query.dateArgInputObject$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgList` field on the `Query` object. Its type is ScalarCustom. */ dateArgList?: Query.dateArgList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateArgNonNull?: Query.dateArgNonNull<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgNonNullList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgNonNullList` field on the `Query` object. Its type is ScalarCustom. */ dateArgNonNullList?: | Query.dateArgNonNullList<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateArgNonNullListNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateArgNonNullListNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateArgNonNullListNonNull?: | Query.dateArgNonNullListNonNull<$Scalars> @@ -214,25 +214,25 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.dateInterface1$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateList` field on the `Query` object. Its type is ScalarCustom. */ dateList?: Query.dateList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateListList` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateListList` field on the `Query` object. Its type is ScalarCustom. */ dateListList?: Query.dateListList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateListNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateListNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateListNonNull?: | Query.dateListNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). + * Select the `dateNonNull` field on the `Query` object. Its type is ScalarCustom. */ dateNonNull?: Query.dateNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `dateObject1` field on the `Query` object. Its type is Object. + * Select the `dateObject1` field on the `Query` object. Its type is OutputObject. */ dateObject1?: Query.dateObject1$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** @@ -240,15 +240,15 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ dateUnion?: Query.dateUnion$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `error` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `error` field on the `Query` object. Its type is ScalarStandard. */ error?: Query.error$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Query` object. Its type is ScalarStandard. */ id?: Query.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `idNonNull` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `idNonNull` field on the `Query` object. Its type is ScalarStandard. */ idNonNull?: Query.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** @@ -268,21 +268,21 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.interfaceWithArgs<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listInt` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listInt` field on the `Query` object. Its type is ScalarStandard. */ listInt?: Query.listInt$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listIntNonNull` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listIntNonNull` field on the `Query` object. Its type is ScalarStandard. */ listIntNonNull?: | Query.listIntNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listListInt` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listListInt` field on the `Query` object. Its type is ScalarStandard. */ listListInt?: Query.listListInt$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `listListIntNonNull` field on the `Query` object. Its type is `Int` (a `Scalar`). + * Select the `listListIntNonNull` field on the `Query` object. Its type is ScalarStandard. */ listListIntNonNull?: | Query.listListIntNonNull$Expanded<$Scalars> @@ -294,31 +294,31 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.lowerCaseUnion$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `object` field on the `Query` object. Its type is Object. + * Select the `object` field on the `Query` object. Its type is OutputObject. */ object?: Query.$object$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectList` field on the `Query` object. Its type is Object. + * Select the `objectList` field on the `Query` object. Its type is OutputObject. */ objectList?: Query.objectList$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectListNonNull` field on the `Query` object. Its type is Object. + * Select the `objectListNonNull` field on the `Query` object. Its type is OutputObject. */ objectListNonNull?: | Query.objectListNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectNested` field on the `Query` object. Its type is Object. + * Select the `objectNested` field on the `Query` object. Its type is OutputObject. */ objectNested?: Query.objectNested$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectNonNull` field on the `Query` object. Its type is Object. + * Select the `objectNonNull` field on the `Query` object. Its type is OutputObject. */ objectNonNull?: | Query.objectNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `objectWithArgs` field on the `Query` object. Its type is Object. + * Select the `objectWithArgs` field on the `Query` object. Its type is OutputObject. */ objectWithArgs?: | Query.objectWithArgs$Expanded<$Scalars> @@ -334,47 +334,47 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.resultNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `string` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `string` field on the `Query` object. Its type is ScalarStandard. */ string?: Query.$string$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgEnum` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgEnum` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgEnum?: | Query.stringWithArgEnum$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgInputObject` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgInputObject` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgInputObject?: | Query.stringWithArgInputObject$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgInputObjectRequired` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgInputObjectRequired` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgInputObjectRequired?: | Query.stringWithArgInputObjectRequired<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithArgs` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithArgs` field on the `Query` object. Its type is ScalarStandard. */ stringWithArgs?: | Query.stringWithArgs$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithListArg` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithListArg` field on the `Query` object. Its type is ScalarStandard. */ stringWithListArg?: | Query.stringWithListArg$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithListArgRequired` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithListArgRequired` field on the `Query` object. Its type is ScalarStandard. */ stringWithListArgRequired?: | Query.stringWithListArgRequired<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `stringWithRequiredArg` field on the `Query` object. Its type is `String` (a `Scalar`). + * Select the `stringWithRequiredArg` field on the `Query` object. Its type is ScalarStandard. */ stringWithRequiredArg?: | Query.stringWithRequiredArg<$Scalars> @@ -396,11 +396,11 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} | Query.unionFooBarWithArgs$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `unionObject` field on the `Query` object. Its type is Object. + * Select the `unionObject` field on the `Query` object. Its type is OutputObject. */ unionObject?: Query.unionObject$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `unionObjectNonNull` field on the `Query` object. Its type is Object. + * Select the `unionObjectNonNull` field on the `Query` object. Its type is OutputObject. */ unionObjectNonNull?: | Query.unionObjectNonNull$Expanded<$Scalars> @@ -1748,7 +1748,7 @@ export namespace Query { // // // ================================================================================================== -// GraphQLEnumType Types +// Enum // ================================================================================================== // // @@ -1776,7 +1776,7 @@ export type Case = 'ErrorOne' | 'ErrorTwo' | 'Object1' // // // ================================================================================================== -// GraphQLInputObjectType Types +// InputObject // ================================================================================================== // // @@ -1824,195 +1824,7 @@ export interface InputObjectNestedNonNull<$Scalars extends $$Utilities.Schema.Sc // // // ================================================================================================== -// GraphQLInterfaceType Types -// ================================================================================================== -// -// -// -// -// -// - -// Interface Type: DateInterface1 -// -------------------------------------------------------------------------------------------------- - -export interface DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ - date1?: DateInterface1.date1<$Scalars> - ___on_DateObject1?: DateObject1<$Scalars> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | DateInterface1$FragmentInline<$Scalars> - | DateInterface1$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, - * the name is one of the implementor type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface DateInterface1$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends DateInterface1<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -export namespace DateInterface1 { - export type date1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | date1$SelectionSet<$Scalars> - - export interface date1$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `date1` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type date1$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | date1$SelectionSet<$Scalars> - > -} - -// Interface Type: Error -// -------------------------------------------------------------------------------------------------- - -export interface Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { - message?: Error.message<$Scalars> - ___on_ErrorOne?: ErrorOne<$Scalars> - ___on_ErrorTwo?: ErrorTwo<$Scalars> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Error$FragmentInline<$Scalars> - | Error$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, - * the name is one of the implementor type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Error$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Error<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -export namespace Error { - export type message<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | message$SelectionSet<$Scalars> - - export interface message$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `message` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type message$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | message$SelectionSet<$Scalars> - > -} - -// Interface Type: Interface -// -------------------------------------------------------------------------------------------------- - -export interface Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { - id?: Interface.id<$Scalars> - ___on_Object1ImplementingInterface?: Object1ImplementingInterface<$Scalars> - ___on_Object2ImplementingInterface?: Object2ImplementingInterface<$Scalars> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Interface$FragmentInline<$Scalars> - | Interface$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, - * the name is one of the implementor type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Interface$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Interface<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -export namespace Interface { - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `id` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > -} - -// -// -// -// -// -// -// ================================================================================================== -// GraphQLObjectType Types +// OutputObject // ================================================================================================== // // @@ -2026,7 +1838,7 @@ export namespace Interface { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Bar // -------------------------------------------------------------------------------------------------- @@ -2037,7 +1849,7 @@ export namespace Interface { export interface Bar<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `int` field on the `Bar` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `Bar` object. Its type is ScalarStandard. */ int?: Bar.int$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2096,7 +1908,7 @@ export namespace Bar { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // DateObject1 // -------------------------------------------------------------------------------------------------- @@ -2109,7 +1921,7 @@ export interface DateObject1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMa extends $Select.Bases.ObjectLike { /** - * Select the `date1` field on the `DateObject1` object. Its type is `Date` (a `Scalar`). + * Select the `date1` field on the `DateObject1` object. Its type is ScalarCustom. */ date1?: DateObject1.date1$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2168,7 +1980,7 @@ export namespace DateObject1 { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // DateObject2 // -------------------------------------------------------------------------------------------------- @@ -2181,7 +1993,7 @@ export interface DateObject2<$Scalars extends $$Utilities.Schema.Scalar.ScalarMa extends $Select.Bases.ObjectLike { /** - * Select the `date2` field on the `DateObject2` object. Its type is `Date` (a `Scalar`). + * Select the `date2` field on the `DateObject2` object. Its type is ScalarCustom. */ date2?: DateObject2.date2$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2240,7 +2052,7 @@ export namespace DateObject2 { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ErrorOne // -------------------------------------------------------------------------------------------------- @@ -2251,11 +2063,11 @@ export namespace DateObject2 { export interface ErrorOne<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `infoId` field on the `ErrorOne` object. Its type is `ID` (a `Scalar`). + * Select the `infoId` field on the `ErrorOne` object. Its type is ScalarStandard. */ infoId?: ErrorOne.infoId$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `message` field on the `ErrorOne` object. Its type is `String` (a `Scalar`). + * Select the `message` field on the `ErrorOne` object. Its type is ScalarStandard. */ message?: ErrorOne.message$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2336,7 +2148,7 @@ export namespace ErrorOne { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ErrorTwo // -------------------------------------------------------------------------------------------------- @@ -2347,11 +2159,11 @@ export namespace ErrorOne { export interface ErrorTwo<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `infoInt` field on the `ErrorTwo` object. Its type is `Int` (a `Scalar`). + * Select the `infoInt` field on the `ErrorTwo` object. Its type is ScalarStandard. */ infoInt?: ErrorTwo.infoInt$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `message` field on the `ErrorTwo` object. Its type is `String` (a `Scalar`). + * Select the `message` field on the `ErrorTwo` object. Its type is ScalarStandard. */ message?: ErrorTwo.message$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2432,7 +2244,7 @@ export namespace ErrorTwo { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Foo // -------------------------------------------------------------------------------------------------- @@ -2446,7 +2258,7 @@ export namespace ErrorTwo { */ export interface Foo<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `Foo` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Foo` object. Its type is ScalarStandard. */ id?: Foo.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2505,7 +2317,7 @@ export namespace Foo { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Object1 // -------------------------------------------------------------------------------------------------- @@ -2520,23 +2332,23 @@ export interface Object1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = */ ABCEnum?: Object1.ABCEnum$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `boolean` field on the `Object1` object. Its type is `Boolean` (a `Scalar`). + * Select the `boolean` field on the `Object1` object. Its type is ScalarStandard. */ boolean?: Object1.$boolean$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `float` field on the `Object1` object. Its type is `Float` (a `Scalar`). + * Select the `float` field on the `Object1` object. Its type is ScalarStandard. */ float?: Object1.float$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Object1` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Object1` object. Its type is ScalarStandard. */ id?: Object1.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `int` field on the `Object1` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `Object1` object. Its type is ScalarStandard. */ int?: Object1.int$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `string` field on the `Object1` object. Its type is `String` (a `Scalar`). + * Select the `string` field on the `Object1` object. Its type is ScalarStandard. */ string?: Object1.$string$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -2705,7 +2517,7 @@ export namespace Object1 { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Object1ImplementingInterface // -------------------------------------------------------------------------------------------------- @@ -2718,13 +2530,13 @@ export interface Object1ImplementingInterface<$Scalars extends $$Utilities.Schem extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `Object1ImplementingInterface` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Object1ImplementingInterface` object. Its type is ScalarStandard. */ id?: | Object1ImplementingInterface.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `int` field on the `Object1ImplementingInterface` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `Object1ImplementingInterface` object. Its type is ScalarStandard. */ int?: | Object1ImplementingInterface.int$Expanded<$Scalars> @@ -2807,7 +2619,7 @@ export namespace Object1ImplementingInterface { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Object2ImplementingInterface // -------------------------------------------------------------------------------------------------- @@ -2820,13 +2632,13 @@ export interface Object2ImplementingInterface<$Scalars extends $$Utilities.Schem extends $Select.Bases.ObjectLike { /** - * Select the `boolean` field on the `Object2ImplementingInterface` object. Its type is `Boolean` (a `Scalar`). + * Select the `boolean` field on the `Object2ImplementingInterface` object. Its type is ScalarStandard. */ boolean?: | Object2ImplementingInterface.$boolean$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Object2ImplementingInterface` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Object2ImplementingInterface` object. Its type is ScalarStandard. */ id?: | Object2ImplementingInterface.id$Expanded<$Scalars> @@ -2909,7 +2721,7 @@ export namespace Object2ImplementingInterface { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ObjectNested // -------------------------------------------------------------------------------------------------- @@ -2922,11 +2734,11 @@ export interface ObjectNested<$Scalars extends $$Utilities.Schema.Scalar.ScalarM extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `ObjectNested` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `ObjectNested` object. Its type is ScalarStandard. */ id?: ObjectNested.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `object` field on the `ObjectNested` object. Its type is Object. + * Select the `object` field on the `ObjectNested` object. Its type is OutputObject. */ object?: ObjectNested.$object$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -3004,7 +2816,7 @@ export namespace ObjectNested { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // ObjectUnion // -------------------------------------------------------------------------------------------------- @@ -3077,7 +2889,7 @@ export namespace ObjectUnion { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // lowerCaseObject // -------------------------------------------------------------------------------------------------- @@ -3090,7 +2902,7 @@ export interface lowerCaseObject<$Scalars extends $$Utilities.Schema.Scalar.Scal extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `lowerCaseObject` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `lowerCaseObject` object. Its type is ScalarStandard. */ id?: lowerCaseObject.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -3149,7 +2961,7 @@ export namespace lowerCaseObject { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // lowerCaseObject2 // -------------------------------------------------------------------------------------------------- @@ -3162,7 +2974,7 @@ export interface lowerCaseObject2<$Scalars extends $$Utilities.Schema.Scalar.Sca extends $Select.Bases.ObjectLike { /** - * Select the `int` field on the `lowerCaseObject2` object. Its type is `Int` (a `Scalar`). + * Select the `int` field on the `lowerCaseObject2` object. Its type is ScalarStandard. */ int?: lowerCaseObject2.int$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -3223,7 +3035,7 @@ export namespace lowerCaseObject2 { // // // ================================================================================================== -// GraphQLUnionType Types +// Union // ================================================================================================== // // @@ -3356,6 +3168,194 @@ export interface lowerCaseUnion$FragmentInline<$Scalars extends $$Utilities.Sche extends lowerCaseUnion<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields {} +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// + +// Interface Type: DateInterface1 +// -------------------------------------------------------------------------------------------------- + +export interface DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.ObjectLike +{ + date1?: DateInterface1.date1<$Scalars> + ___on_DateObject1?: DateObject1<$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | DateInterface1$FragmentInline<$Scalars> + | DateInterface1$FragmentInline<$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface DateInterface1$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends DateInterface1<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields +{} + +export namespace DateInterface1 { + export type date1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | date1$SelectionSet<$Scalars> + + export interface date1$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `date1` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type date1$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | date1$SelectionSet<$Scalars> + > +} + +// Interface Type: Error +// -------------------------------------------------------------------------------------------------- + +export interface Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { + message?: Error.message<$Scalars> + ___on_ErrorOne?: ErrorOne<$Scalars> + ___on_ErrorTwo?: ErrorTwo<$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Error$FragmentInline<$Scalars> + | Error$FragmentInline<$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Error$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends Error<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields +{} + +export namespace Error { + export type message<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | message$SelectionSet<$Scalars> + + export interface message$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `message` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type message$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | message$SelectionSet<$Scalars> + > +} + +// Interface Type: Interface +// -------------------------------------------------------------------------------------------------- + +export interface Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { + id?: Interface.id<$Scalars> + ___on_Object1ImplementingInterface?: Object1ImplementingInterface<$Scalars> + ___on_Object2ImplementingInterface?: Object2ImplementingInterface<$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Interface$FragmentInline<$Scalars> + | Interface$FragmentInline<$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Interface$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends Interface<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields +{} + +export namespace Interface { + export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<$Scalars> + + export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<$Scalars> + > +} + /** * [1] These definitions serve to allow field selection interfaces to extend their respective object type without * name clashing between the field name and the object name. @@ -3377,9 +3377,6 @@ export namespace $NamedTypes { > export type $InputObjectNestedNonNull<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = InputObjectNestedNonNull<$Scalars> - export type $DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateInterface1<$Scalars> - export type $Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Error<$Scalars> - export type $Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Interface<$Scalars> export type $Bar<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Bar<$Scalars> export type $DateObject1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateObject1<$Scalars> export type $DateObject2<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateObject2<$Scalars> @@ -3399,4 +3396,7 @@ export namespace $NamedTypes { export type $FooBarUnion<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = FooBarUnion<$Scalars> export type $Result<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Result<$Scalars> export type $lowerCaseUnion<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = lowerCaseUnion<$Scalars> + export type $DateInterface1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateInterface1<$Scalars> + export type $Error<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Error<$Scalars> + export type $Interface<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Interface<$Scalars> } diff --git a/tests/_/schemas/mutation-only/graffle/modules/MethodsSelect.ts b/tests/_/schemas/mutation-only/graffle/modules/MethodsSelect.ts index 24587dab8..f8fc9c2b1 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/MethodsSelect.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/MethodsSelect.ts @@ -40,3 +40,51 @@ export interface $MethodsSelect { export interface Mutation { <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet } + +// +// +// +// +// +// +// ================================================================================================== +// OutputObject +// ================================================================================================== +// +// +// +// +// +// + +// +// +// +// +// +// +// ================================================================================================== +// Union +// ================================================================================================== +// +// +// +// +// +// + +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// diff --git a/tests/_/schemas/mutation-only/graffle/modules/Schema.ts b/tests/_/schemas/mutation-only/graffle/modules/Schema.ts index b8a8f3f0f..d911b95f1 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/Schema.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/Schema.ts @@ -21,8 +21,8 @@ export namespace Schema { // export type Mutation = $.StandardTypes.Mutation<{ - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - idNonNull: $.Field<'idNonNull', $Scalar.ID, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + idNonNull: $.OutputField<'idNonNull', $Scalar.ID, null> }> // @@ -32,7 +32,7 @@ export namespace Schema { // // // ================================================================================================== - // Enum + // OutputObject // ================================================================================================== // // @@ -86,7 +86,7 @@ export namespace Schema { // // // ================================================================================================== - // Object + // Union // ================================================================================================== // // @@ -104,7 +104,7 @@ export namespace Schema { // // // ================================================================================================== - // Union + // Enum // ================================================================================================== // // diff --git a/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts index 498788118..cff96ae6c 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts @@ -1,4 +1,4 @@ -import type * as $Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $Scalar from './Scalar.js' // // @@ -7,7 +7,7 @@ import * as $Scalar from './Scalar.js' // // // ================================================================================================== -// GraphQLScalarTypeStandard +// ScalarStandard // ================================================================================================== // // @@ -33,7 +33,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLScalarTypeCustom +// ScalarCustom // ================================================================================================== // // @@ -42,7 +42,7 @@ const String = $Scalar.String // // -// None of your GraphQLScalarTypeCustoms have custom scalars. +// None of your ScalarCustoms have custom scalars. // // @@ -51,7 +51,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLEnumType +// Enum // ================================================================================================== // // @@ -60,7 +60,7 @@ const String = $Scalar.String // // -// None of your GraphQLEnumTypes have custom scalars. +// None of your Enums have custom scalars. // // @@ -69,7 +69,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLInputObjectType +// InputObject // ================================================================================================== // // @@ -78,7 +78,7 @@ const String = $Scalar.String // // -// None of your GraphQLInputObjectTypes have custom scalars. +// None of your InputObjects have custom scalars. // // @@ -87,7 +87,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLObjectType +// OutputObject // ================================================================================================== // // @@ -96,7 +96,7 @@ const String = $Scalar.String // // -// None of your GraphQLObjectTypes have custom scalars. +// None of your OutputObjects have custom scalars. // // @@ -105,7 +105,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLInterfaceType +// Interface // ================================================================================================== // // @@ -114,7 +114,7 @@ const String = $Scalar.String // // -// None of your GraphQLInterfaceTypes have custom scalars. +// None of your Interfaces have custom scalars. // // @@ -123,7 +123,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLUnionType +// Union // ================================================================================================== // // @@ -132,7 +132,7 @@ const String = $Scalar.String // // -// None of your GraphQLUnionTypes have custom scalars. +// None of your Unions have custom scalars. // // @@ -141,7 +141,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLRootType +// Root // ================================================================================================== // // @@ -150,7 +150,7 @@ const String = $Scalar.String // // -const Mutation: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, idNonNull: {}, @@ -192,7 +192,7 @@ const Mutation: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const $schemaDrivenDataMap: $Utilities.SchemaDrivenDataMap = { +const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { roots: { Mutation, }, diff --git a/tests/_/schemas/mutation-only/graffle/modules/Select.ts b/tests/_/schemas/mutation-only/graffle/modules/Select.ts index 72d06ef3f..d1945bb22 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/Select.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/Select.ts @@ -45,8 +45,8 @@ export namespace Select { Schema, 'Mutation' > - // Object Types - // ------------ + // OutputObject Types + // ------------------ // -- None -- diff --git a/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts b/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts index 8c0f2f13e..57011dd15 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts @@ -29,7 +29,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // ================================================================================================== -// GraphQLObjectType Types +// Root // ================================================================================================== // // @@ -43,7 +43,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Mutation // -------------------------------------------------------------------------------------------------- @@ -54,11 +54,11 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap export interface Mutation<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { /** - * Select the `id` field on the `Mutation` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Mutation` object. Its type is ScalarStandard. */ id?: Mutation.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `Scalar`). + * Select the `idNonNull` field on the `Mutation` object. Its type is ScalarStandard. */ idNonNull?: Mutation.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> diff --git a/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts b/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts index aa9f12c3b..f6147989d 100644 --- a/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts +++ b/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts @@ -63,7 +63,7 @@ export interface Query { // // // ================================================================================================== -// Object +// OutputObject // ================================================================================================== // // diff --git a/tests/_/schemas/pokemon/graffle/modules/Schema.ts b/tests/_/schemas/pokemon/graffle/modules/Schema.ts index 4dd97e4bf..fccbce32f 100644 --- a/tests/_/schemas/pokemon/graffle/modules/Schema.ts +++ b/tests/_/schemas/pokemon/graffle/modules/Schema.ts @@ -21,7 +21,7 @@ export namespace Schema { // export type Mutation = $.StandardTypes.Mutation<{ - addPokemon: $.Field< + addPokemon: $.OutputField< 'addPokemon', $.Nullable, $.Args<{ @@ -35,31 +35,31 @@ export namespace Schema { }> export type Query = $.StandardTypes.Query<{ - battles: $.Field<'battles', $.List, null> - beings: $.Field<'beings', $.List, null> - pokemon: $.Field<'pokemon', $.Nullable<$.List>, null> - pokemonByName: $.Field< + battles: $.OutputField<'battles', $.List, null> + beings: $.OutputField<'beings', $.List, null> + pokemon: $.OutputField<'pokemon', $.Nullable<$.List>, null> + pokemonByName: $.OutputField< 'pokemonByName', $.Nullable<$.List>, $.Args<{ name: $.InputField<$Scalar.String> }, false> > - pokemons: $.Field< + pokemons: $.OutputField< 'pokemons', $.Nullable<$.List>, $.Args<{ filter: $.InputField<$.Nullable> }, true> > - trainerByName: $.Field< + trainerByName: $.OutputField< 'trainerByName', $.Nullable, $.Args<{ name: $.InputField<$Scalar.String> }, false> > - trainers: $.Field<'trainers', $.Nullable<$.List>, null> + trainers: $.OutputField<'trainers', $.Nullable<$.List>, null> }> // @@ -69,7 +69,7 @@ export namespace Schema { // // // ================================================================================================== - // Enum + // OutputObject // ================================================================================================== // // @@ -78,28 +78,64 @@ export namespace Schema { // // - export type BattleWildResult = $.Enum<'BattleWildResult', ['pokemonsCaptured', 'pokemonsDefeated', 'trainerDefeated']> + export type BattleRoyale = $.OutputObject<'BattleRoyale', { + combatants: $.OutputField<'combatants', $.Nullable<$.List>, null> + date: $.OutputField<'date', $.Nullable<$Scalar.Float>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + winner: $.OutputField<'winner', $.Nullable, null> + }> - export type PokemonType = $.Enum<'PokemonType', ['bug', 'electric', 'fire', 'grass', 'water']> + export type BattleTrainer = $.OutputObject<'BattleTrainer', { + combatant1: $.OutputField<'combatant1', $.Nullable, null> + combatant2: $.OutputField<'combatant2', $.Nullable, null> + date: $.OutputField<'date', $.Nullable<$Scalar.Float>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + winner: $.OutputField<'winner', $.Nullable, null> + }> - export type TrainerClass = $.Enum< - 'TrainerClass', - [ - 'bugCatcher', - 'camper', - 'picnicker', - 'psychic', - 'psychicMedium', - 'psychicYoungster', - 'sailor', - 'superNerd', - 'tamer', - 'teamRocketGrunt', - 'triathlete', - 'youngster', - 'youth', - ] - > + export type BattleWild = $.OutputObject<'BattleWild', { + date: $.OutputField<'date', $.Nullable<$Scalar.Float>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + pokemon: $.OutputField<'pokemon', $.Nullable, null> + result: $.OutputField<'result', $.Nullable, null> + trainer: $.OutputField<'trainer', $.Nullable, null> + wildPokemons: $.OutputField<'wildPokemons', $.Nullable<$.List>, null> + }> + + export type CombatantMultiPokemon = $.OutputObject<'CombatantMultiPokemon', { + pokemons: $.OutputField<'pokemons', $.Nullable<$.List>, null> + trainer: $.OutputField<'trainer', $.Nullable, null> + }> + + export type CombatantSinglePokemon = $.OutputObject<'CombatantSinglePokemon', { + pokemon: $.OutputField<'pokemon', $.Nullable, null> + trainer: $.OutputField<'trainer', $.Nullable, null> + }> + + export type Patron = $.OutputObject<'Patron', { + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + money: $.OutputField<'money', $.Nullable<$Scalar.Int>, null> + name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> + }> + + export type Pokemon = $.OutputObject<'Pokemon', { + attack: $.OutputField<'attack', $.Nullable<$Scalar.Int>, null> + birthday: $.OutputField<'birthday', $.Nullable<$Scalar.Int>, null> + defense: $.OutputField<'defense', $.Nullable<$Scalar.Int>, null> + hp: $.OutputField<'hp', $.Nullable<$Scalar.Int>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> + trainer: $.OutputField<'trainer', $.Nullable, null> + type: $.OutputField<'type', $.Nullable, null> + }> + + export type Trainer = $.OutputObject<'Trainer', { + class: $.OutputField<'class', $.Nullable, null> + fans: $.OutputField<'fans', $.Nullable<$.List>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> + pokemon: $.OutputField<'pokemon', $.Nullable<$.List>, null> + }> // // @@ -149,8 +185,8 @@ export namespace Schema { // export type Being = $.Interface<'Being', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - name: $.Field<'name', $.Nullable<$Scalar.String>, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> }, [Patron, Pokemon, Trainer]> // @@ -160,7 +196,7 @@ export namespace Schema { // // // ================================================================================================== - // Object + // Union // ================================================================================================== // // @@ -169,64 +205,7 @@ export namespace Schema { // // - export type BattleRoyale = $.OutputObject<'BattleRoyale', { - combatants: $.Field<'combatants', $.Nullable<$.List>, null> - date: $.Field<'date', $.Nullable<$Scalar.Float>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - winner: $.Field<'winner', $.Nullable, null> - }> - - export type BattleTrainer = $.OutputObject<'BattleTrainer', { - combatant1: $.Field<'combatant1', $.Nullable, null> - combatant2: $.Field<'combatant2', $.Nullable, null> - date: $.Field<'date', $.Nullable<$Scalar.Float>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - winner: $.Field<'winner', $.Nullable, null> - }> - - export type BattleWild = $.OutputObject<'BattleWild', { - date: $.Field<'date', $.Nullable<$Scalar.Float>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - pokemon: $.Field<'pokemon', $.Nullable, null> - result: $.Field<'result', $.Nullable, null> - trainer: $.Field<'trainer', $.Nullable, null> - wildPokemons: $.Field<'wildPokemons', $.Nullable<$.List>, null> - }> - - export type CombatantMultiPokemon = $.OutputObject<'CombatantMultiPokemon', { - pokemons: $.Field<'pokemons', $.Nullable<$.List>, null> - trainer: $.Field<'trainer', $.Nullable, null> - }> - - export type CombatantSinglePokemon = $.OutputObject<'CombatantSinglePokemon', { - pokemon: $.Field<'pokemon', $.Nullable, null> - trainer: $.Field<'trainer', $.Nullable, null> - }> - - export type Patron = $.OutputObject<'Patron', { - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - money: $.Field<'money', $.Nullable<$Scalar.Int>, null> - name: $.Field<'name', $.Nullable<$Scalar.String>, null> - }> - - export type Pokemon = $.OutputObject<'Pokemon', { - attack: $.Field<'attack', $.Nullable<$Scalar.Int>, null> - birthday: $.Field<'birthday', $.Nullable<$Scalar.Int>, null> - defense: $.Field<'defense', $.Nullable<$Scalar.Int>, null> - hp: $.Field<'hp', $.Nullable<$Scalar.Int>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - name: $.Field<'name', $.Nullable<$Scalar.String>, null> - trainer: $.Field<'trainer', $.Nullable, null> - type: $.Field<'type', $.Nullable, null> - }> - - export type Trainer = $.OutputObject<'Trainer', { - class: $.Field<'class', $.Nullable, null> - fans: $.Field<'fans', $.Nullable<$.List>, null> - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - name: $.Field<'name', $.Nullable<$Scalar.String>, null> - pokemon: $.Field<'pokemon', $.Nullable<$.List>, null> - }> + export type Battle = $.Union<'Battle', [BattleRoyale, BattleTrainer, BattleWild]> // // @@ -235,7 +214,7 @@ export namespace Schema { // // // ================================================================================================== - // Union + // Enum // ================================================================================================== // // @@ -244,7 +223,28 @@ export namespace Schema { // // - export type Battle = $.Union<'Battle', [BattleRoyale, BattleTrainer, BattleWild]> + export type BattleWildResult = $.Enum<'BattleWildResult', ['pokemonsCaptured', 'pokemonsDefeated', 'trainerDefeated']> + + export type PokemonType = $.Enum<'PokemonType', ['bug', 'electric', 'fire', 'grass', 'water']> + + export type TrainerClass = $.Enum< + 'TrainerClass', + [ + 'bugCatcher', + 'camper', + 'picnicker', + 'psychic', + 'psychicMedium', + 'psychicYoungster', + 'sailor', + 'superNerd', + 'tamer', + 'teamRocketGrunt', + 'triathlete', + 'youngster', + 'youth', + ] + > } // diff --git a/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts index f630ce24c..15dfec0c6 100644 --- a/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts @@ -1,4 +1,4 @@ -import type * as $Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $Scalar from './Scalar.js' // // @@ -7,7 +7,7 @@ import * as $Scalar from './Scalar.js' // // // ================================================================================================== -// GraphQLScalarTypeStandard +// ScalarStandard // ================================================================================================== // // @@ -33,7 +33,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLScalarTypeCustom +// ScalarCustom // ================================================================================================== // // @@ -42,7 +42,7 @@ const String = $Scalar.String // // -// None of your GraphQLScalarTypeCustoms have custom scalars. +// None of your ScalarCustoms have custom scalars. // // @@ -51,7 +51,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLEnumType +// Enum // ================================================================================================== // // @@ -60,17 +60,17 @@ const String = $Scalar.String // // -const BattleWildResult: $Utilities.SchemaDrivenDataMap.Enum = { +const BattleWildResult: $$Utilities.SchemaDrivenDataMap.Enum = { k: 'enum', n: 'BattleWildResult', } -const PokemonType: $Utilities.SchemaDrivenDataMap.Enum = { +const PokemonType: $$Utilities.SchemaDrivenDataMap.Enum = { k: 'enum', n: 'PokemonType', } -const TrainerClass: $Utilities.SchemaDrivenDataMap.Enum = { +const TrainerClass: $$Utilities.SchemaDrivenDataMap.Enum = { k: 'enum', n: 'TrainerClass', } @@ -82,7 +82,7 @@ const TrainerClass: $Utilities.SchemaDrivenDataMap.Enum = { // // // ================================================================================================== -// GraphQLInputObjectType +// InputObject // ================================================================================================== // // @@ -91,7 +91,7 @@ const TrainerClass: $Utilities.SchemaDrivenDataMap.Enum = { // // -const DateFilter: $Utilities.SchemaDrivenDataMap.InputObject = { +const DateFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'DateFilter', f: { gte: {}, @@ -99,7 +99,7 @@ const DateFilter: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const PokemonFilter: $Utilities.SchemaDrivenDataMap.InputObject = { +const PokemonFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'PokemonFilter', f: { birthday: {}, @@ -107,7 +107,7 @@ const PokemonFilter: $Utilities.SchemaDrivenDataMap.InputObject = { }, } -const StringFilter: $Utilities.SchemaDrivenDataMap.InputObject = { +const StringFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { n: 'StringFilter', f: { contains: {}, @@ -122,7 +122,7 @@ const StringFilter: $Utilities.SchemaDrivenDataMap.InputObject = { // // // ================================================================================================== -// GraphQLObjectType +// OutputObject // ================================================================================================== // // @@ -131,7 +131,7 @@ const StringFilter: $Utilities.SchemaDrivenDataMap.InputObject = { // // -const BattleRoyale: $Utilities.SchemaDrivenDataMap.OutputObject = { +const BattleRoyale: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { combatants: { // nt: CombatantMultiPokemon, <-- Assigned later to avoid potential circular dependency. @@ -144,7 +144,7 @@ const BattleRoyale: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const BattleTrainer: $Utilities.SchemaDrivenDataMap.OutputObject = { +const BattleTrainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { combatant1: { // nt: CombatantSinglePokemon, <-- Assigned later to avoid potential circular dependency. @@ -160,7 +160,7 @@ const BattleTrainer: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const BattleWild: $Utilities.SchemaDrivenDataMap.OutputObject = { +const BattleWild: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { date: {}, id: {}, @@ -177,7 +177,7 @@ const BattleWild: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const CombatantMultiPokemon: $Utilities.SchemaDrivenDataMap.OutputObject = { +const CombatantMultiPokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { pokemons: { // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. @@ -188,7 +188,7 @@ const CombatantMultiPokemon: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const CombatantSinglePokemon: $Utilities.SchemaDrivenDataMap.OutputObject = { +const CombatantSinglePokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { pokemon: { // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. @@ -199,7 +199,7 @@ const CombatantSinglePokemon: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const Patron: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Patron: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, money: {}, @@ -207,7 +207,7 @@ const Patron: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const Pokemon: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Pokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { attack: {}, birthday: {}, @@ -222,7 +222,7 @@ const Pokemon: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const Trainer: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Trainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { class: {}, fans: { @@ -243,7 +243,7 @@ const Trainer: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLInterfaceType +// Interface // ================================================================================================== // // @@ -252,7 +252,7 @@ const Trainer: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Being: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Being: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } @@ -263,7 +263,7 @@ const Being: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLUnionType +// Union // ================================================================================================== // // @@ -272,7 +272,7 @@ const Being: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Battle: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Battle: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: {}, } @@ -283,7 +283,7 @@ const Battle: $Utilities.SchemaDrivenDataMap.OutputObject = { // // // ================================================================================================== -// GraphQLRootType +// Root // ================================================================================================== // // @@ -292,7 +292,7 @@ const Battle: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { addPokemon: { a: { @@ -322,7 +322,7 @@ const Mutation: $Utilities.SchemaDrivenDataMap.OutputObject = { }, } -const Query: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { battles: { // nt: Battle, <-- Assigned later to avoid potential circular dependency. @@ -423,7 +423,7 @@ Query.f[`trainers`]!.nt = Trainer // // -const $schemaDrivenDataMap: $Utilities.SchemaDrivenDataMap = { +const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { roots: { Mutation, Query, diff --git a/tests/_/schemas/pokemon/graffle/modules/Select.ts b/tests/_/schemas/pokemon/graffle/modules/Select.ts index a1f5a3f42..f8835b596 100644 --- a/tests/_/schemas/pokemon/graffle/modules/Select.ts +++ b/tests/_/schemas/pokemon/graffle/modules/Select.ts @@ -46,8 +46,8 @@ export namespace Select { 'Mutation' > export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // Object Types - // ------------ + // OutputObject Types + // ------------------ export type BattleRoyale<$SelectionSet extends SelectionSets.BattleRoyale> = InferResult.Object< $SelectionSet, Schema, diff --git a/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts b/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts index 8a808daf6..cd2aed183 100644 --- a/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts @@ -30,7 +30,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // ================================================================================================== -// GraphQLObjectType Types +// Root // ================================================================================================== // // @@ -44,7 +44,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Mutation // -------------------------------------------------------------------------------------------------- @@ -55,7 +55,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap export interface Mutation<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { /** - * Select the `addPokemon` field on the `Mutation` object. Its type is Object. + * Select the `addPokemon` field on the `Mutation` object. Its type is OutputObject. */ addPokemon?: Mutation.addPokemon<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -124,7 +124,7 @@ export namespace Mutation { // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- @@ -143,23 +143,23 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ beings?: Query.beings$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `pokemon` field on the `Query` object. Its type is Object. + * Select the `pokemon` field on the `Query` object. Its type is OutputObject. */ pokemon?: Query.pokemon$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `pokemonByName` field on the `Query` object. Its type is Object. + * Select the `pokemonByName` field on the `Query` object. Its type is OutputObject. */ pokemonByName?: Query.pokemonByName<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `pokemons` field on the `Query` object. Its type is Object. + * Select the `pokemons` field on the `Query` object. Its type is OutputObject. */ pokemons?: Query.pokemons$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `trainerByName` field on the `Query` object. Its type is Object. + * Select the `trainerByName` field on the `Query` object. Its type is OutputObject. */ trainerByName?: Query.trainerByName<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `trainers` field on the `Query` object. Its type is Object. + * Select the `trainers` field on the `Query` object. Its type is OutputObject. */ trainers?: Query.trainers$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -362,7 +362,7 @@ export namespace Query { // // // ================================================================================================== -// GraphQLEnumType Types +// Enum // ================================================================================================== // // @@ -397,7 +397,7 @@ export type TrainerClass = // // // ================================================================================================== -// GraphQLInputObjectType Types +// InputObject // ================================================================================================== // // @@ -428,102 +428,7 @@ export interface StringFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarM // // // ================================================================================================== -// GraphQLInterfaceType Types -// ================================================================================================== -// -// -// -// -// -// - -// Interface Type: Being -// -------------------------------------------------------------------------------------------------- - -export interface Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { - id?: Being.id<$Scalars> - name?: Being.name<$Scalars> - ___on_Patron?: Patron<$Scalars> - ___on_Pokemon?: Pokemon<$Scalars> - ___on_Trainer?: Trainer<$Scalars> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Being$FragmentInline<$Scalars> - | Being$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, - * the name is one of the implementor type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Being$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Being<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -export namespace Being { - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `id` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > - - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `name` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > -} - -// -// -// -// -// -// -// ================================================================================================== -// GraphQLObjectType Types +// OutputObject // ================================================================================================== // // @@ -537,7 +442,7 @@ export namespace Being { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // BattleRoyale // -------------------------------------------------------------------------------------------------- @@ -550,21 +455,21 @@ export interface BattleRoyale<$Scalars extends $$Utilities.Schema.Scalar.ScalarM extends $Select.Bases.ObjectLike { /** - * Select the `combatants` field on the `BattleRoyale` object. Its type is Object. + * Select the `combatants` field on the `BattleRoyale` object. Its type is OutputObject. */ combatants?: | BattleRoyale.combatants$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `date` field on the `BattleRoyale` object. Its type is `Float` (a `Scalar`). + * Select the `date` field on the `BattleRoyale` object. Its type is ScalarStandard. */ date?: BattleRoyale.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `BattleRoyale` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `BattleRoyale` object. Its type is ScalarStandard. */ id?: BattleRoyale.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `winner` field on the `BattleRoyale` object. Its type is Object. + * Select the `winner` field on the `BattleRoyale` object. Its type is OutputObject. */ winner?: BattleRoyale.winner$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -683,7 +588,7 @@ export namespace BattleRoyale { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // BattleTrainer // -------------------------------------------------------------------------------------------------- @@ -696,27 +601,27 @@ export interface BattleTrainer<$Scalars extends $$Utilities.Schema.Scalar.Scalar extends $Select.Bases.ObjectLike { /** - * Select the `combatant1` field on the `BattleTrainer` object. Its type is Object. + * Select the `combatant1` field on the `BattleTrainer` object. Its type is OutputObject. */ combatant1?: | BattleTrainer.combatant1$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `combatant2` field on the `BattleTrainer` object. Its type is Object. + * Select the `combatant2` field on the `BattleTrainer` object. Its type is OutputObject. */ combatant2?: | BattleTrainer.combatant2$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `date` field on the `BattleTrainer` object. Its type is `Float` (a `Scalar`). + * Select the `date` field on the `BattleTrainer` object. Its type is ScalarStandard. */ date?: BattleTrainer.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `BattleTrainer` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `BattleTrainer` object. Its type is ScalarStandard. */ id?: BattleTrainer.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `winner` field on the `BattleTrainer` object. Its type is Object. + * Select the `winner` field on the `BattleTrainer` object. Its type is OutputObject. */ winner?: BattleTrainer.winner$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -854,7 +759,7 @@ export namespace BattleTrainer { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // BattleWild // -------------------------------------------------------------------------------------------------- @@ -867,15 +772,15 @@ export interface BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap extends $Select.Bases.ObjectLike { /** - * Select the `date` field on the `BattleWild` object. Its type is `Float` (a `Scalar`). + * Select the `date` field on the `BattleWild` object. Its type is ScalarStandard. */ date?: BattleWild.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `BattleWild` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `BattleWild` object. Its type is ScalarStandard. */ id?: BattleWild.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `pokemon` field on the `BattleWild` object. Its type is Object. + * Select the `pokemon` field on the `BattleWild` object. Its type is OutputObject. */ pokemon?: BattleWild.pokemon$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** @@ -883,11 +788,11 @@ export interface BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap */ result?: BattleWild.result$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `trainer` field on the `BattleWild` object. Its type is Object. + * Select the `trainer` field on the `BattleWild` object. Its type is OutputObject. */ trainer?: BattleWild.trainer$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `wildPokemons` field on the `BattleWild` object. Its type is Object. + * Select the `wildPokemons` field on the `BattleWild` object. Its type is OutputObject. */ wildPokemons?: | BattleWild.wildPokemons$Expanded<$Scalars> @@ -1051,7 +956,7 @@ export namespace BattleWild { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // CombatantMultiPokemon // -------------------------------------------------------------------------------------------------- @@ -1064,13 +969,13 @@ export interface CombatantMultiPokemon<$Scalars extends $$Utilities.Schema.Scala extends $Select.Bases.ObjectLike { /** - * Select the `pokemons` field on the `CombatantMultiPokemon` object. Its type is Object. + * Select the `pokemons` field on the `CombatantMultiPokemon` object. Its type is OutputObject. */ pokemons?: | CombatantMultiPokemon.pokemons$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `trainer` field on the `CombatantMultiPokemon` object. Its type is Object. + * Select the `trainer` field on the `CombatantMultiPokemon` object. Its type is OutputObject. */ trainer?: | CombatantMultiPokemon.trainer$Expanded<$Scalars> @@ -1147,7 +1052,7 @@ export namespace CombatantMultiPokemon { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // CombatantSinglePokemon // -------------------------------------------------------------------------------------------------- @@ -1160,13 +1065,13 @@ export interface CombatantSinglePokemon<$Scalars extends $$Utilities.Schema.Scal extends $Select.Bases.ObjectLike { /** - * Select the `pokemon` field on the `CombatantSinglePokemon` object. Its type is Object. + * Select the `pokemon` field on the `CombatantSinglePokemon` object. Its type is OutputObject. */ pokemon?: | CombatantSinglePokemon.pokemon$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `trainer` field on the `CombatantSinglePokemon` object. Its type is Object. + * Select the `trainer` field on the `CombatantSinglePokemon` object. Its type is OutputObject. */ trainer?: | CombatantSinglePokemon.trainer$Expanded<$Scalars> @@ -1243,7 +1148,7 @@ export namespace CombatantSinglePokemon { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Patron // -------------------------------------------------------------------------------------------------- @@ -1254,15 +1159,15 @@ export namespace CombatantSinglePokemon { export interface Patron<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `id` field on the `Patron` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Patron` object. Its type is ScalarStandard. */ id?: Patron.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `money` field on the `Patron` object. Its type is `Int` (a `Scalar`). + * Select the `money` field on the `Patron` object. Its type is ScalarStandard. */ money?: Patron.money$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `name` field on the `Patron` object. Its type is `String` (a `Scalar`). + * Select the `name` field on the `Patron` object. Its type is ScalarStandard. */ name?: Patron.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -1365,7 +1270,7 @@ export namespace Patron { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Pokemon // -------------------------------------------------------------------------------------------------- @@ -1376,31 +1281,31 @@ export namespace Patron { export interface Pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { /** - * Select the `attack` field on the `Pokemon` object. Its type is `Int` (a `Scalar`). + * Select the `attack` field on the `Pokemon` object. Its type is ScalarStandard. */ attack?: Pokemon.attack$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `birthday` field on the `Pokemon` object. Its type is `Int` (a `Scalar`). + * Select the `birthday` field on the `Pokemon` object. Its type is ScalarStandard. */ birthday?: Pokemon.birthday$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `defense` field on the `Pokemon` object. Its type is `Int` (a `Scalar`). + * Select the `defense` field on the `Pokemon` object. Its type is ScalarStandard. */ defense?: Pokemon.defense$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `hp` field on the `Pokemon` object. Its type is `Int` (a `Scalar`). + * Select the `hp` field on the `Pokemon` object. Its type is ScalarStandard. */ hp?: Pokemon.hp$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Pokemon` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Pokemon` object. Its type is ScalarStandard. */ id?: Pokemon.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `name` field on the `Pokemon` object. Its type is `String` (a `Scalar`). + * Select the `name` field on the `Pokemon` object. Its type is ScalarStandard. */ name?: Pokemon.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `trainer` field on the `Pokemon` object. Its type is Object. + * Select the `trainer` field on the `Pokemon` object. Its type is OutputObject. */ trainer?: Pokemon.trainer$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** @@ -1614,7 +1519,7 @@ export namespace Pokemon { // // // GRAPHQL SELECTION SET -// OBJECT +// OUTPUTOBJECT // -------------------------------------------------------------------------------------------------- // Trainer // -------------------------------------------------------------------------------------------------- @@ -1629,19 +1534,19 @@ export interface Trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = */ class?: Trainer.$class$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `fans` field on the `Trainer` object. Its type is Object. + * Select the `fans` field on the `Trainer` object. Its type is OutputObject. */ fans?: Trainer.fans$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `id` field on the `Trainer` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Trainer` object. Its type is ScalarStandard. */ id?: Trainer.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `name` field on the `Trainer` object. Its type is `String` (a `Scalar`). + * Select the `name` field on the `Trainer` object. Its type is ScalarStandard. */ name?: Trainer.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `pokemon` field on the `Trainer` object. Its type is Object. + * Select the `pokemon` field on the `Trainer` object. Its type is OutputObject. */ pokemon?: Trainer.pokemon$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> @@ -1784,7 +1689,7 @@ export namespace Trainer { // // // ================================================================================================== -// GraphQLUnionType Types +// Union // ================================================================================================== // // @@ -1824,6 +1729,101 @@ export interface Battle$FragmentInline<$Scalars extends $$Utilities.Schema.Scala extends Battle<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields {} +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// + +// Interface Type: Being +// -------------------------------------------------------------------------------------------------- + +export interface Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { + id?: Being.id<$Scalars> + name?: Being.name<$Scalars> + ___on_Patron?: Patron<$Scalars> + ___on_Pokemon?: Pokemon<$Scalars> + ___on_Trainer?: Trainer<$Scalars> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Being$FragmentInline<$Scalars> + | Being$FragmentInline<$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, + * the name is one of the implementor type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Being$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends Being<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields +{} + +export namespace Being { + export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<$Scalars> + + export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<$Scalars> + > + + export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<$Scalars> + + export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> + extends $Select.Bases.Base + {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `name` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | name$SelectionSet<$Scalars> + > +} + /** * [1] These definitions serve to allow field selection interfaces to extend their respective object type without * name clashing between the field name and the object name. @@ -1840,7 +1840,6 @@ export namespace $NamedTypes { export type $DateFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateFilter<$Scalars> export type $PokemonFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = PokemonFilter<$Scalars> export type $StringFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = StringFilter<$Scalars> - export type $Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Being<$Scalars> export type $BattleRoyale<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = BattleRoyale<$Scalars> export type $BattleTrainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = BattleTrainer<$Scalars> export type $BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = BattleWild<$Scalars> @@ -1853,4 +1852,5 @@ export namespace $NamedTypes { export type $Pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Pokemon<$Scalars> export type $Trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Trainer<$Scalars> export type $Battle<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Battle<$Scalars> + export type $Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Being<$Scalars> } diff --git a/tests/_/schemas/query-only/graffle/modules/MethodsSelect.ts b/tests/_/schemas/query-only/graffle/modules/MethodsSelect.ts index 02343247d..150d1f4c3 100644 --- a/tests/_/schemas/query-only/graffle/modules/MethodsSelect.ts +++ b/tests/_/schemas/query-only/graffle/modules/MethodsSelect.ts @@ -40,3 +40,51 @@ export interface $MethodsSelect { export interface Query { <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet } + +// +// +// +// +// +// +// ================================================================================================== +// OutputObject +// ================================================================================================== +// +// +// +// +// +// + +// +// +// +// +// +// +// ================================================================================================== +// Union +// ================================================================================================== +// +// +// +// +// +// + +// +// +// +// +// +// +// ================================================================================================== +// Interface +// ================================================================================================== +// +// +// +// +// +// diff --git a/tests/_/schemas/query-only/graffle/modules/Schema.ts b/tests/_/schemas/query-only/graffle/modules/Schema.ts index 2cfff9e4c..6383aa11f 100644 --- a/tests/_/schemas/query-only/graffle/modules/Schema.ts +++ b/tests/_/schemas/query-only/graffle/modules/Schema.ts @@ -21,8 +21,8 @@ export namespace Schema { // export type Query = $.StandardTypes.Query<{ - id: $.Field<'id', $.Nullable<$Scalar.ID>, null> - idNonNull: $.Field<'idNonNull', $Scalar.ID, null> + id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> + idNonNull: $.OutputField<'idNonNull', $Scalar.ID, null> }> // @@ -32,7 +32,7 @@ export namespace Schema { // // // ================================================================================================== - // Enum + // OutputObject // ================================================================================================== // // @@ -86,7 +86,7 @@ export namespace Schema { // // // ================================================================================================== - // Object + // Union // ================================================================================================== // // @@ -104,7 +104,7 @@ export namespace Schema { // // // ================================================================================================== - // Union + // Enum // ================================================================================================== // // diff --git a/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts index e4677d2d6..6beade569 100644 --- a/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts @@ -1,4 +1,4 @@ -import type * as $Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' +import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import * as $Scalar from './Scalar.js' // // @@ -7,7 +7,7 @@ import * as $Scalar from './Scalar.js' // // // ================================================================================================== -// GraphQLScalarTypeStandard +// ScalarStandard // ================================================================================================== // // @@ -33,7 +33,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLScalarTypeCustom +// ScalarCustom // ================================================================================================== // // @@ -42,7 +42,7 @@ const String = $Scalar.String // // -// None of your GraphQLScalarTypeCustoms have custom scalars. +// None of your ScalarCustoms have custom scalars. // // @@ -51,7 +51,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLEnumType +// Enum // ================================================================================================== // // @@ -60,7 +60,7 @@ const String = $Scalar.String // // -// None of your GraphQLEnumTypes have custom scalars. +// None of your Enums have custom scalars. // // @@ -69,7 +69,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLInputObjectType +// InputObject // ================================================================================================== // // @@ -78,7 +78,7 @@ const String = $Scalar.String // // -// None of your GraphQLInputObjectTypes have custom scalars. +// None of your InputObjects have custom scalars. // // @@ -87,7 +87,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLObjectType +// OutputObject // ================================================================================================== // // @@ -96,7 +96,7 @@ const String = $Scalar.String // // -// None of your GraphQLObjectTypes have custom scalars. +// None of your OutputObjects have custom scalars. // // @@ -105,7 +105,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLInterfaceType +// Interface // ================================================================================================== // // @@ -114,7 +114,7 @@ const String = $Scalar.String // // -// None of your GraphQLInterfaceTypes have custom scalars. +// None of your Interfaces have custom scalars. // // @@ -123,7 +123,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLUnionType +// Union // ================================================================================================== // // @@ -132,7 +132,7 @@ const String = $Scalar.String // // -// None of your GraphQLUnionTypes have custom scalars. +// None of your Unions have custom scalars. // // @@ -141,7 +141,7 @@ const String = $Scalar.String // // // ================================================================================================== -// GraphQLRootType +// Root // ================================================================================================== // // @@ -150,7 +150,7 @@ const String = $Scalar.String // // -const Query: $Utilities.SchemaDrivenDataMap.OutputObject = { +const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { id: {}, idNonNull: {}, @@ -192,7 +192,7 @@ const Query: $Utilities.SchemaDrivenDataMap.OutputObject = { // // -const $schemaDrivenDataMap: $Utilities.SchemaDrivenDataMap = { +const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { roots: { Query, }, diff --git a/tests/_/schemas/query-only/graffle/modules/Select.ts b/tests/_/schemas/query-only/graffle/modules/Select.ts index 4a011cb7b..879b049fa 100644 --- a/tests/_/schemas/query-only/graffle/modules/Select.ts +++ b/tests/_/schemas/query-only/graffle/modules/Select.ts @@ -41,8 +41,8 @@ export namespace Select { // Root Types // ---------- export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // Object Types - // ------------ + // OutputObject Types + // ------------------ // -- None -- diff --git a/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts b/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts index b72d94573..b2c6d7f79 100644 --- a/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts @@ -29,7 +29,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // ================================================================================================== -// GraphQLObjectType Types +// Root // ================================================================================================== // // @@ -43,7 +43,7 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // // GRAPHQL SELECTION SET -// OBJECT +// ROOT // -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- @@ -54,11 +54,11 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { /** - * Select the `id` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `id` field on the `Query` object. Its type is ScalarStandard. */ id?: Query.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> /** - * Select the `idNonNull` field on the `Query` object. Its type is `ID` (a `Scalar`). + * Select the `idNonNull` field on the `Query` object. Its type is ScalarStandard. */ idNonNull?: Query.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias>