Skip to content

Commit

Permalink
gen
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Oct 21, 2024
1 parent 4fd8f68 commit c27e63e
Show file tree
Hide file tree
Showing 16 changed files with 1,389 additions and 1,379 deletions.

Large diffs are not rendered by default.

1,760 changes: 869 additions & 891 deletions src/generator/generator/__snapshots__/generate.test.ts.snap

Large diffs are not rendered by default.

102 changes: 51 additions & 51 deletions tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -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 ScalarStandard.
* Select the `id` field on the `Mutation` object. Its type is `ID` (a `Scalar`).
*/
id?: Mutation.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Mutation.id<$Scalars>>
/**
* Select the `idNonNull` field on the `Mutation` object. Its type is ScalarStandard.
* Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `Scalar`).
*/
idNonNull?: Mutation.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Mutation.idNonNull<$Scalars>>

Expand Down
34 changes: 17 additions & 17 deletions tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,11 @@ export interface BattleRoyale<$Scalars extends $$Utilities.Schema.Scalar.ScalarM
| BattleRoyale.combatants$Expanded<$Scalars>
| $Select.SelectAlias.SelectAlias<BattleRoyale.combatants<$Scalars>>
/**
* Select the `date` field on the `BattleRoyale` object. Its type is ScalarStandard.
* Select the `date` field on the `BattleRoyale` object. Its type is `Float` (a `Scalar`).
*/
date?: BattleRoyale.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<BattleRoyale.date<$Scalars>>
/**
* Select the `id` field on the `BattleRoyale` object. Its type is ScalarStandard.
* Select the `id` field on the `BattleRoyale` object. Its type is `ID` (a `Scalar`).
*/
id?: BattleRoyale.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<BattleRoyale.id<$Scalars>>
/**
Expand Down Expand Up @@ -613,11 +613,11 @@ export interface BattleTrainer<$Scalars extends $$Utilities.Schema.Scalar.Scalar
| BattleTrainer.combatant2$Expanded<$Scalars>
| $Select.SelectAlias.SelectAlias<BattleTrainer.combatant2<$Scalars>>
/**
* Select the `date` field on the `BattleTrainer` object. Its type is ScalarStandard.
* Select the `date` field on the `BattleTrainer` object. Its type is `Float` (a `Scalar`).
*/
date?: BattleTrainer.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<BattleTrainer.date<$Scalars>>
/**
* Select the `id` field on the `BattleTrainer` object. Its type is ScalarStandard.
* Select the `id` field on the `BattleTrainer` object. Its type is `ID` (a `Scalar`).
*/
id?: BattleTrainer.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<BattleTrainer.id<$Scalars>>
/**
Expand Down Expand Up @@ -772,11 +772,11 @@ export interface BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap
extends $Select.Bases.ObjectLike
{
/**
* Select the `date` field on the `BattleWild` object. Its type is ScalarStandard.
* Select the `date` field on the `BattleWild` object. Its type is `Float` (a `Scalar`).
*/
date?: BattleWild.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<BattleWild.date<$Scalars>>
/**
* Select the `id` field on the `BattleWild` object. Its type is ScalarStandard.
* Select the `id` field on the `BattleWild` object. Its type is `ID` (a `Scalar`).
*/
id?: BattleWild.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<BattleWild.id<$Scalars>>
/**
Expand Down Expand Up @@ -1159,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 ScalarStandard.
* Select the `id` field on the `Patron` object. Its type is `ID` (a `Scalar`).
*/
id?: Patron.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Patron.id<$Scalars>>
/**
* Select the `money` field on the `Patron` object. Its type is ScalarStandard.
* Select the `money` field on the `Patron` object. Its type is `Int` (a `Scalar`).
*/
money?: Patron.money$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Patron.money<$Scalars>>
/**
* Select the `name` field on the `Patron` object. Its type is ScalarStandard.
* Select the `name` field on the `Patron` object. Its type is `String` (a `Scalar`).
*/
name?: Patron.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Patron.name<$Scalars>>

