diff --git a/src/layers/2_Select/Indicator/indicator.ts b/src/layers/2_Select/Indicator/indicator.ts index ce5138d7..70d7adca 100644 --- a/src/layers/2_Select/Indicator/indicator.ts +++ b/src/layers/2_Select/Indicator/indicator.ts @@ -14,18 +14,6 @@ export type NoArgsIndicator = Indicator | Directive.$Fields export type NoArgsIndicator$Expanded = UnionExpanded> -// // dprint-ignore -// type ArgsIndicator<$Args extends Schema.Args> = -// $Args['isFieldsAllNullable'] extends true -// ? ({ $?: Args<$Args> } & Directive.$Fields) | Indicator -// : { $: Args<$Args> } & Directive.$Fields - -// // dprint-ignore -// export type IndicatorForField<$Field extends SomeField> = -// $Field['args'] extends null -// ? NoArgsIndicator -// : ArgsIndicator> - export const isPositiveLikeFieldValue = (v: any): v is Positive => { return !isNegativeIndicator(v) } diff --git a/src/layers/2_Select/Indicator/negative.ts b/src/layers/2_Select/Indicator/negative.ts index 92fb9ee5..785227a4 100644 --- a/src/layers/2_Select/Indicator/negative.ts +++ b/src/layers/2_Select/Indicator/negative.ts @@ -1,11 +1,14 @@ -import type { UnionExpanded, Values } from '../../../lib/prelude.js' +import type { UnionExpanded } from '../../../lib/prelude.js' export const negativeIndicatorEnum = { false: false, undefined: undefined, } as const -export type Negative = UnionExpanded> +// We do not definite the type in a DRY way like below because it causes +// IDEs to show Values<...> in the final type making it harder to read. +// export type Negative = UnionExpanded> +export type Negative = UnionExpanded export const isNegativeIndicator = (v: any): v is Negative => { return v === negativeIndicatorEnum.false || v === negativeIndicatorEnum.undefined diff --git a/src/layers/4_generator/__snapshots__/generate.test.ts.snap b/src/layers/4_generator/__snapshots__/generate.test.ts.snap index 7cb1c64e..4456ffb1 100644 --- a/src/layers/4_generator/__snapshots__/generate.test.ts.snap +++ b/src/layers/4_generator/__snapshots__/generate.test.ts.snap @@ -23,6 +23,7 @@ import './modules/Global.js' export { create } from './modules/Client.js' export { isError } from './modules/Error.js' export { Select } from './modules/Select.js' +export * as SelectionSets from './modules/SelectionSets.js' " `; diff --git a/src/layers/4_generator/generators/SelectionSets.ts b/src/layers/4_generator/generators/SelectionSets.ts index 6880134a..20b1da7e 100644 --- a/src/layers/4_generator/generators/SelectionSets.ts +++ b/src/layers/4_generator/generators/SelectionSets.ts @@ -224,7 +224,12 @@ const renderObject = createCodeGenerator<{ node: GraphQLObjectType }>( const doc = Code.TSDoc(` Select the \`${field.name}\` field on the \`${node.name}\` object. Its type is ${type}. `) - const propertyRendered = Helpers.outputFieldAlisable(field.name, `${renderName(node)}.${renderName(field)}`) + const propertyRendered = Helpers.outputFieldAlisable( + field.name, + `${renderName(node)}.${renderName(field)}`, + true, + analyzeArgsNullability(field.args).isAllNullable, + ) return doc + `\n` + propertyRendered }).join(`\n`) @@ -295,8 +300,8 @@ const renderField = createCodeGenerator<{ field: GraphQLField }>( ) code() code( - Helpers.type( - `${nameRendered}$Expanded`, + Helpers.typeExpanded( + nameRendered, `$Utilities.UnionExpanded<$Select.Indicator.Indicator | ${nameRendered}$SelectionSet>`, ), ) @@ -306,14 +311,13 @@ const renderField = createCodeGenerator<{ field: GraphQLField }>( ) code() } else { + // 1+ arguments required. // todo test that a directive can be passed with the intersection that otherwise cannot be. code(Helpers.$interface(nameRendered, `$Select.Bases.Base`, argsRendered)) code() - code(Helpers.type(`${nameRendered}$Expanded`, nameRendered)) - code() } } else { - code(Helpers.type(`${nameRendered}$Expanded`, `$Select.Indicator.NoArgsIndicator$Expanded`)) + code(Helpers.typeExpanded(nameRendered, `$Select.Indicator.NoArgsIndicator$Expanded`)) code() code(Helpers.type(nameRendered, `$Select.Indicator.NoArgsIndicator`)) code() @@ -402,6 +406,17 @@ namespace Helpers { export const $interface = (name: string, extendsClause: string | null, fields: string) => { return `export interface ${name} ${extendsClause ? ` extends ${extendsClause}` : ``} { ${fields} }` } + export const typeExpanded = (name: string, type: string) => { + const jsdoc = Code.TSDoc(` + 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. + `) + return ` + ${jsdoc} + export type ${name}$Expanded = ${type} + ` + } export const type = (name: string, type: string) => { return `export type ${name} = ${type}` } @@ -410,9 +425,14 @@ namespace Helpers { return `${name}?: ${type}` } - export const outputFieldAlisable = (name: string, type: string, aliasable: boolean = true) => { + export const outputFieldAlisable = ( + name: string, + type: string, + aliasable: boolean = true, + isHasExpanded: boolean = true, + ) => { const alias = aliasable ? `| $Select.SelectAlias.SelectAlias<${type}>` : `` - return `${name}?: ${type}$Expanded${alias}` + return `${name}?: ${type}${isHasExpanded ? `$Expanded` : ``}${alias}` } /** diff --git a/src/layers/4_generator/generators/_.ts b/src/layers/4_generator/generators/_.ts index 1e0ba06d..f73dd66b 100644 --- a/src/layers/4_generator/generators/_.ts +++ b/src/layers/4_generator/generators/_.ts @@ -2,6 +2,7 @@ import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { ModuleGeneratorClient } from './Client.js' import { ModuleGeneratorError } from './Error.js' import { ModuleGeneratorSelect } from './Select.js' +import { ModuleGeneratorSelectionSets } from './SelectionSets.js' export const ModuleGenerator_ = createModuleGenerator( `_`, @@ -16,6 +17,7 @@ export const ModuleGenerator_ = createModuleGenerator( `export { Select } from './modules/${ModuleGeneratorSelect.name}.js'`, `export { isError } from './modules/${ModuleGeneratorError.name}.js'`, `export { create } from './modules/${ModuleGeneratorClient.name}.js'`, + `export * as SelectionSets from './modules/${ModuleGeneratorSelectionSets.name}.js'`, ) return code diff --git a/src/layers/6_client/client.customScalar.test.ts b/src/layers/6_client/client.customScalar.test.ts index dc5e94f9..71636e7e 100644 --- a/src/layers/6_client/client.customScalar.test.ts +++ b/src/layers/6_client/client.customScalar.test.ts @@ -1,13 +1,13 @@ import { describe, expect } from 'vitest' import { createResponse, test } from '../../../tests/_/helpers.js' import { db } from '../../../tests/_/schemas/db.js' -import type { Query } from '../../../tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.js' +import type { Graffle } from '../../../tests/_/schemas/kitchen-sink/graffle/__.js' const date0Encoded = db.date0.toISOString() type TestCase = [ describe: string, - query: Query, + query: Graffle.SelectionSets.Query, responseData: object, expectedData: object, ] diff --git a/tests/_/schemas/kitchen-sink/graffle/_.ts b/tests/_/schemas/kitchen-sink/graffle/_.ts index 0d3b8d17..9749e165 100644 --- a/tests/_/schemas/kitchen-sink/graffle/_.ts +++ b/tests/_/schemas/kitchen-sink/graffle/_.ts @@ -7,3 +7,4 @@ import './modules/Global.js' export { create } from './modules/Client.js' export { isError } from './modules/Error.js' export { Select } from './modules/Select.js' +export * as SelectionSets from './modules/SelectionSets.js' diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts b/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts index 982dc7e1..4b8fffc1 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts @@ -89,10 +89,20 @@ export interface Mutation$FragmentInline extends Mutation, $Select.Directive.$Gr // ----------------------------------------| Fields Interfaces | export namespace Mutation { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `idNonNull` 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 idNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type idNonNull = $Select.Indicator.NoArgsIndicator @@ -121,7 +131,7 @@ export interface Query { * Select the `InputObjectNestedNonNull` field on the `Query` object. Its type is `ID` (a `Scalar`). */ InputObjectNestedNonNull?: - | Query.InputObjectNestedNonNull$Expanded + | Query.InputObjectNestedNonNull | $Select.SelectAlias.SelectAlias /** * Select the `abcEnum` field on the `Query` object. Its type is Enum. @@ -146,16 +156,16 @@ export interface Query { /** * Select the `dateArgNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). */ - dateArgNonNull?: Query.dateArgNonNull$Expanded | $Select.SelectAlias.SelectAlias + dateArgNonNull?: Query.dateArgNonNull | $Select.SelectAlias.SelectAlias /** * Select the `dateArgNonNullList` field on the `Query` object. Its type is `Date` (a `Scalar`). */ - dateArgNonNullList?: Query.dateArgNonNullList$Expanded | $Select.SelectAlias.SelectAlias + dateArgNonNullList?: Query.dateArgNonNullList | $Select.SelectAlias.SelectAlias /** * Select the `dateArgNonNullListNonNull` field on the `Query` object. Its type is `Date` (a `Scalar`). */ dateArgNonNullListNonNull?: - | Query.dateArgNonNullListNonNull$Expanded + | Query.dateArgNonNullListNonNull | $Select.SelectAlias.SelectAlias /** * Select the `dateInterface1` field on the `Query` object. Its type is Interface. @@ -204,7 +214,7 @@ export interface Query { /** * Select the `interfaceWithArgs` field on the `Query` object. Its type is Interface. */ - interfaceWithArgs?: Query.interfaceWithArgs$Expanded | $Select.SelectAlias.SelectAlias + interfaceWithArgs?: Query.interfaceWithArgs | $Select.SelectAlias.SelectAlias /** * Select the `listInt` field on the `Query` object. Its type is `Int` (a `Scalar`). */ @@ -252,7 +262,7 @@ export interface Query { /** * Select the `result` field on the `Query` object. Its type is Union. */ - result?: Query.result$Expanded | $Select.SelectAlias.SelectAlias + result?: Query.result | $Select.SelectAlias.SelectAlias /** * Select the `resultNonNull` field on the `Query` object. Its type is Union. */ @@ -275,7 +285,7 @@ export interface Query { * Select the `stringWithArgInputObjectRequired` field on the `Query` object. Its type is `String` (a `Scalar`). */ stringWithArgInputObjectRequired?: - | Query.stringWithArgInputObjectRequired$Expanded + | Query.stringWithArgInputObjectRequired | $Select.SelectAlias.SelectAlias /** * Select the `stringWithArgs` field on the `Query` object. Its type is `String` (a `Scalar`). @@ -289,14 +299,12 @@ export interface Query { * Select the `stringWithListArgRequired` field on the `Query` object. Its type is `String` (a `Scalar`). */ stringWithListArgRequired?: - | Query.stringWithListArgRequired$Expanded + | Query.stringWithListArgRequired | $Select.SelectAlias.SelectAlias /** * Select the `stringWithRequiredArg` field on the `Query` object. Its type is `String` (a `Scalar`). */ - stringWithRequiredArg?: - | Query.stringWithRequiredArg$Expanded - | $Select.SelectAlias.SelectAlias + stringWithRequiredArg?: Query.stringWithRequiredArg | $Select.SelectAlias.SelectAlias /** * Select the `unionFooBar` field on the `Query` object. Its type is Union. */ @@ -356,6 +364,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `InputObjectNested` 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 InputObjectNested$Expanded = $Utilities.UnionExpanded< $Select.Indicator.Indicator | InputObjectNested$SelectionSet > @@ -373,12 +386,20 @@ export namespace Query { $: InputObjectNestedNonNull$SelectionSetArguments } - export type InputObjectNestedNonNull$Expanded = InputObjectNestedNonNull - + /** + * This is the "expanded" version of the `abcEnum` 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 abcEnum$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type abcEnum = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type date$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date = $Select.Indicator.NoArgsIndicator @@ -396,6 +417,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `dateArg` 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 dateArg$Expanded = $Utilities.UnionExpanded<$Select.Indicator.Indicator | dateArg$SelectionSet> export type dateArg = $Select.Indicator.Indicator | dateArg$SelectionSet @@ -413,6 +439,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `dateArgInputObject` 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 dateArgInputObject$Expanded = $Utilities.UnionExpanded< $Select.Indicator.Indicator | dateArgInputObject$SelectionSet > @@ -432,6 +463,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `dateArgList` 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 dateArgList$Expanded = $Utilities.UnionExpanded<$Select.Indicator.Indicator | dateArgList$SelectionSet> export type dateArgList = $Select.Indicator.Indicator | dateArgList$SelectionSet @@ -447,8 +483,6 @@ export namespace Query { $: dateArgNonNull$SelectionSetArguments } - export type dateArgNonNull$Expanded = dateArgNonNull - export type dateArgNonNullList$SelectionSetArguments = { date: Array<$Scalar.DateDecoded | undefined | null> } @@ -460,8 +494,6 @@ export namespace Query { $: dateArgNonNullList$SelectionSetArguments } - export type dateArgNonNullList$Expanded = dateArgNonNullList - export type dateArgNonNullListNonNull$SelectionSetArguments = { date: Array<$Scalar.DateDecoded | undefined | null> } @@ -473,18 +505,31 @@ export namespace Query { $: dateArgNonNullListNonNull$SelectionSetArguments } - export type dateArgNonNullListNonNull$Expanded = dateArgNonNullListNonNull - export interface dateInterface1 extends _RefDefs._DateInterface1 {} export type dateInterface1$Expanded = dateInterface1 + /** + * This is the "expanded" version of the `dateList` 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 dateList$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type dateList = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `dateListNonNull` 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 dateListNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type dateListNonNull = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `dateNonNull` 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 dateNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type dateNonNull = $Select.Indicator.NoArgsIndicator @@ -506,14 +551,29 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `error` 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 error$Expanded = $Utilities.UnionExpanded<$Select.Indicator.Indicator | error$SelectionSet> export type error = $Select.Indicator.Indicator | error$SelectionSet + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `idNonNull` 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 idNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type idNonNull = $Select.Indicator.NoArgsIndicator @@ -532,18 +592,38 @@ export namespace Query { } } export type interfaceWithArgs$Expanded = interfaceWithArgs + /** + * This is the "expanded" version of the `listInt` 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 listInt$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type listInt = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `listIntNonNull` 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 listIntNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type listIntNonNull = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `listListInt` 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 listListInt$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type listListInt = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `listListIntNonNull` 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 listListIntNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type listListIntNonNull = $Select.Indicator.NoArgsIndicator @@ -594,6 +674,11 @@ export namespace Query { } } export type resultNonNull$Expanded = resultNonNull + /** + * This is the "expanded" version of the `$string` 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 $string$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type $string = $Select.Indicator.NoArgsIndicator @@ -611,6 +696,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `stringWithArgEnum` 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 stringWithArgEnum$Expanded = $Utilities.UnionExpanded< $Select.Indicator.Indicator | stringWithArgEnum$SelectionSet > @@ -630,6 +720,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `stringWithArgInputObject` 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 stringWithArgInputObject$Expanded = $Utilities.UnionExpanded< $Select.Indicator.Indicator | stringWithArgInputObject$SelectionSet > @@ -647,8 +742,6 @@ export namespace Query { $: stringWithArgInputObjectRequired$SelectionSetArguments } - export type stringWithArgInputObjectRequired$Expanded = stringWithArgInputObjectRequired - export type stringWithArgs$SelectionSetArguments = { boolean?: boolean | undefined | null float?: number | undefined | null @@ -666,6 +759,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `stringWithArgs` 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 stringWithArgs$Expanded = $Utilities.UnionExpanded< $Select.Indicator.Indicator | stringWithArgs$SelectionSet > @@ -685,6 +783,11 @@ export namespace Query { } > + /** + * This is the "expanded" version of the `stringWithListArg` 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 stringWithListArg$Expanded = $Utilities.UnionExpanded< $Select.Indicator.Indicator | stringWithListArg$SelectionSet > @@ -702,8 +805,6 @@ export namespace Query { $: stringWithListArgRequired$SelectionSetArguments } - export type stringWithListArgRequired$Expanded = stringWithListArgRequired - export type stringWithRequiredArg$SelectionSetArguments = { string: string } @@ -715,8 +816,6 @@ export namespace Query { $: stringWithRequiredArg$SelectionSetArguments } - export type stringWithRequiredArg$Expanded = stringWithRequiredArg - export interface unionFooBar extends _RefDefs._FooBarUnion {} export type unionFooBar$Expanded = unionFooBar export interface unionFooBarNonNull extends _RefDefs._FooBarUnion {} @@ -846,6 +945,11 @@ export interface DateInterface1$FragmentInline {} export namespace DateInterface1 { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type date1 = $Select.Indicator.NoArgsIndicator @@ -884,6 +988,11 @@ export interface Error extends $Select.Bases.ObjectLike { export interface Error$FragmentInline extends Error, $Select.Directive.$Groups.InlineFragment.Fields {} export namespace Error { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type message = $Select.Indicator.NoArgsIndicator @@ -922,6 +1031,11 @@ export interface Interface extends $Select.Bases.ObjectLike { export interface Interface$FragmentInline extends Interface, $Select.Directive.$Groups.InlineFragment.Fields {} export namespace Interface { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -988,6 +1102,11 @@ export interface Bar$FragmentInline extends Bar, $Select.Directive.$Groups.Inlin // ----------------------------------------| Fields Interfaces | export namespace Bar { + /** + * This is the "expanded" version of the `int` 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 int$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type int = $Select.Indicator.NoArgsIndicator @@ -1038,6 +1157,11 @@ export interface DateObject1$FragmentInline extends DateObject1, $Select.Directi // ----------------------------------------| Fields Interfaces | export namespace DateObject1 { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type date1 = $Select.Indicator.NoArgsIndicator @@ -1088,6 +1212,11 @@ export interface DateObject2$FragmentInline extends DateObject2, $Select.Directi // ----------------------------------------| Fields Interfaces | export namespace DateObject2 { + /** + * This is the "expanded" version of the `date2` 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 date2$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date2 = $Select.Indicator.NoArgsIndicator @@ -1142,10 +1271,20 @@ export interface ErrorOne$FragmentInline extends ErrorOne, $Select.Directive.$Gr // ----------------------------------------| Fields Interfaces | export namespace ErrorOne { + /** + * This is the "expanded" version of the `infoId` 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 infoId$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type infoId = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type message = $Select.Indicator.NoArgsIndicator @@ -1200,10 +1339,20 @@ export interface ErrorTwo$FragmentInline extends ErrorTwo, $Select.Directive.$Gr // ----------------------------------------| Fields Interfaces | export namespace ErrorTwo { + /** + * This is the "expanded" version of the `infoInt` 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 infoInt$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type infoInt = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type message = $Select.Indicator.NoArgsIndicator @@ -1257,6 +1406,11 @@ export interface Foo$FragmentInline extends Foo, $Select.Directive.$Groups.Inlin // ----------------------------------------| Fields Interfaces | export namespace Foo { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -1323,22 +1477,47 @@ export interface Object1$FragmentInline extends Object1, $Select.Directive.$Grou // ----------------------------------------| Fields Interfaces | export namespace Object1 { + /** + * This is the "expanded" version of the `$boolean` 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 $boolean$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type $boolean = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `float` 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 float$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type float = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `int` 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 int$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type int = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `$string` 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 $string$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type $string = $Select.Indicator.NoArgsIndicator @@ -1395,10 +1574,20 @@ export interface Object1ImplementingInterface$FragmentInline // ----------------------------------------| Fields Interfaces | export namespace Object1ImplementingInterface { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `int` 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 int$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type int = $Select.Indicator.NoArgsIndicator @@ -1457,10 +1646,20 @@ export interface Object2ImplementingInterface$FragmentInline // ----------------------------------------| Fields Interfaces | export namespace Object2ImplementingInterface { + /** + * This is the "expanded" version of the `$boolean` 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 $boolean$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type $boolean = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -1515,6 +1714,11 @@ export interface ObjectNested$FragmentInline extends ObjectNested, $Select.Direc // ----------------------------------------| Fields Interfaces | export namespace ObjectNested { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -1619,6 +1823,11 @@ export interface lowerCaseObject$FragmentInline // ----------------------------------------| Fields Interfaces | export namespace lowerCaseObject { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -1671,6 +1880,11 @@ export interface lowerCaseObject2$FragmentInline // ----------------------------------------| Fields Interfaces | export namespace lowerCaseObject2 { + /** + * This is the "expanded" version of the `int` 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 int$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type int = $Select.Indicator.NoArgsIndicator diff --git a/tests/_/schemas/mutation-only/graffle/_.ts b/tests/_/schemas/mutation-only/graffle/_.ts index 0d3b8d17..9749e165 100644 --- a/tests/_/schemas/mutation-only/graffle/_.ts +++ b/tests/_/schemas/mutation-only/graffle/_.ts @@ -7,3 +7,4 @@ import './modules/Global.js' export { create } from './modules/Client.js' export { isError } from './modules/Error.js' export { Select } from './modules/Select.js' +export * as SelectionSets from './modules/SelectionSets.js' diff --git a/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts b/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts index 45f07e42..295fe990 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts @@ -87,10 +87,20 @@ export interface Mutation$FragmentInline extends Mutation, $Select.Directive.$Gr // ----------------------------------------| Fields Interfaces | export namespace Mutation { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `idNonNull` 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 idNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type idNonNull = $Select.Indicator.NoArgsIndicator diff --git a/tests/_/schemas/pokemon/graffle/_.ts b/tests/_/schemas/pokemon/graffle/_.ts index 0d3b8d17..9749e165 100644 --- a/tests/_/schemas/pokemon/graffle/_.ts +++ b/tests/_/schemas/pokemon/graffle/_.ts @@ -7,3 +7,4 @@ import './modules/Global.js' export { create } from './modules/Client.js' export { isError } from './modules/Error.js' export { Select } from './modules/Select.js' +export * as SelectionSets from './modules/SelectionSets.js' diff --git a/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts b/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts index 0f12336c..bb5b15f1 100644 --- a/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts @@ -57,7 +57,7 @@ export interface Mutation { /** * Select the `addPokemon` field on the `Mutation` object. Its type is Object. */ - addPokemon?: Mutation.addPokemon$Expanded | $Select.SelectAlias.SelectAlias + addPokemon?: Mutation.addPokemon | $Select.SelectAlias.SelectAlias /** * Inline fragments for field groups. @@ -130,7 +130,7 @@ export interface Query { /** * Select the `pokemonByName` field on the `Query` object. Its type is Object. */ - pokemonByName?: Query.pokemonByName$Expanded | $Select.SelectAlias.SelectAlias + pokemonByName?: Query.pokemonByName | $Select.SelectAlias.SelectAlias /** * Select the `pokemons` field on the `Query` object. Its type is Object. */ @@ -138,7 +138,7 @@ export interface Query { /** * Select the `trainerByName` field on the `Query` object. Its type is Object. */ - trainerByName?: Query.trainerByName$Expanded | $Select.SelectAlias.SelectAlias + trainerByName?: Query.trainerByName | $Select.SelectAlias.SelectAlias /** * Select the `trainers` field on the `Query` object. Its type is Object. */ @@ -326,10 +326,20 @@ export interface Being extends $Select.Bases.ObjectLike { export interface Being$FragmentInline extends Being, $Select.Directive.$Groups.InlineFragment.Fields {} export namespace Being { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator @@ -410,10 +420,20 @@ export interface BattleRoyale$FragmentInline extends BattleRoyale, $Select.Direc export namespace BattleRoyale { export interface combatants extends _RefDefs._CombatantMultiPokemon {} export type combatants$Expanded = combatants + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type date$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -487,10 +507,20 @@ export namespace BattleTrainer { export type combatant1$Expanded = combatant1 export interface combatant2 extends _RefDefs._CombatantSinglePokemon {} export type combatant2$Expanded = combatant2 + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type date$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -564,16 +594,31 @@ export interface BattleWild$FragmentInline extends BattleWild, $Select.Directive // ----------------------------------------| Fields Interfaces | export namespace BattleWild { + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type date$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator export interface pokemon extends _RefDefs._Pokemon {} export type pokemon$Expanded = pokemon + /** + * This is the "expanded" version of the `result` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type result$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type result = $Select.Indicator.NoArgsIndicator @@ -751,14 +796,29 @@ export interface Patron$FragmentInline extends Patron, $Select.Directive.$Groups // ----------------------------------------| Fields Interfaces | export namespace Patron { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `money` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type money$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type money = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator @@ -837,32 +897,67 @@ export interface Pokemon$FragmentInline extends Pokemon, $Select.Directive.$Grou // ----------------------------------------| Fields Interfaces | export namespace Pokemon { + /** + * This is the "expanded" version of the `attack` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type attack$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type attack = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `birthday` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type birthday$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type birthday = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `defense` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type defense$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type defense = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `hp` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type hp$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type hp = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator export interface trainer extends _RefDefs._Trainer {} export type trainer$Expanded = trainer + /** + * This is the "expanded" version of the `type` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type type$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type type = $Select.Indicator.NoArgsIndicator @@ -929,16 +1024,31 @@ export interface Trainer$FragmentInline extends Trainer, $Select.Directive.$Grou // ----------------------------------------| Fields Interfaces | export namespace Trainer { + /** + * This is the "expanded" version of the `$class` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type $class$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type $class = $Select.Indicator.NoArgsIndicator export interface fans extends _RefDefs._Patron {} export type fans$Expanded = fans + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator diff --git a/tests/_/schemas/query-only/graffle/_.ts b/tests/_/schemas/query-only/graffle/_.ts index 0d3b8d17..9749e165 100644 --- a/tests/_/schemas/query-only/graffle/_.ts +++ b/tests/_/schemas/query-only/graffle/_.ts @@ -7,3 +7,4 @@ import './modules/Global.js' export { create } from './modules/Client.js' export { isError } from './modules/Error.js' export { Select } from './modules/Select.js' +export * as SelectionSets from './modules/SelectionSets.js' diff --git a/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts b/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts index 80fa0ad7..8359c3a6 100644 --- a/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts @@ -87,10 +87,20 @@ export interface Query$FragmentInline extends Query, $Select.Directive.$Groups.I // ----------------------------------------| Fields Interfaces | export namespace Query { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `idNonNull` 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 idNonNull$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type idNonNull = $Select.Indicator.NoArgsIndicator diff --git a/website/graffle/_.ts b/website/graffle/_.ts index 0d3b8d17..9749e165 100644 --- a/website/graffle/_.ts +++ b/website/graffle/_.ts @@ -7,3 +7,4 @@ import './modules/Global.js' export { create } from './modules/Client.js' export { isError } from './modules/Error.js' export { Select } from './modules/Select.js' +export * as SelectionSets from './modules/SelectionSets.js' diff --git a/website/graffle/modules/SelectionSets.ts b/website/graffle/modules/SelectionSets.ts index ef524634..0c4db77b 100644 --- a/website/graffle/modules/SelectionSets.ts +++ b/website/graffle/modules/SelectionSets.ts @@ -56,7 +56,7 @@ export interface Query { /** * Select the `continent` field on the `Query` object. Its type is Object. */ - continent?: Query.continent$Expanded | $Select.SelectAlias.SelectAlias + continent?: Query.continent | $Select.SelectAlias.SelectAlias /** * Select the `continents` field on the `Query` object. Its type is Object. */ @@ -68,11 +68,11 @@ export interface Query { /** * Select the `country` field on the `Query` object. Its type is Object. */ - country?: Query.country$Expanded | $Select.SelectAlias.SelectAlias + country?: Query.country | $Select.SelectAlias.SelectAlias /** * Select the `language` field on the `Query` object. Its type is Object. */ - language?: Query.language$Expanded | $Select.SelectAlias.SelectAlias + language?: Query.language | $Select.SelectAlias.SelectAlias /** * Select the `languages` field on the `Query` object. Its type is Object. */ @@ -273,12 +273,22 @@ export interface Continent$FragmentInline extends Continent, $Select.Directive.$ // ----------------------------------------| Fields Interfaces | export namespace Continent { + /** + * This is the "expanded" version of the `code` 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 code$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type code = $Select.Indicator.NoArgsIndicator export interface countries extends _RefDefs._Country {} export type countries$Expanded = countries + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator @@ -385,32 +395,67 @@ export interface Country$FragmentInline extends Country, $Select.Directive.$Grou // ----------------------------------------| Fields Interfaces | export namespace Country { + /** + * This is the "expanded" version of the `awsRegion` 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 awsRegion$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type awsRegion = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `capital` 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 capital$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type capital = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `code` 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 code$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type code = $Select.Indicator.NoArgsIndicator export interface continent extends _RefDefs._Continent {} export type continent$Expanded = continent + /** + * This is the "expanded" version of the `currencies` 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 currencies$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type currencies = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `currency` 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 currency$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type currency = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `emoji` 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 emoji$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type emoji = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `emojiU` 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 emojiU$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type emojiU = $Select.Indicator.NoArgsIndicator @@ -430,18 +475,38 @@ export namespace Country { } > + /** + * 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 = $Utilities.UnionExpanded<$Select.Indicator.Indicator | name$SelectionSet> export type name = $Select.Indicator.Indicator | name$SelectionSet + /** + * This is the "expanded" version of the `native` 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 native$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type native = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `phone` 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 phone$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type phone = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `phones` 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 phones$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type phones = $Select.Indicator.NoArgsIndicator @@ -509,18 +574,38 @@ export interface Language$FragmentInline extends Language, $Select.Directive.$Gr // ----------------------------------------| Fields Interfaces | export namespace Language { + /** + * This is the "expanded" version of the `code` 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 code$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type code = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `native` 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 native$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type native = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `rtl` 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 rtl$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type rtl = $Select.Indicator.NoArgsIndicator @@ -579,12 +664,22 @@ export interface State$FragmentInline extends State, $Select.Directive.$Groups.I // ----------------------------------------| Fields Interfaces | export namespace State { + /** + * This is the "expanded" version of the `code` 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 code$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type code = $Select.Indicator.NoArgsIndicator export interface country extends _RefDefs._Country {} export type country$Expanded = country + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator @@ -643,14 +738,29 @@ export interface Subdivision$FragmentInline extends Subdivision, $Select.Directi // ----------------------------------------| Fields Interfaces | export namespace Subdivision { + /** + * This is the "expanded" version of the `code` 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 code$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type code = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `emoji` 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 emoji$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type emoji = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator diff --git a/website/pokemon/_.ts b/website/pokemon/_.ts index 0d3b8d17..9749e165 100644 --- a/website/pokemon/_.ts +++ b/website/pokemon/_.ts @@ -7,3 +7,4 @@ import './modules/Global.js' export { create } from './modules/Client.js' export { isError } from './modules/Error.js' export { Select } from './modules/Select.js' +export * as SelectionSets from './modules/SelectionSets.js' diff --git a/website/pokemon/modules/SelectionSets.ts b/website/pokemon/modules/SelectionSets.ts index 0655efe3..8b06e706 100644 --- a/website/pokemon/modules/SelectionSets.ts +++ b/website/pokemon/modules/SelectionSets.ts @@ -57,7 +57,7 @@ export interface Mutation { /** * Select the `addPokemon` field on the `Mutation` object. Its type is Object. */ - addPokemon?: Mutation.addPokemon$Expanded | $Select.SelectAlias.SelectAlias + addPokemon?: Mutation.addPokemon | $Select.SelectAlias.SelectAlias /** * Inline fragments for field groups. @@ -130,7 +130,7 @@ export interface Query { /** * Select the `pokemonByName` field on the `Query` object. Its type is Object. */ - pokemonByName?: Query.pokemonByName$Expanded | $Select.SelectAlias.SelectAlias + pokemonByName?: Query.pokemonByName | $Select.SelectAlias.SelectAlias /** * Select the `pokemons` field on the `Query` object. Its type is Object. */ @@ -138,7 +138,7 @@ export interface Query { /** * Select the `trainerByName` field on the `Query` object. Its type is Object. */ - trainerByName?: Query.trainerByName$Expanded | $Select.SelectAlias.SelectAlias + trainerByName?: Query.trainerByName | $Select.SelectAlias.SelectAlias /** * Select the `trainers` field on the `Query` object. Its type is Object. */ @@ -326,10 +326,20 @@ export interface Being extends $Select.Bases.ObjectLike { export interface Being$FragmentInline extends Being, $Select.Directive.$Groups.InlineFragment.Fields {} export namespace Being { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator @@ -410,10 +420,20 @@ export interface BattleRoyale$FragmentInline extends BattleRoyale, $Select.Direc export namespace BattleRoyale { export interface combatants extends _RefDefs._CombatantMultiPokemon {} export type combatants$Expanded = combatants + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type date$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -487,10 +507,20 @@ export namespace BattleTrainer { export type combatant1$Expanded = combatant1 export interface combatant2 extends _RefDefs._CombatantSinglePokemon {} export type combatant2$Expanded = combatant2 + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type date$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator @@ -564,16 +594,31 @@ export interface BattleWild$FragmentInline extends BattleWild, $Select.Directive // ----------------------------------------| Fields Interfaces | export namespace BattleWild { + /** + * This is the "expanded" version of the `date` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type date$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type date = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator export interface pokemon extends _RefDefs._Pokemon {} export type pokemon$Expanded = pokemon + /** + * This is the "expanded" version of the `result` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type result$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type result = $Select.Indicator.NoArgsIndicator @@ -751,14 +796,29 @@ export interface Patron$FragmentInline extends Patron, $Select.Directive.$Groups // ----------------------------------------| Fields Interfaces | export namespace Patron { + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `money` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type money$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type money = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator @@ -837,32 +897,67 @@ export interface Pokemon$FragmentInline extends Pokemon, $Select.Directive.$Grou // ----------------------------------------| Fields Interfaces | export namespace Pokemon { + /** + * This is the "expanded" version of the `attack` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type attack$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type attack = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `birthday` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type birthday$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type birthday = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `defense` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type defense$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type defense = $Select.Indicator.NoArgsIndicator + /** + * This is the "expanded" version of the `hp` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type hp$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type hp = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator export interface trainer extends _RefDefs._Trainer {} export type trainer$Expanded = trainer + /** + * This is the "expanded" version of the `type` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type type$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type type = $Select.Indicator.NoArgsIndicator @@ -929,16 +1024,31 @@ export interface Trainer$FragmentInline extends Trainer, $Select.Directive.$Grou // ----------------------------------------| Fields Interfaces | export namespace Trainer { + /** + * This is the "expanded" version of the `$class` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ export type $class$Expanded = $Select.Indicator.NoArgsIndicator$Expanded export type $class = $Select.Indicator.NoArgsIndicator export interface fans extends _RefDefs._Patron {} export type fans$Expanded = fans + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type id = $Select.Indicator.NoArgsIndicator + /** + * 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 = $Select.Indicator.NoArgsIndicator$Expanded export type name = $Select.Indicator.NoArgsIndicator