Expand Down Expand Up @@ -1281,27 +1281,27 @@ 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 ScalarStandard.
* Select the `attack` field on the `Pokemon` object. Its type is `Int` (a `Scalar`).
*/
attack?: Pokemon.attack$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Pokemon.attack<$Scalars>>
/**
* Select the `birthday` field on the `Pokemon` object. Its type is ScalarStandard.
* Select the `birthday` field on the `Pokemon` object. Its type is `Int` (a `Scalar`).
*/
birthday?: Pokemon.birthday$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Pokemon.birthday<$Scalars>>
/**
* Select the `defense` field on the `Pokemon` object. Its type is ScalarStandard.
* Select the `defense` field on the `Pokemon` object. Its type is `Int` (a `Scalar`).
*/
defense?: Pokemon.defense$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Pokemon.defense<$Scalars>>
/**
* Select the `hp` field on the `Pokemon` object. Its type is ScalarStandard.
* Select the `hp` field on the `Pokemon` object. Its type is `Int` (a `Scalar`).
*/
hp?: Pokemon.hp$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Pokemon.hp<$Scalars>>
/**
* Select the `id` field on the `Pokemon` object. Its type is ScalarStandard.
* Select the `id` field on the `Pokemon` object. Its type is `ID` (a `Scalar`).
*/
id?: Pokemon.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Pokemon.id<$Scalars>>
/**
* Select the `name` field on the `Pokemon` object. Its type is ScalarStandard.
* Select the `name` field on the `Pokemon` object. Its type is `String` (a `Scalar`).
*/
name?: Pokemon.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Pokemon.name<$Scalars>>
/**
Expand Down Expand Up @@ -1538,11 +1538,11 @@ export interface Trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap =
*/
fans?: Trainer.fans$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Trainer.fans<$Scalars>>
/**
* Select the `id` field on the `Trainer` object. Its type is ScalarStandard.
* Select the `id` field on the `Trainer` object. Its type is `ID` (a `Scalar`).
*/
id?: Trainer.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Trainer.id<$Scalars>>
/**
* Select the `name` field on the `Trainer` object. Its type is ScalarStandard.
* Select the `name` field on the `Trainer` object. Its type is `String` (a `Scalar`).
*/
name?: Trainer.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Trainer.name<$Scalars>>
/**
Expand Down
4 changes: 2 additions & 2 deletions tests/_/schemas/query-only/graffle/modules/SelectionSets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ScalarStandard.
* Select the `id` field on the `Query` object. Its type is `ID` (a `Scalar`).
*/
id?: Query.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Query.id<$Scalars>>
/**
* Select the `idNonNull` field on the `Query` object. Its type is ScalarStandard.
* Select the `idNonNull` field on the `Query` object. Its type is `ID` (a `Scalar`).
*/
idNonNull?: Query.idNonNull$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias<Query.idNonNull<$Scalars>>

Expand Down
34 changes: 33 additions & 1 deletion website/graffle/modules/MethodsSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface Query {
//
//
// ==================================================================================================
// Object
// OutputObject
// ==================================================================================================
//
//
Expand Down Expand Up @@ -81,3 +81,35 @@ export interface State {
export interface Subdivision {
<$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Subdivision>): $SelectionSet
}

//
//
//
//
//
//
// ==================================================================================================
// Union
// ==================================================================================================
//
//
//
//
//
//

//
//
//
//
//
//
// ==================================================================================================
// Interface
// ==================================================================================================
//
//
//
//
//
//
118 changes: 59 additions & 59 deletions website/graffle/modules/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,43 @@ export namespace Schema {
//
//

export type Query = $.ObjectQuery<{
continent: $.Field<
export type Query = $.StandardTypes.Query<{
continent: $.OutputField<
'continent',
$.Nullable<Continent>,
$.Args<{
code: $.InputField<$Scalar.ID>
}, false>
>
continents: $.Field<
continents: $.OutputField<
'continents',
$.List<Continent>,
$.Args<{
filter: $.InputField<$.Nullable<ContinentFilterInput>>
}, true>
>
countries: $.Field<
countries: $.OutputField<
'countries',
$.List<Country>,
$.Args<{
filter: $.InputField<$.Nullable<CountryFilterInput>>
}, true>
>
country: $.Field<
country: $.OutputField<
'country',
$.Nullable<Country>,
$.Args<{
code: $.InputField<$Scalar.ID>
}, false>
>
language: $.Field<
language: $.OutputField<
'language',
$.Nullable<Language>,
$.Args<{
code: $.InputField<$Scalar.ID>
}, false>
>
languages: $.Field<
languages: $.OutputField<
'languages',
$.List<Language>,
$.Args<{
Expand All @@ -72,7 +72,7 @@ export namespace Schema {
//
//
// ==================================================================================================
// Enum
// OutputObject
// ==================================================================================================
//
//
Expand All @@ -81,7 +81,54 @@ export namespace Schema {
//
//

// -- no types --
export type Continent = $.OutputObject<'Continent', {
code: $.OutputField<'code', $Scalar.ID, null>
countries: $.OutputField<'countries', $.List<Country>, null>
name: $.OutputField<'name', $Scalar.String, null>
}>

export type Country = $.OutputObject<'Country', {
awsRegion: $.OutputField<'awsRegion', $Scalar.String, null>
capital: $.OutputField<'capital', $.Nullable<$Scalar.String>, null>
code: $.OutputField<'code', $Scalar.ID, null>
continent: $.OutputField<'continent', Continent, null>
currencies: $.OutputField<'currencies', $.List<$Scalar.String>, null>
currency: $.OutputField<'currency', $.Nullable<$Scalar.String>, null>
emoji: $.OutputField<'emoji', $Scalar.String, null>
emojiU: $.OutputField<'emojiU', $Scalar.String, null>
languages: $.OutputField<'languages', $.List<Language>, null>
name: $.OutputField<
'name',
$Scalar.String,
$.Args<{
lang: $.InputField<$.Nullable<$Scalar.String>>
}, true>
>
native: $.OutputField<'native', $Scalar.String, null>
phone: $.OutputField<'phone', $Scalar.String, null>
phones: $.OutputField<'phones', $.List<$Scalar.String>, null>
states: $.OutputField<'states', $.List<State>, null>
subdivisions: $.OutputField<'subdivisions', $.List<Subdivision>, null>
}>

export type Language = $.OutputObject<'Language', {
code: $.OutputField<'code', $Scalar.ID, null>
name: $.OutputField<'name', $Scalar.String, null>
native: $.OutputField<'native', $Scalar.String, null>
rtl: $.OutputField<'rtl', $Scalar.Boolean, null>
}>

export type State = $.OutputObject<'State', {
code: $.OutputField<'code', $.Nullable<$Scalar.String>, null>
country: $.OutputField<'country', Country, null>
name: $.OutputField<'name', $Scalar.String, null>
}>

export type Subdivision = $.OutputObject<'Subdivision', {
code: $.OutputField<'code', $Scalar.ID, null>
emoji: $.OutputField<'emoji', $.Nullable<$Scalar.String>, null>
name: $.OutputField<'name', $Scalar.String, null>
}>

//
//
Expand Down Expand Up @@ -147,7 +194,7 @@ export namespace Schema {
//
//
// ==================================================================================================
// Object
// Union
// ==================================================================================================
//
//
Expand All @@ -156,54 +203,7 @@ export namespace Schema {
//
//

export type Continent = $.OutputObject<'Continent', {
code: $.Field<'code', $Scalar.ID, null>
countries: $.Field<'countries', $.List<Country>, null>
name: $.Field<'name', $Scalar.String, null>
}>

export type Country = $.OutputObject<'Country', {
awsRegion: $.Field<'awsRegion', $Scalar.String, null>
capital: $.Field<'capital', $.Nullable<$Scalar.String>, null>
code: $.Field<'code', $Scalar.ID, null>
continent: $.Field<'continent', Continent, null>
currencies: $.Field<'currencies', $.List<$Scalar.String>, null>
currency: $.Field<'currency', $.Nullable<$Scalar.String>, null>
emoji: $.Field<'emoji', $Scalar.String, null>
emojiU: $.Field<'emojiU', $Scalar.String, null>
languages: $.Field<'languages', $.List<Language>, null>
name: $.Field<
'name',
$Scalar.String,
$.Args<{
lang: $.InputField<$.Nullable<$Scalar.String>>
}, true>
>
native: $.Field<'native', $Scalar.String, null>
phone: $.Field<'phone', $Scalar.String, null>
phones: $.Field<'phones', $.List<$Scalar.String>, null>
states: $.Field<'states', $.List<State>, null>
subdivisions: $.Field<'subdivisions', $.List<Subdivision>, null>
}>

export type Language = $.OutputObject<'Language', {
code: $.Field<'code', $Scalar.ID, null>
name: $.Field<'name', $Scalar.String, null>
native: $.Field<'native', $Scalar.String, null>
rtl: $.Field<'rtl', $Scalar.Boolean, null>
}>

export type State = $.OutputObject<'State', {
code: $.Field<'code', $.Nullable<$Scalar.String>, null>
country: $.Field<'country', Country, null>
name: $.Field<'name', $Scalar.String, null>
}>

export type Subdivision = $.OutputObject<'Subdivision', {
code: $.Field<'code', $Scalar.ID, null>
emoji: $.Field<'emoji', $.Nullable<$Scalar.String>, null>
name: $.Field<'name', $Scalar.String, null>
}>
// -- no types --

//
//
Expand All @@ -212,7 +212,7 @@ export namespace Schema {
//
//
// ==================================================================================================
// Union
// Enum
// ==================================================================================================
//
//
Expand Down
Loading

0 comments on commit c27e63e

Please sign in to comment.