From a3010754ae0e131fc8fb129f20fe65dc50912128 Mon Sep 17 00:00:00 2001 From: Jason Kuhrt Date: Sun, 27 Oct 2024 09:53:28 -0400 Subject: [PATCH] feat(generator): support missing features & sdl "schema" (#1226) --- dprint.json | 4 +- ...tension_headers__dynamicHeaders.output.txt | 2 +- .../20_output/output_envelope.output.txt | 2 +- ...on_introspection__introspection.output.txt | 162 +- ...on_opentelemetry__opentelemetry.output.txt | 58 +- package.json | 1 + pnpm-lock.yaml | 74 + .../InferResult/OutputObject.ts | 2 +- src/documentBuilder/InferResult/_.ts | 2 +- src/documentBuilder/InferResult/__.test-d.ts | 4 +- src/documentBuilder/InferResult/operation.ts | 23 + src/documentBuilder/InferResult/root.ts | 32 - src/documentBuilder/Select/document.ts | 40 +- .../SelectGraphQLMapper/nodes/1_Document.ts | 2 +- src/extensions/CustomScalars/decode.ts | 2 +- src/extensions/Introspection/Introspection.ts | 38 +- src/extensions/Introspection/config.ts | 18 +- src/extensions/SchemaErrors/gentime.ts | 4 +- .../injectTypenameOnRootResultFields.ts | 10 +- .../tests/fixture/graffle.config.ts | 5 +- .../tests/fixture/graffle/modules/Client.ts | 1 - .../graffle/modules/MethodsDocument.ts | 1 - .../fixture/graffle/modules/MethodsRoot.ts | 196 +-- .../fixture/graffle/modules/MethodsSelect.ts | 10 +- .../tests/fixture/graffle/modules/Schema.ts | 94 +- .../graffle/modules/SchemaDrivenDataMap.ts | 22 +- .../tests/fixture/graffle/modules/Select.ts | 31 +- .../fixture/graffle/modules/SelectionSets.ts | 318 ++-- src/generator/cli/generate.ts | 2 +- src/generator/config/config.test.ts | 4 +- src/generator/config/config.ts | 104 +- src/generator/config/input.ts | 52 +- .../__snapshots__/generate.test.ts.snap | 1009 ++++++----- src/generator/generator/generate.test.ts | 30 + src/generator/generator/generate.ts | 9 +- src/generator/generators/Client.ts | 3 +- src/generator/generators/MethodsDocument.ts | 9 +- src/generator/generators/MethodsRoot.ts | 54 +- src/generator/generators/MethodsSelect.ts | 43 +- src/generator/generators/Scalar.ts | 6 +- src/generator/generators/Schema.ts | 61 +- .../generators/SchemaDrivenDataMap.ts | 35 +- src/generator/generators/Select.ts | 59 +- src/generator/generators/SelectionSets.ts | 36 +- src/generator/generators/global.ts | 1 - src/generator/helpers/render.ts | 13 - src/generator/helpers/types.ts | 2 +- src/layers/5_request/core.ts | 3 +- src/layers/6_client/gql/gql.ts | 3 +- .../6_client/requestMethods/document.ts | 4 +- .../6_client/requestMethods/requestMethods.ts | 21 +- src/lib/Code.ts | 31 +- src/lib/fsp.ts | 10 +- src/lib/grafaid/document.ts | 8 +- src/lib/grafaid/graphql.ts | 6 +- src/lib/grafaid/request.ts | 3 - src/lib/grafaid/schema/KindMap/_.ts | 106 +- src/lib/grafaid/schema/KindMap/__.ts | 32 +- src/lib/grafaid/schema/OperationType/_.ts | 8 + src/lib/grafaid/schema/OperationType/__.ts | 4 + src/lib/grafaid/schema/schema.ts | 18 - src/lib/prelude.ts | 2 + src/types/Schema/StandardTypes/_.ts | 1 - src/types/Schema/StandardTypes/object.ts | 16 - src/types/Schema/__.ts | 15 +- .../SchemaDrivenDataMap.ts | 8 +- tests/_/helpers.ts | 1 + tests/_/schemas/generate.ts | 5 +- .../kitchen-sink/graffle/modules/Client.ts | 1 - .../graffle/modules/MethodsDocument.ts | 1 - .../graffle/modules/MethodsRoot.ts | 196 +-- .../graffle/modules/MethodsSelect.ts | 10 +- .../kitchen-sink/graffle/modules/Schema.ts | 94 +- .../graffle/modules/SchemaDrivenDataMap.ts | 22 +- .../kitchen-sink/graffle/modules/Select.ts | 31 +- .../graffle/modules/SelectionSets.ts | 318 ++-- .../mutation-only/graffle/modules/Client.ts | 1 - .../graffle/modules/MethodsDocument.ts | 1 - .../graffle/modules/MethodsRoot.ts | 6 +- .../mutation-only/graffle/modules/Schema.ts | 8 +- .../graffle/modules/SchemaDrivenDataMap.ts | 4 +- .../mutation-only/graffle/modules/Select.ts | 31 +- .../graffle/modules/SelectionSets.ts | 8 - .../schemas/pokemon/graffle/modules/Client.ts | 1 - .../graffle/modules/MethodsDocument.ts | 1 - .../pokemon/graffle/modules/MethodsRoot.ts | 86 +- .../pokemon/graffle/modules/MethodsSelect.ts | 10 +- .../schemas/pokemon/graffle/modules/Schema.ts | 140 +- .../graffle/modules/SchemaDrivenDataMap.ts | 70 +- .../schemas/pokemon/graffle/modules/Select.ts | 31 +- .../pokemon/graffle/modules/SelectionSets.ts | 246 +-- .../query-only/graffle/modules/Client.ts | 1 - .../graffle/modules/MethodsDocument.ts | 1 - .../query-only/graffle/modules/MethodsRoot.ts | 6 +- .../query-only/graffle/modules/Schema.ts | 8 +- .../graffle/modules/SchemaDrivenDataMap.ts | 4 +- .../query-only/graffle/modules/Select.ts | 37 +- .../graffle/modules/SelectionSets.ts | 8 - tests/e2e/e2e.test.ts | 24 +- .../extension/introspection.detail.md | 162 +- .../examples/extension/introspection.md | 162 +- .../extension/opentelemetry.detail.md | 58 +- .../examples/extension/opentelemetry.md | 58 +- .../examples/output/envelope.detail.md | 2 +- .../_snippets/examples/output/envelope.md | 2 +- .../transport-http/dynamic-headers.detail.md | 2 +- .../transport-http/dynamic-headers.md | 2 +- .../10_transport-http/dynamic-headers.md | 2 +- .../content/examples/20_output/envelope.md | 2 +- .../examples/60_extension/introspection.md | 162 +- .../examples/60_extension/opentelemetry.md | 58 +- website/graffle/_.ts | 10 +- website/graffle/__.ts | 2 +- website/graffle/modules/Client.ts | 11 +- website/graffle/modules/Data.ts | 6 +- website/graffle/modules/Global.ts | 26 +- website/graffle/modules/MethodsDocument.ts | 13 +- website/graffle/modules/MethodsRoot.ts | 95 +- website/graffle/modules/MethodsSelect.ts | 28 +- website/graffle/modules/Scalar.ts | 4 +- website/graffle/modules/Schema.ts | 856 +++++++-- .../graffle/modules/SchemaDrivenDataMap.ts | 74 +- website/graffle/modules/SchemaRuntime.ts | 2 +- website/graffle/modules/Select.ts | 73 +- website/graffle/modules/SelectionSets.ts | 989 ++++++----- website/pokemon/_.ts | 10 +- website/pokemon/__.ts | 2 +- website/pokemon/modules/Client.ts | 11 +- website/pokemon/modules/Data.ts | 6 +- website/pokemon/modules/Global.ts | 27 +- website/pokemon/modules/MethodsDocument.ts | 13 +- website/pokemon/modules/MethodsRoot.ts | 167 +- website/pokemon/modules/MethodsSelect.ts | 56 +- website/pokemon/modules/Scalar.ts | 18 +- website/pokemon/modules/Schema.ts | 1130 ++++++++++-- .../pokemon/modules/SchemaDrivenDataMap.ts | 217 +-- website/pokemon/modules/SchemaRuntime.ts | 2 +- website/pokemon/modules/Select.ts | 99 +- website/pokemon/modules/SelectionSets.ts | 1530 +++++++++-------- 139 files changed, 6359 insertions(+), 4191 deletions(-) create mode 100644 src/documentBuilder/InferResult/operation.ts delete mode 100644 src/documentBuilder/InferResult/root.ts create mode 100644 src/lib/grafaid/schema/OperationType/_.ts create mode 100644 src/lib/grafaid/schema/OperationType/__.ts delete mode 100644 src/types/Schema/StandardTypes/object.ts diff --git a/dprint.json b/dprint.json index 3c1564b2f..0b3f3407e 100644 --- a/dprint.json +++ b/dprint.json @@ -9,7 +9,9 @@ }, "excludes": [ "**/node_modules", - "**/*-lock.json" + "**/*-lock.json", + "website/pokemon", + "website/graffle" ], "plugins": [ "https://plugins.dprint.dev/typescript-0.93.0.wasm", diff --git a/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt b/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt index ddfd4dd3e..8444c571f 100644 --- a/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt +++ b/examples/__outputs__/10_transport-http/transport-http_extension_headers__dynamicHeaders.output.txt @@ -4,7 +4,7 @@ headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729824583010' + 'x-sent-at-time': '1730036844970' }, signal: undefined, method: 'post', diff --git a/examples/__outputs__/20_output/output_envelope.output.txt b/examples/__outputs__/20_output/output_envelope.output.txt index 19e0af908..457c1cd32 100644 --- a/examples/__outputs__/20_output/output_envelope.output.txt +++ b/examples/__outputs__/20_output/output_envelope.output.txt @@ -16,7 +16,7 @@ headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Fri, 25 Oct 2024 02:49:44 GMT', + date: 'Sun, 27 Oct 2024 13:47:26 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt b/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt index 020a32e57..7d74d9088 100644 --- a/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt +++ b/examples/__outputs__/60_extension/extension_introspection__introspection.output.txt @@ -1,6 +1,7 @@ ---------------------------------------- SHOW ---------------------------------------- { __schema: { + description: null, queryType: { name: 'Query' }, mutationType: { name: 'Mutation' }, subscriptionType: null, @@ -9,6 +10,8 @@ kind: 'UNION', name: 'Battle', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -23,6 +26,8 @@ kind: 'OBJECT', name: 'BattleRoyale', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatants', @@ -78,6 +83,8 @@ kind: 'OBJECT', name: 'BattleTrainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatant1', @@ -137,6 +144,8 @@ kind: 'OBJECT', name: 'BattleWild', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'date', @@ -204,6 +213,8 @@ kind: 'ENUM', name: 'BattleWildResult', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -233,6 +244,8 @@ kind: 'INTERFACE', name: 'Being', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -264,6 +277,8 @@ kind: 'SCALAR', name: 'Boolean', description: 'The `Boolean` scalar type represents `true` or `false`.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -274,6 +289,8 @@ kind: 'OBJECT', name: 'CombatantMultiPokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemons', @@ -309,6 +326,8 @@ kind: 'OBJECT', name: 'CombatantSinglePokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemon', @@ -336,6 +355,8 @@ kind: 'SCALAR', name: 'Date', description: 'A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -346,19 +367,25 @@ kind: 'INPUT_OBJECT', name: 'DateFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'gte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'lte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -369,6 +396,8 @@ kind: 'SCALAR', name: 'Float', description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -379,6 +408,8 @@ kind: 'SCALAR', name: 'ID', description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -389,6 +420,8 @@ kind: 'SCALAR', name: 'Int', description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -399,6 +432,8 @@ kind: 'OBJECT', name: 'Mutation', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'addPokemon', @@ -408,19 +443,25 @@ name: 'attack', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'defense', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'hp', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -430,7 +471,9 @@ name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'type', @@ -440,7 +483,9 @@ name: null, ofType: { kind: 'ENUM', name: 'PokemonType', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Pokemon', ofType: null }, @@ -457,6 +502,8 @@ kind: 'OBJECT', name: 'Patron', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -492,6 +539,8 @@ kind: 'OBJECT', name: 'Pokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'attack', @@ -567,13 +616,17 @@ kind: 'INPUT_OBJECT', name: 'PokemonFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'birthday', description: null, type: { kind: 'INPUT_OBJECT', name: 'DateFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -583,7 +636,9 @@ name: 'StringFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -594,6 +649,8 @@ kind: 'ENUM', name: 'PokemonType', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -635,6 +692,8 @@ kind: 'OBJECT', name: 'Query', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'battles', @@ -704,7 +763,9 @@ name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -731,7 +792,9 @@ name: 'PokemonFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -758,7 +821,9 @@ name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Trainer', ofType: null }, @@ -791,6 +856,8 @@ kind: 'SCALAR', name: 'String', description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -801,13 +868,17 @@ kind: 'INPUT_OBJECT', name: 'StringFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'contains', description: null, type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'in', @@ -821,7 +892,9 @@ ofType: { kind: 'SCALAR', name: 'String', ofType: null } } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -832,6 +905,8 @@ kind: 'OBJECT', name: 'Trainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'class', @@ -899,6 +974,8 @@ kind: 'ENUM', name: 'TrainerClass', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -990,6 +1067,8 @@ description: 'A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n' + '\n' + "In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1055,7 +1134,9 @@ name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1088,6 +1169,8 @@ kind: 'ENUM', name: '__DirectiveLocation', description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1213,6 +1296,8 @@ kind: 'OBJECT', name: '__EnumValue', description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1264,6 +1349,8 @@ kind: 'OBJECT', name: '__Field', description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1293,7 +1380,9 @@ name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1358,6 +1447,8 @@ kind: 'OBJECT', name: '__InputValue', description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1429,6 +1520,8 @@ kind: 'OBJECT', name: '__Schema', description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'description', @@ -1518,6 +1611,8 @@ description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n' + '\n' + 'Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'kind', @@ -1563,7 +1658,9 @@ name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1618,7 +1715,9 @@ name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1641,7 +1740,9 @@ name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1682,6 +1783,8 @@ kind: 'ENUM', name: '__TypeKind', description: 'An enum describing what kind of type a given `__Type` is.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1742,6 +1845,7 @@ { name: 'deprecated', description: 'Marks an element of a GraphQL schema as no longer supported.', + isRepeatable: false, locations: [ 'ARGUMENT_DEFINITION', 'ENUM_VALUE', @@ -1753,13 +1857,16 @@ name: 'reason', description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: '"No longer supported"' + defaultValue: '"No longer supported"', + isDeprecated: false, + deprecationReason: null } ] }, { name: 'include', description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1770,19 +1877,23 @@ name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'oneOf', description: 'Indicates exactly one field must be supplied and this field must not be `null`.', + isRepeatable: false, locations: [ 'INPUT_OBJECT' ], args: [] }, { name: 'skip', description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1793,13 +1904,16 @@ name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'specifiedBy', description: 'Exposes a URL that specifies the behavior of this scalar.', + isRepeatable: false, locations: [ 'SCALAR' ], args: [ { @@ -1810,7 +1924,9 @@ name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] } diff --git a/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt b/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt index 27fcdbde4..96f33dea7 100644 --- a/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt +++ b/examples/__outputs__/60_extension/extension_opentelemetry__opentelemetry.output.txt @@ -9,14 +9,14 @@ } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'encode', - id: 'bb6b0c035e3cbc85', + id: '6165d2d039ddc330', kind: 0, - timestamp: 1729824584441000, - duration: 1365.042, + timestamp: 1730036847285000, + duration: 1356.625, attributes: {}, status: { code: 0 }, events: [], @@ -33,14 +33,14 @@ } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'pack', - id: '996cd2f8c264080a', + id: 'bb6311c736ff6b68', kind: 0, - timestamp: 1729824584444000, - duration: 12774.667, + timestamp: 1730036847288000, + duration: 12403.5, attributes: {}, status: { code: 0 }, events: [], @@ -57,14 +57,14 @@ } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'exchange', - id: '3ad972c399fb8ec2', + id: 'd20f5ebfbc8710b0', kind: 0, - timestamp: 1729824584458000, - duration: 21008.167, + timestamp: 1730036847301000, + duration: 24152.959, attributes: {}, status: { code: 0 }, events: [], @@ -81,14 +81,14 @@ } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'unpack', - id: 'bbdb7c3156b126e9', + id: 'b16337bf48d7aa8a', kind: 0, - timestamp: 1729824584479000, - duration: 1927.291, + timestamp: 1730036847325000, + duration: 1765.417, attributes: {}, status: { code: 0 }, events: [], @@ -105,14 +105,14 @@ } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'decode', - id: 'e311421c9b0a3a5d', + id: 'd1716e5187f9ee3c', kind: 0, - timestamp: 1729824584481000, - duration: 221.916, + timestamp: 1730036847327000, + duration: 219.459, attributes: {}, status: { code: 0 }, events: [], @@ -129,14 +129,14 @@ } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', + traceId: '384833e31759d7c8c990afcdc091163c', parentId: undefined, traceState: undefined, name: 'request', - id: 'f1eb7799e82ca59a', + id: '02ea45a5cb1a818f', kind: 0, - timestamp: 1729824584440000, - duration: 40916.625, + timestamp: 1730036847284000, + duration: 43532.666, attributes: {}, status: { code: 0 }, events: [], diff --git a/package.json b/package.json index 34263f626..3db2f0057 100644 --- a/package.json +++ b/package.json @@ -190,6 +190,7 @@ "graphql-upload-minimal": "^1.6.1", "graphql-yoga": "^5.7.0", "jsdom": "^25.0.1", + "memfs": "^4.14.0", "prettier": "^3.3.3", "publint": "^0.2.12", "strip-ansi": "^7.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2da02426b..0d885b638 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -138,6 +138,9 @@ importers: jsdom: specifier: ^25.0.1 version: 25.0.1 + memfs: + specifier: ^4.14.0 + version: 4.14.0 prettier: specifier: ^3.3.3 version: 3.3.3 @@ -761,6 +764,24 @@ packages: '@jridgewell/sourcemap-codec@1.5.0': resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + '@jsonjoy.com/base64@1.1.2': + resolution: {integrity: sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + + '@jsonjoy.com/json-pack@1.1.0': + resolution: {integrity: sha512-zlQONA+msXPPwHWZMKFVS78ewFczIll5lXiVPwFPCZUsrOKdxc2AvxU1HoNBmMRhqDZUR9HkC3UOm+6pME6Xsg==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + + '@jsonjoy.com/util@1.5.0': + resolution: {integrity: sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + '@kamilkisiela/fast-url-parser@1.1.4': resolution: {integrity: sha512-gbkePEBupNydxCelHCESvFSFM8XPh1Zs/OAVRW/rKpEqPAl5PbOM90Si8mv9bvnR53uPD2s/FiRxdvSejpRJew==} @@ -2487,6 +2508,10 @@ packages: resolution: {integrity: sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==} engines: {node: '>=18.18.0'} + hyperdyperid@1.2.0: + resolution: {integrity: sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==} + engines: {node: '>=10.18'} + iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} @@ -2838,6 +2863,10 @@ packages: mdast-util-to-string@2.0.0: resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} + memfs@4.14.0: + resolution: {integrity: sha512-JUeY0F/fQZgIod31Ja1eJgiSxLn7BfQlCnqhwXFBzFHEw63OdLK7VJUJ7bnzNsWgCyoUP5tEp1VRY8rDaYzqOA==} + engines: {node: '>= 4.0.0'} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -3500,6 +3529,12 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + thingies@1.21.0: + resolution: {integrity: sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==} + engines: {node: '>=10.18'} + peerDependencies: + tslib: ^2 + through2@4.0.2: resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} @@ -3551,6 +3586,12 @@ packages: resolution: {integrity: sha512-hN4uFRxbK+PX56DxYiGHsTn2dME3TVr9vbNqlQGcGcPhJAn+tdP126iA+TArMpI4YSgnTkMWyoLl5bf81Hi5TA==} engines: {node: '>= 0.4'} + tree-dump@1.0.2: + resolution: {integrity: sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==} + engines: {node: '>=10.0'} + peerDependencies: + tslib: '2' + treeify@1.1.0: resolution: {integrity: sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==} engines: {node: '>=0.6'} @@ -4460,6 +4501,22 @@ snapshots: '@jridgewell/sourcemap-codec@1.5.0': {} + '@jsonjoy.com/base64@1.1.2(tslib@2.8.0)': + dependencies: + tslib: 2.8.0 + + '@jsonjoy.com/json-pack@1.1.0(tslib@2.8.0)': + dependencies: + '@jsonjoy.com/base64': 1.1.2(tslib@2.8.0) + '@jsonjoy.com/util': 1.5.0(tslib@2.8.0) + hyperdyperid: 1.2.0 + thingies: 1.21.0(tslib@2.8.0) + tslib: 2.8.0 + + '@jsonjoy.com/util@1.5.0(tslib@2.8.0)': + dependencies: + tslib: 2.8.0 + '@kamilkisiela/fast-url-parser@1.1.4': {} '@kwsites/file-exists@1.1.1': @@ -6612,6 +6669,8 @@ snapshots: human-signals@8.0.0: {} + hyperdyperid@1.2.0: {} + iconv-lite@0.6.3: dependencies: safer-buffer: 2.1.2 @@ -6992,6 +7051,13 @@ snapshots: mdast-util-to-string@2.0.0: {} + memfs@4.14.0: + dependencies: + '@jsonjoy.com/json-pack': 1.1.0(tslib@2.8.0) + '@jsonjoy.com/util': 1.5.0(tslib@2.8.0) + tree-dump: 1.0.2(tslib@2.8.0) + tslib: 2.8.0 + merge2@1.4.1: {} micromark-extension-footnote@0.3.2: @@ -7692,6 +7758,10 @@ snapshots: dependencies: any-promise: 1.3.0 + thingies@1.21.0(tslib@2.8.0): + dependencies: + tslib: 2.8.0 + through2@4.0.2: dependencies: readable-stream: 3.6.2 @@ -7737,6 +7807,10 @@ snapshots: typedarray.prototype.slice: 1.0.3 which-typed-array: 1.1.15 + tree-dump@1.0.2(tslib@2.8.0): + dependencies: + tslib: 2.8.0 + treeify@1.1.0: {} trim-lines@3.0.1: {} diff --git a/src/documentBuilder/InferResult/OutputObject.ts b/src/documentBuilder/InferResult/OutputObject.ts index 007ed2a9f..c7b49b240 100644 --- a/src/documentBuilder/InferResult/OutputObject.ts +++ b/src/documentBuilder/InferResult/OutputObject.ts @@ -26,7 +26,7 @@ type SelectionNonSelectAlias<$SelectionSet, $Schema extends Schema, $Node extend export namespace Errors { export type UnknownFieldName< $FieldName extends string, - $Object extends Schema.StandardTypes.RootType | Schema.OutputObject, + $Object extends Schema.OutputObject, > = TSErrorDescriptive<'Object', `field "${$FieldName}" does not exist on object "${$Object['name']}"`> } diff --git a/src/documentBuilder/InferResult/_.ts b/src/documentBuilder/InferResult/_.ts index 92f637cb2..fbc47e45d 100644 --- a/src/documentBuilder/InferResult/_.ts +++ b/src/documentBuilder/InferResult/_.ts @@ -1,7 +1,7 @@ export * from './Alias.js' export * from './Interface.js' +export * from './operation.js' export * from './OutputField.js' export * from './OutputObject.js' -export * from './root.js' export * from './ScalarsWildcard.js' export * from './Union.js' diff --git a/src/documentBuilder/InferResult/__.test-d.ts b/src/documentBuilder/InferResult/__.test-d.ts index a4a449ae6..f9e2bc8bb 100644 --- a/src/documentBuilder/InferResult/__.test-d.ts +++ b/src/documentBuilder/InferResult/__.test-d.ts @@ -7,11 +7,11 @@ import type { Registry } from '../../types/Schema/nodes/Scalar/helpers.js' import type { InferResult } from './__.js' import type { PickSelectsPositiveIndicatorAndNotSelectAlias } from './OutputObject.js' -type $<$SelectionSet extends SelectionSets.Query> = InferResult.Query<$SelectionSet, Schema> +type $<$SelectionSet extends SelectionSets.Query> = InferResult.OperationQuery<$SelectionSet, Schema> type $Registry = Registry.AddScalar -type $WithDate<$SelectionSet extends SelectionSets.Query<$Registry>> = InferResult.Query< +type $WithDate<$SelectionSet extends SelectionSets.Query<$Registry>> = InferResult.OperationQuery< $SelectionSet, Schema<$Registry> > diff --git a/src/documentBuilder/InferResult/operation.ts b/src/documentBuilder/InferResult/operation.ts new file mode 100644 index 000000000..f15b1a741 --- /dev/null +++ b/src/documentBuilder/InferResult/operation.ts @@ -0,0 +1,23 @@ +import type { OperationTypeNode } from 'graphql' +import type { Grafaid } from '../../lib/grafaid/__.js' +import { type ExcludeNull } from '../../lib/prelude.js' +import type { Schema } from '../../types/Schema/__.js' +import type { OutputObject } from './OutputObject.js' + +// dprint-ignore +export type OperationQuery<$SelectionSet, $Schema extends Schema> = + Operation<$SelectionSet, $Schema, OperationTypeNode.QUERY> + +// dprint-ignore +export type OperationMutation<$SelectionSet, $Schema extends Schema> = + Operation<$SelectionSet, $Schema, OperationTypeNode.MUTATION> + +// dprint-ignore +export type OperationSubscription<$SelectionSet, $Schema extends Schema> = + Operation<$SelectionSet, $Schema, OperationTypeNode.SUBSCRIPTION> + +export type Operation< + $SelectionSet, + $Schema extends Schema, + $OperationType extends Grafaid.Document.OperationTypeNode, +> = OutputObject<$SelectionSet, $Schema, ExcludeNull<$Schema['Root'][$OperationType]>> diff --git a/src/documentBuilder/InferResult/root.ts b/src/documentBuilder/InferResult/root.ts deleted file mode 100644 index 215189696..000000000 --- a/src/documentBuilder/InferResult/root.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { Grafaid } from '../../lib/grafaid/__.js' -import { type ExcludeNull } from '../../lib/prelude.js' -import type { Schema } from '../../types/Schema/__.js' -import type { OutputObject } from './OutputObject.js' - -export type RootViaObject< - $SelectionSet, - $Schema extends Schema, - $RootType extends Schema.StandardTypes.RootType, -> = Root< - $SelectionSet, - $Schema, - $RootType['name'] -> - -// dprint-ignore -export type Query<$SelectionSet, $Schema extends Schema> = - Root<$SelectionSet, $Schema, 'Query'> - -// dprint-ignore -export type Mutation<$SelectionSet, $Schema extends Schema> = - Root<$SelectionSet, $Schema, 'Mutation'> - -// dprint-ignore -export type Subscription<$SelectionSet, $Schema extends Schema> = - Root<$SelectionSet, $Schema, 'Subscription'> - -export type Root< - $SelectionSet, - $Schema extends Schema, - $RootTypeName extends Grafaid.Schema.RootTypeName, -> = OutputObject<$SelectionSet, $Schema, ExcludeNull<$Schema['Root'][$RootTypeName]>> diff --git a/src/documentBuilder/Select/document.ts b/src/documentBuilder/Select/document.ts index 0b5c52f4d..7b2b4551c 100644 --- a/src/documentBuilder/Select/document.ts +++ b/src/documentBuilder/Select/document.ts @@ -1,6 +1,6 @@ import type { OperationTypeNode } from 'graphql' import { Grafaid } from '../../lib/grafaid/__.js' -import type { FirstNonUnknownNever, IsKeyInObjectOptional, Values } from '../../lib/prelude.js' +import type { FirstNonUnknownNever, Values } from '../../lib/prelude.js' import type { Select } from './__.js' export type OperationName = string @@ -33,10 +33,10 @@ export type GetOperationNames<$Document extends SomeDocument> = Values< > // dprint-ignore -export type GetRootTypeNameOfOperation<$Document extends SomeDocument, $Name extends OperationName> = - IsKeyInObjectOptional<$Document[OperationTypeNode.MUTATION], $Name> extends true ? Grafaid.Schema.RootTypeNameMutation : - IsKeyInObjectOptional<$Document[OperationTypeNode.QUERY], $Name> extends true ? Grafaid.Schema.RootTypeNameQuery : - never +export type GetOperationType<$Document extends SomeDocument, $Name extends string> = + $Name extends keyof $Document[OperationTypeNode.MUTATION] ? OperationTypeNode.MUTATION : + $Name extends keyof $Document[OperationTypeNode.QUERY] ? OperationTypeNode.QUERY : + never // dprint-ignore export type GetOperation<$Document extends SomeDocument, $Name extends string> = @@ -50,7 +50,6 @@ export type GetOperation<$Document extends SomeDocument, $Name extends string> = export interface OperationNormalized { name: string | null type: OperationTypeNode - rootType: Grafaid.Schema.RootTypeName selectionSet: Select.SelectionSet.AnySelectionSet } @@ -58,21 +57,17 @@ export interface DocumentNormalized { operations: Record facts: { hasMultipleOperations: boolean - hasRootType: { - query: boolean - mutation: boolean - subscription: boolean - } } } export const createDocumentNormalizedFromQuerySelection = ( selectionSet: Select.SelectionSet.AnySelectionSet, operationName?: string, -): DocumentNormalized => createDocumentNormalizedFromRootTypeSelection(`Query`, selectionSet, operationName) +): DocumentNormalized => + createDocumentNormalizedFromRootTypeSelection(Grafaid.Document.OperationTypeNode.QUERY, selectionSet, operationName) export const createDocumentNormalizedFromRootTypeSelection = ( - rootTypeName: Grafaid.Schema.RootTypeName, + operationType: Grafaid.Document.OperationTypeNode, selectionSet: Select.SelectionSet.AnySelectionSet, operationName?: string, ): DocumentNormalized => @@ -80,18 +75,12 @@ export const createDocumentNormalizedFromRootTypeSelection = ( operations: { [operationName ?? defaultOperationName]: { name: operationName ?? null, - type: Grafaid.Document.RootTypeToOperationType[rootTypeName], - rootType: rootTypeName, + type: operationType, selectionSet, }, }, facts: { hasMultipleOperations: false, - hasRootType: { - query: rootTypeName === Grafaid.Schema.RootTypeName.Query, - mutation: rootTypeName === Grafaid.Schema.RootTypeName.Mutation, - subscription: rootTypeName === Grafaid.Schema.RootTypeName.Subscription, - }, }, }) @@ -100,16 +89,14 @@ export const normalizeOrThrow = (document: DocumentObject): DocumentNormalized = [name, selectionSet], ): [name: string, OperationNormalized] => [name, { name, - type: Grafaid.Document.RootTypeToOperationType[Grafaid.Schema.RootTypeName.Query], - rootType: Grafaid.Schema.RootTypeName.Query, + type: Grafaid.Document.OperationTypeNode.QUERY, selectionSet, }]) const mutationOperations = Object.entries(document.mutation ?? {}).map(( [name, selectionSet], ): [name: string, OperationNormalized] => [name, { name, - type: Grafaid.Document.RootTypeToOperationType[Grafaid.Schema.RootTypeName.Mutation], - rootType: Grafaid.Schema.RootTypeName.Mutation, + type: Grafaid.Document.OperationTypeNode.MUTATION, selectionSet, }]) const operations = [ @@ -144,11 +131,6 @@ export const normalizeOrThrow = (document: DocumentObject): DocumentNormalized = operations: Object.fromEntries(operations), facts: { hasMultipleOperations, - hasRootType: { - query: queryOperations.length > 0, - mutation: mutationOperations.length > 0, - subscription: false, - }, }, }) } diff --git a/src/documentBuilder/SelectGraphQLMapper/nodes/1_Document.ts b/src/documentBuilder/SelectGraphQLMapper/nodes/1_Document.ts index bd5d8551a..145c6f649 100644 --- a/src/documentBuilder/SelectGraphQLMapper/nodes/1_Document.ts +++ b/src/documentBuilder/SelectGraphQLMapper/nodes/1_Document.ts @@ -13,7 +13,7 @@ export const toGraphQLDocument = ( const operationsAndVariables = Object .values(graffleDocument.operations) .map(graffleOperation => { - const sddm = options?.sddm?.roots[graffleOperation.rootType] + const sddm = options?.sddm?.operations[graffleOperation.type] return toGraphQLOperationDefinition(sddm, graffleOperation, options) }) diff --git a/src/extensions/CustomScalars/decode.ts b/src/extensions/CustomScalars/decode.ts index 597ae28f8..8fd1a2987 100644 --- a/src/extensions/CustomScalars/decode.ts +++ b/src/extensions/CustomScalars/decode.ts @@ -24,7 +24,7 @@ export const decodeResultData = ({ request, data, sddm, scalars }: { */ scalars: Schema.Scalar.ScalarMap }) => { - const sddmOutputObject = sddm.roots[request.rootType] + const sddmOutputObject = sddm.operations[request.operation.operation] if (!sddmOutputObject) return if (!data) return diff --git a/src/extensions/Introspection/Introspection.ts b/src/extensions/Introspection/Introspection.ts index 2bafa1f5c..546a6ace8 100644 --- a/src/extensions/Introspection/Introspection.ts +++ b/src/extensions/Introspection/Introspection.ts @@ -6,6 +6,8 @@ import type { HandleOutput } from '../../layers/6_client/handleOutput.js' import type { Fluent } from '../../lib/fluent/__.js' import { createConfig, type Input } from './config.js' +const knownPotentiallyUnsupportedFeatures = [`inputValueDeprecation`, `oneOf`] as const + /** * This extension adds a `.introspect` method to the client that will return the introspected schema. * @@ -29,21 +31,33 @@ export const Introspection = (input?: Input) => { name: `Introspection`, onBuilderGet: ({ path, property, client }) => { if (!(path.length === 0 && property === `introspect`)) return + const clientCatching = client.with({ output: { envelope: false, errors: { execution: `return` } } }) return async () => { - const introspectionQueryDocument = getIntrospectionQuery(config.options) + let introspectionQueryDocument = getIntrospectionQuery(config.options) + const result = await clientCatching.gql(introspectionQueryDocument).send() + const featuresDropped: string[] = [] + const enabledKnownPotentiallyUnsupportedFeatures = knownPotentiallyUnsupportedFeatures.filter(_ => + config.options[_] !== false + ) + + // Try to find a working introspection query. + if (result instanceof Error) { + for (const feature of enabledKnownPotentiallyUnsupportedFeatures) { + featuresDropped.push(feature) + introspectionQueryDocument = getIntrospectionQuery({ + ...config.options, + [feature]: false, + }) + const result = await clientCatching.gql(introspectionQueryDocument).send() + if (!(result instanceof Error)) break + } + } - // todo use config schema override. - // This will require being able to change the configured schema. - // If moving between transports (e.g. endpoint / instance) then it could break anyware - // that assumes a certain transport is being used. - // Solutions: - // 1. Don't narrow hook types of inline anyware. Safe. Harder to write anyware for all cases. - // 2. Somehow make this extensions input inherit the transport constraint of the instance it is being used on. - // Meaning the input would not allow any schema source but only those compatible with the transport. - // Note: This would still require some kind of unsafe internal way to change the already set schema. - // Maybe make it safe using with wherein with allows changing as described above _within the transport constraint_. - // 3. Don't make this safe. Rely on users not hitting case of mixing transports + having an anyware not expecting it. + // Send the query again with the host configuration for output. + // TODO rather than having to make this query again expose a way to send a value through the output handler here. + // TODO expose the featuresDropped info on the envelope so that upstream can communicate to users what happened + // finally at runtime. return await client.gql(introspectionQueryDocument).send() } }, diff --git a/src/extensions/Introspection/config.ts b/src/extensions/Introspection/config.ts index e9e6bfd0e..bed70d384 100644 --- a/src/extensions/Introspection/config.ts +++ b/src/extensions/Introspection/config.ts @@ -1,4 +1,5 @@ import type { GraphQLSchema, IntrospectionOptions } from 'graphql' +import type { InputIntrospectionOptions } from '../../generator/_.js' export type Input = { /** @@ -6,9 +7,13 @@ export type Input = { */ schema?: string | URL | GraphQLSchema /** - * The introspection query options. By default only some kinds of information are included. See JSDoc for each option's own default value. + * The introspection query options. By default all kinds of information are sought. + * + * Where those options are known to be optional by valid GraphQL servers then they start enabled but are + * progressively disabled upon introspection failure until success or no more known potentially + * unsupported features remain. */ - options?: IntrospectionOptions + options?: InputIntrospectionOptions } export type Config = { @@ -18,7 +23,14 @@ export type Config = { export const defaults = { schema: null, - options: {}, + options: { + descriptions: true, + specifiedByUrl: true, + directiveIsRepeatable: true, + schemaDescription: true, + inputValueDeprecation: true, + oneOf: true, + }, } satisfies Config export const createConfig = (input?: Input): Config => { diff --git a/src/extensions/SchemaErrors/gentime.ts b/src/extensions/SchemaErrors/gentime.ts index fb285b26b..192a9eb28 100644 --- a/src/extensions/SchemaErrors/gentime.ts +++ b/src/extensions/SchemaErrors/gentime.ts @@ -31,7 +31,7 @@ export const SchemaErrors = (input?: Input) => { onSchema: ({ config: genConfig, schema }) => { const errorObjects = getErrorObjects(config, genConfig) schema[`SchemaErrors`] = { - objectNames: errorObjects.map(_ => Code.string(_.name)).join(` | `), + objectNames: errorObjects.map(type => Code.string(type.name)).join(` | `), } }, schemaDrivenDataMap: { @@ -57,5 +57,5 @@ export const SchemaErrors = (input?: Input) => { // todo memoize const getErrorObjects = (config: Config, genConfig: GeneratorConfig) => { - return Object.values(genConfig.schema.kindMap.OutputObject).filter(config.isErrorType) + return Object.values(genConfig.schema.kindMap.list.OutputObject).filter(config.isErrorType) } diff --git a/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.ts b/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.ts index a398c19d6..e001b51ff 100644 --- a/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.ts +++ b/src/extensions/SchemaErrors/injectTypenameOnRootResultFields.ts @@ -10,22 +10,22 @@ export const injectTypenameOnRootResultFields = ( ): void => { injectTypenameOnRootResultFields_({ sddm, - rootTypeName: request.rootType, + operationType: request.operation.operation, selectionSet: request.operation.selectionSet, }) } const injectTypenameOnRootResultFields_ = ( - { selectionSet, sddm, rootTypeName }: { + { selectionSet, sddm, operationType }: { sddm: SchemaDrivenDataMap - rootTypeName: Grafaid.Schema.RootTypeName + operationType: Grafaid.Document.OperationTypeNode selectionSet: Nodes.SelectionSetNode }, ): void => { for (const selection of selectionSet.selections) { switch (selection.kind) { case Nodes.Kind.FIELD: { - const isResultField = Boolean(sddm.roots[rootTypeName]?.f[selection.name.value]?.r) + const isResultField = Boolean(sddm.operations[operationType]?.f[selection.name.value]?.r) if (isResultField) { // @ts-expect-error selections is typed as readonly // @see https://github.com/graphql/graphql-js/discussions/4212 @@ -35,7 +35,7 @@ const injectTypenameOnRootResultFields_ = ( } case Nodes.Kind.INLINE_FRAGMENT: { injectTypenameOnRootResultFields_({ - rootTypeName, + operationType, sddm, selectionSet: selection.selectionSet, }) diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts b/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts index 2cc3fab35..b0982f361 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle.config.ts @@ -5,7 +5,10 @@ import { SchemaErrors } from '../../gentime.js' export default Generator .configure({ name: `GraffleSchemaErrors`, - schema, + schema: { + type: `instance`, + instance: schema, + }, lint: { missingCustomScalarCodec: false, }, diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Client.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Client.ts index f8886572f..86b18f2a1 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Client.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Client.ts @@ -2,5 +2,4 @@ import { createPrefilled } from '../../../../../../entrypoints/client.js' import { defaultSchemaUrl } from './Data.js' import { Name } from './Data.js' import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsDocument.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsDocument.ts index 027637d44..b40a5a23c 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsDocument.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsDocument.ts @@ -1,7 +1,6 @@ import type * as Utilities from '../../../../../../entrypoints/utilities-for-generated.js' import type { Schema } from './Schema.js' import type * as SelectionSets from './SelectionSets.js' - export interface Document<$Context extends Utilities.ClientContext> { <$Document>( document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsRoot.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsRoot.ts index 7858c529a..58bf3998f 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsRoot.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsRoot.ts @@ -3,52 +3,6 @@ import type * as $$Utilities from '../../../../../../entrypoints/utilities-for-g import type { Schema } from './Schema.js' import type * as SelectionSet from './SelectionSets.js' -export interface MutationMethods<$Context extends $$Utilities.ClientContext> { - $batch: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutput< - $Context, - InferResult.Mutation<$SelectionSet, Schema<$Context['scalars']>> - > - > - > - __typename: () => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - { __typename: 'Mutation' }, - '__typename' - > - > - > - - id: <$SelectionSet>( - selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.id<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - InferResult.Mutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, - 'id' - > - > - > - - idNonNull: <$SelectionSet>( - selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.idNonNull<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - InferResult.Mutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, - 'idNonNull' - > - > - > -} - export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $batch: <$SelectionSet>( selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context['scalars']>>, @@ -56,7 +10,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Query<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<$SelectionSet, Schema<$Context['scalars']>> > > > @@ -76,7 +30,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ InputObjectNested: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ InputObjectNested: $SelectionSet }, Schema<$Context['scalars']>>, 'InputObjectNested' > > @@ -88,7 +42,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ InputObjectNestedNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ InputObjectNestedNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'InputObjectNestedNonNull' > > @@ -102,7 +56,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ abcEnum: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ abcEnum: $SelectionSet }, Schema<$Context['scalars']>>, 'abcEnum' > > @@ -114,7 +68,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ argInputObjectCircular: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ argInputObjectCircular: $SelectionSet }, Schema<$Context['scalars']>>, 'argInputObjectCircular' > > @@ -126,7 +80,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ date: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ date: $SelectionSet }, Schema<$Context['scalars']>>, 'date' > > @@ -138,7 +92,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArg: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArg' > > @@ -150,7 +104,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgInputObject' > > @@ -162,7 +116,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgList' > > @@ -174,7 +128,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNull' > > @@ -186,7 +140,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNullList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNullList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNullList' > > @@ -198,7 +152,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNullListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNullListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNullListNonNull' > > @@ -210,7 +164,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateInterface1: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateInterface1: $SelectionSet }, Schema<$Context['scalars']>>, 'dateInterface1' > > @@ -222,7 +176,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateList' > > @@ -234,7 +188,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateListList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateListList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateListList' > > @@ -246,7 +200,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateListNonNull' > > @@ -258,7 +212,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateNonNull' > > @@ -270,7 +224,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateObject1: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateObject1: $SelectionSet }, Schema<$Context['scalars']>>, 'dateObject1' > > @@ -282,7 +236,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateUnion: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateUnion: $SelectionSet }, Schema<$Context['scalars']>>, 'dateUnion' > > @@ -294,7 +248,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ error: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ error: $SelectionSet }, Schema<$Context['scalars']>>, 'error' > > @@ -306,7 +260,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ id: $SelectionSet }, Schema<$Context['scalars']>>, 'id' > > @@ -318,7 +272,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'idNonNull' > > @@ -330,7 +284,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interface: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interface: $SelectionSet }, Schema<$Context['scalars']>>, 'interface' > > @@ -342,7 +296,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interfaceNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interfaceNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'interfaceNonNull' > > @@ -354,7 +308,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interfaceWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interfaceWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'interfaceWithArgs' > > @@ -366,7 +320,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listInt: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listInt: $SelectionSet }, Schema<$Context['scalars']>>, 'listInt' > > @@ -378,7 +332,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'listIntNonNull' > > @@ -390,7 +344,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listListInt: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listListInt: $SelectionSet }, Schema<$Context['scalars']>>, 'listListInt' > > @@ -402,7 +356,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listListIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listListIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'listListIntNonNull' > > @@ -414,7 +368,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ lowerCaseUnion: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ lowerCaseUnion: $SelectionSet }, Schema<$Context['scalars']>>, 'lowerCaseUnion' > > @@ -426,7 +380,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ object: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ object: $SelectionSet }, Schema<$Context['scalars']>>, 'object' > > @@ -438,7 +392,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectList: $SelectionSet }, Schema<$Context['scalars']>>, 'objectList' > > @@ -450,7 +404,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'objectListNonNull' > > @@ -462,7 +416,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectNested: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectNested: $SelectionSet }, Schema<$Context['scalars']>>, 'objectNested' > > @@ -474,7 +428,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'objectNonNull' > > @@ -486,7 +440,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'objectWithArgs' > > @@ -498,7 +452,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ result: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ result: $SelectionSet }, Schema<$Context['scalars']>>, 'result' > > @@ -510,7 +464,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ resultNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ resultNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'resultNonNull' > > @@ -522,7 +476,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ string: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ string: $SelectionSet }, Schema<$Context['scalars']>>, 'string' > > @@ -534,7 +488,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgEnum: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgEnum: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgEnum' > > @@ -546,7 +500,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgInputObject' > > @@ -561,7 +515,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgInputObjectRequired: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgInputObjectRequired: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgInputObjectRequired' > > @@ -575,7 +529,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgs' > > @@ -587,7 +541,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithListArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithListArg: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithListArg' > > @@ -599,7 +553,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithListArgRequired: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithListArgRequired: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithListArgRequired' > > @@ -611,7 +565,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithRequiredArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithRequiredArg: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithRequiredArg' > > @@ -623,7 +577,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBar: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBar: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBar' > > @@ -635,7 +589,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBarNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBarNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBarNonNull' > > @@ -647,7 +601,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBarWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBarWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBarWithArgs' > > @@ -659,7 +613,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionObject: $SelectionSet }, Schema<$Context['scalars']>>, 'unionObject' > > @@ -671,16 +625,62 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionObjectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionObjectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'unionObjectNonNull' > > > } +export interface MutationMethods<$Context extends $$Utilities.ClientContext> { + $batch: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutput< + $Context, + InferResult.OperationMutation<$SelectionSet, Schema<$Context['scalars']>> + > + > + > + __typename: () => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + { __typename: 'Mutation' }, + '__typename' + > + > + > + + id: <$SelectionSet>( + selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.id<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + 'id' + > + > + > + + idNonNull: <$SelectionSet>( + selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.idNonNull<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + 'idNonNull' + > + > + > +} + export interface BuilderMethodsRoot<$Context extends $$Utilities.ClientContext> { - mutation: MutationMethods<$Context> query: QueryMethods<$Context> + mutation: MutationMethods<$Context> } export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction.Fn { diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts index 41c7532a2..23e78868d 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/MethodsSelect.ts @@ -18,8 +18,8 @@ import type * as $SelectionSets from './SelectionSets.js' // export interface $MethodsSelect { - Mutation: Mutation Query: Query + Mutation: Mutation Bar: Bar DateObject1: DateObject1 DateObject2: DateObject2 @@ -58,14 +58,14 @@ export interface $MethodsSelect { // // -export interface Mutation { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet -} - export interface Query { <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet } +export interface Mutation { + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet +} + // // // diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts index 28420e9e2..6cef13de8 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Schema.ts @@ -20,45 +20,6 @@ export namespace Schema { // // - // Mutation - // -------------------------------------------------------------------------------------------------- - // - - export interface Mutation extends $.OutputObject { - name: 'Mutation' - fields: { - __typename: Mutation.__typename - id: Mutation.id - idNonNull: Mutation.idNonNull - } - } - - export namespace Mutation { - export interface __typename extends $.OutputField { - name: '__typename' - arguments: {} - inlineType: [1] - namedType: { - kind: '__typename' - value: 'Mutation' - } - } - - export interface id extends $.OutputField { - name: 'id' - arguments: {} - inlineType: [0] - namedType: $$NamedTypes.$$ID - } - - export interface idNonNull extends $.OutputField { - name: 'idNonNull' - arguments: {} - inlineType: [1] - namedType: $$NamedTypes.$$ID - } - } - // Query // -------------------------------------------------------------------------------------------------- // @@ -696,6 +657,45 @@ export namespace Schema { } } + // Mutation + // -------------------------------------------------------------------------------------------------- + // + + export interface Mutation extends $.OutputObject { + name: 'Mutation' + fields: { + __typename: Mutation.__typename + id: Mutation.id + idNonNull: Mutation.idNonNull + } + } + + export namespace Mutation { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Mutation' + } + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface idNonNull extends $.OutputField { + name: 'idNonNull' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$ID + } + } + // // // @@ -1616,8 +1616,8 @@ export namespace Schema { */ namespace $$NamedTypes { - export type $$Mutation = Mutation export type $$Query = Query + export type $$Mutation = Mutation export type $$Bar = Bar export type $$DateObject1 = DateObject1 export type $$DateObject2 = DateObject2 @@ -1673,16 +1673,18 @@ export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$ extends $ { name: Data.Name - RootTypesPresent: ['Mutation', 'Query'] - RootUnion: Schema.Mutation | Schema.Query + operationsAvailable: ['query', 'mutation'] + RootUnion: + | Schema.Query + | Schema.Mutation Root: { - Query: Schema.Query - Mutation: Schema.Mutation - Subscription: null + query: Schema.Query + mutation: Schema.Mutation + subscription: null } allTypes: { - Mutation: Schema.Mutation Query: Schema.Query + Mutation: Schema.Mutation ABCEnum: Schema.ABCEnum Case: Schema.Case Bar: Schema.Bar diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts index 3a66b5744..364e1e835 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SchemaDrivenDataMap.ts @@ -329,13 +329,6 @@ const lowerCaseUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { - f: { - id: {}, - idNonNull: {}, - }, -} - const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { InputObjectNested: { @@ -630,6 +623,13 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { }, } +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + id: {}, + idNonNull: {}, + }, +} + // // // @@ -690,9 +690,9 @@ Query.f[`unionObjectNonNull`]!.nt = ObjectUnion // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Mutation, - Query, + operations: { + query: Query, + mutation: Mutation, }, directives: {}, types: { @@ -728,8 +728,8 @@ const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { FooBarUnion, Result, lowerCaseUnion, - Mutation, Query, + Mutation, }, } diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts index b7cafe920..ce6a778a2 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/Select.ts @@ -1,3 +1,4 @@ +import type { OperationTypeNode } from 'graphql' import type { InferResult } from '../../../../../../entrypoints/schema.js' import * as Data from './Data.js' import type { Schema } from './Schema.js' @@ -38,16 +39,22 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Root< + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Operation< $SelectionSet, Schema, - 'Mutation' + OperationTypeNode.QUERY > - export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // OutputObject Types - // ------------------ + export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Operation< + $SelectionSet, + Schema, + OperationTypeNode.MUTATION + > + // OutputObject + // -------------------------------------------------------------------------------------------------- + // export type Bar<$SelectionSet extends SelectionSets.Bar> = InferResult.OutputObject< $SelectionSet, Schema, @@ -107,8 +114,9 @@ export namespace Select { Schema, Schema['allTypes']['lowerCaseObject2'] > - // Union Types - // ----------- + // Union + // -------------------------------------------------------------------------------------------------- + // export type DateUnion<$SelectionSet extends SelectionSets.DateUnion> = InferResult.Union< $SelectionSet, Schema, @@ -129,8 +137,9 @@ export namespace Select { Schema, Schema['allTypes']['lowerCaseUnion'] > - // Interface Types - // --------------- + // Interface + // -------------------------------------------------------------------------------------------------- + // export type DateInterface1<$SelectionSet extends SelectionSets.DateInterface1> = InferResult.Interface< $SelectionSet, Schema, diff --git a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts index 295aa6d0a..30874357d 100644 --- a/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts +++ b/src/extensions/SchemaErrors/tests/fixture/graffle/modules/SelectionSets.ts @@ -40,122 +40,9 @@ export interface $Document< // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- -// Mutation -// -------------------------------------------------------------------------------------------------- -// -// - -// ----------------------------------------| Entrypoint Interface | - -export interface Mutation< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> { - /** - * Select the `id` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). - */ - id?: Mutation.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> - /** - * Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). - */ - idNonNull?: Mutation.idNonNull$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Mutation$FragmentInline<_$Scalars> - | Mutation$FragmentInline<_$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Mutation$FragmentInline< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { -} - -// ----------------------------------------| Fields | - -export namespace Mutation { - export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<_$Scalars> - - export interface id$SelectionSet< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > extends $Select.Bases.Base {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `id` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type id$Expanded< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<_$Scalars> - > - - // -------------------------------------------------------------------------------------------------- - - export type idNonNull< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = - | $Select.Indicator.NoArgsIndicator - | idNonNull$SelectionSet<_$Scalars> - - export interface idNonNull$SelectionSet< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > extends $Select.Bases.Base {} - - // --- expanded --- - - /** - * 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< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | idNonNull$SelectionSet<_$Scalars> - > -} - -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -1933,6 +1820,103 @@ export namespace Query { > } +// Mutation +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * Select the `id` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: Mutation.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + idNonNull?: Mutation.idNonNull$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Mutation$FragmentInline<_$Scalars> + | Mutation$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Mutation$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Mutation { + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type idNonNull< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = + | $Select.Indicator.NoArgsIndicator + | idNonNull$SelectionSet<_$Scalars> + + export interface idNonNull$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * 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< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | idNonNull$SelectionSet<_$Scalars> + > +} + // // // @@ -2039,17 +2023,9 @@ export interface InputObjectNestedNonNull< // // -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Bar // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2114,17 +2090,9 @@ export namespace Bar { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // DateObject1 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2189,17 +2157,9 @@ export namespace DateObject1 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // DateObject2 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2264,17 +2224,9 @@ export namespace DateObject2 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ErrorOne // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2367,17 +2319,9 @@ export namespace ErrorOne { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ErrorTwo // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2470,17 +2414,9 @@ export namespace ErrorTwo { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Foo // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2548,17 +2484,9 @@ export namespace Foo { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object1 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2765,17 +2693,9 @@ export namespace Object1 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object1ImplementingInterface // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2872,17 +2792,9 @@ export namespace Object1ImplementingInterface { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object2ImplementingInterface // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2981,17 +2893,9 @@ export namespace Object2ImplementingInterface { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ObjectNested // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3082,17 +2986,9 @@ export namespace ObjectNested { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ObjectUnion // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3158,17 +3054,9 @@ export namespace ObjectUnion { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // lowerCaseObject // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3233,17 +3121,9 @@ export namespace lowerCaseObject { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // lowerCaseObject2 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3672,11 +3552,11 @@ export namespace Interface { * would end up with an error of `export interface Foo extends Foo ...` */ export namespace $NamedTypes { + export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Query<_$Scalars> export type $Mutation< _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, > = Mutation<_$Scalars> - export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = - Query<_$Scalars> export type $ABCEnum = ABCEnum export type $Case = Case export type $InputObject< diff --git a/src/generator/cli/generate.ts b/src/generator/cli/generate.ts index 77243e72a..1729afdbf 100755 --- a/src/generator/cli/generate.ts +++ b/src/generator/cli/generate.ts @@ -78,7 +78,7 @@ const url = args.schema ? urlParseSafe(args.schema) : null const schemaViaCLI = args.schema ? url ? { type: `url` as const, url } - : { type: `sdl` as const, dirOrFilePath: Path.join(process.cwd(), args.schema) } + : { type: `sdlFile` as const, dirOrFilePath: Path.join(process.cwd(), args.schema) } : undefined const schema = schemaViaCLI ?? configModule.builder?._.input.schema diff --git a/src/generator/config/config.test.ts b/src/generator/config/config.test.ts index bd75a5c32..e028b5f90 100644 --- a/src/generator/config/config.test.ts +++ b/src/generator/config/config.test.ts @@ -4,7 +4,7 @@ import { createConfig } from './config.js' test(`can load schema from custom path`, async () => { const customPathFile = `./tests/_/fixtures/custom.graphql` - const config = await createConfig({ schema: { type: `sdl`, dirOrFilePath: customPathFile } }) + const config = await createConfig({ schema: { type: `sdlFile`, dirOrFilePath: customPathFile } }) const field = config.schema.instance.getQueryType()?.getFields()[`customNamedSchemaFile`] expect(config.paths.project.inputs.schema).match(new RegExp(customPathFile + `$`)) expect(config.schema.sdl).toMatchSnapshot() @@ -13,7 +13,7 @@ test(`can load schema from custom path`, async () => { test(`can load schema from custom dir using default file name`, async () => { const customPathDir = `tests/_/fixtures` - const config = await createConfig({ schema: { type: `sdl`, dirOrFilePath: customPathDir } }) + const config = await createConfig({ schema: { type: `sdlFile`, dirOrFilePath: customPathDir } }) const field = config.schema.instance.getQueryType()?.getFields()[`defaultNamedSchemaFile`] expect(config.paths.project.inputs.schema).match(new RegExp(customPathDir + `/schema.graphql$`)) expect(config.schema.sdl).toMatchSnapshot() diff --git a/src/generator/config/config.ts b/src/generator/config/config.ts index 6a8014039..3388aa216 100644 --- a/src/generator/config/config.ts +++ b/src/generator/config/config.ts @@ -3,7 +3,7 @@ import * as Path from 'node:path' import { Graffle } from '../../entrypoints/__Graffle.js' import { Introspection } from '../../extensions/Introspection/Introspection.js' import { ConfigManager } from '../../lib/config-manager/__.js' -import { fileExists, isPathToADirectory, toAbsolutePath, toFilePath } from '../../lib/fsp.js' +import { fileExists, type Fs, isPathToADirectory, toAbsolutePath, toFilePath } from '../../lib/fsp.js' import { Grafaid } from '../../lib/grafaid/__.js' import { isString } from '../../lib/prelude.js' import { type Formatter, getTypeScriptFormatter, passthroughFormatter } from '../../lib/typescript-formatter.js' @@ -13,6 +13,7 @@ import { defaultName } from './defaults.js' import type { Input, InputLibraryPaths, InputLint } from './input.js' export interface Config { + fs: Fs name: string lint: Required schema: ConfigSchema @@ -55,7 +56,7 @@ export interface Config { } interface ConfigSchema { - via: 'sdl' | 'introspection' | 'instance' + via: Input['schema']['type'] sdl: string sdlFilePath: null | string instance: Grafaid.Schema.Schema @@ -165,11 +166,14 @@ To suppress this warning disable formatting in one of the following ways: : Path.join(outputDirPathRoot, `schema.graphql`) : null + // --- Fs --- + const fs = input.fs ?? await import(`node:fs/promises`) // --- Config --- // const customScalarsEnabled = input.customScalars ?? false return { + fs, extensions: input.extensions ?? [], lint, formatter, @@ -219,53 +223,59 @@ const createConfigSchema = async ( sourceDirPath: string, input: Input, ): Promise => { - if (input.schema instanceof Grafaid.Schema.Schema) { - const sdl = Grafaid.Schema.print(input.schema) - const instance = input.schema - return { - via: `instance`, - sdl, - sdlFilePath: null, - instance, - kindMap: Grafaid.Schema.KindMap.getKindMap(instance), - } - } else if (input.schema.type === `sdl`) { - const fileOrDirPath = input.schema.dirOrFilePath - ? toAbsolutePath(cwd, input.schema.dirOrFilePath) - : sourceDirPath - const isDir = await isPathToADirectory(fileOrDirPath) - const sdlFilePath = isDir ? Path.join(fileOrDirPath, defaultSchemaFileName) : fileOrDirPath - const sdl = await fs.readFile(sdlFilePath, `utf8`) - const instance = Grafaid.Schema.buildSchema(sdl) - return { - via: `sdl`, - sdlFilePath, - sdl, - instance, - kindMap: Grafaid.Schema.KindMap.getKindMap(instance), + switch (input.schema.type) { + case `instance`: { + const sdl = Grafaid.Schema.print(input.schema.instance) + const instance = input.schema.instance + const kindMap = Grafaid.Schema.KindMap.getKindMap(instance) + return { + via: input.schema.type, + sdlFilePath: null, + sdl, + instance, + kindMap, + } } - } else { - const graffle = Graffle.create({ schema: input.schema.url }).use(Introspection({ - options: { - directiveIsRepeatable: true, - schemaDescription: true, - specifiedByUrl: true, - inputValueDeprecation: true, - // todo oneOf - }, - })) - const data = await graffle.introspect() - if (!data) { - throw new Error(`No data returned for introspection query.`) + case `sdl`: + case `sdlFile`: { + let sdl + let sdlFilePath: null | string = null + if (input.schema.type === `sdlFile`) { + const fileOrDirPath = input.schema.dirOrFilePath + ? toAbsolutePath(cwd, input.schema.dirOrFilePath) + : sourceDirPath + const isDir = await isPathToADirectory(fileOrDirPath) + sdlFilePath = isDir ? Path.join(fileOrDirPath, defaultSchemaFileName) : fileOrDirPath + sdl = await fs.readFile(sdlFilePath, `utf8`) + } else { + sdl = input.schema.sdl + } + const instance = Grafaid.Schema.buildSchema(sdl) + const kindMap = Grafaid.Schema.KindMap.getKindMap(instance) + return { + via: input.schema.type, + sdlFilePath, + sdl, + instance, + kindMap, + } } - const instance = Grafaid.Schema.buildClientSchema(data) - const sdl = Grafaid.Schema.print(instance) - return { - via: `introspection`, - sdl, - sdlFilePath: null, - instance, - kindMap: Grafaid.Schema.KindMap.getKindMap(instance), + case `url`: { + const graffle = Graffle.create({ schema: input.schema.url }).use(Introspection()) + const data = await graffle.introspect() + if (!data) { + throw new Error(`No data returned for introspection query.`) + } + const instance = Grafaid.Schema.buildClientSchema(data) + const sdl = Grafaid.Schema.print(instance) + const kindMap = Grafaid.Schema.KindMap.getKindMap(instance) + return { + via: `url`, + sdlFilePath: null, + sdl, + instance, + kindMap, + } } } } diff --git a/src/generator/config/input.ts b/src/generator/config/input.ts index a57803416..e9aaede0d 100644 --- a/src/generator/config/input.ts +++ b/src/generator/config/input.ts @@ -1,3 +1,5 @@ +import type { IntrospectionOptions } from 'graphql' +import type { Fs } from '../../lib/fsp.js' import type { Grafaid } from '../../lib/grafaid/__.js' import type { Extension } from '../extension/types.js' @@ -11,6 +13,10 @@ export interface InputLint { } export interface Input { + /** + * File system API to use. By default uses the Node.js file system API. + */ + fs?: Fs /** * The name of the client. This will affect: * @@ -36,8 +42,14 @@ export interface Input { /** * The schema to use for generation. Can be an existing SDL file on disk, a schema instance already in memory, or an endpoint that will be introspected. */ - schema: Grafaid.Schema.Schema | { + schema: { type: 'sdl' + sdl: string + } | { + type: 'instance' + instance: Grafaid.Schema.Schema + } | { + type: 'sdlFile' /** * Defaults to the source directory if set, otherwise the current working directory. */ @@ -45,6 +57,7 @@ export interface Input { } | { type: 'url' url: URL + options?: InputIntrospectionOptions } /** * If the schema comes from a non-sdl-file source like a GraphQL endpoint URL, should a derived SDL file be written to disk? @@ -131,6 +144,43 @@ export interface Input { extensions?: Extension[] } +export interface InputIntrospectionOptions extends IntrospectionOptions { + /** + * Whether to include descriptions in the introspection result. + * @defaultValue `true` + */ + descriptions?: boolean + /** + * Whether to include `specifiedByURL` in the introspection result. + * @defaultValue `true` + */ + specifiedByUrl?: boolean + /** + * Whether to include `isRepeatable` flag on directives. + * @defaultValue `true` + */ + directiveIsRepeatable?: boolean + /** + * Whether to include `description` field on schema. + * @defaultValue `true` + */ + schemaDescription?: boolean + /** + * Whether target GraphQL server support deprecation of input values. + * + * By default an attempt will be made to introspect this information + * and if it fails then fallback to false for this option. + */ + inputValueDeprecation?: boolean + /** + * Whether target GraphQL server supports `@oneOf` input objects. + * + * By default an attempt will be made to introspect this information + * and if it fails then fallback to false for this option. + */ + oneOf?: boolean +} + export interface InputLibraryPaths { client?: string schema?: string diff --git a/src/generator/generator/__snapshots__/generate.test.ts.snap b/src/generator/generator/__snapshots__/generate.test.ts.snap index 6cacfac96..1b1448248 100644 --- a/src/generator/generator/__snapshots__/generate.test.ts.snap +++ b/src/generator/generator/__snapshots__/generate.test.ts.snap @@ -24,7 +24,6 @@ exports[`kitchen-sink generated modules > modules/Client.ts 1`] = ` import { defaultSchemaUrl } from './Data.js' import { Name } from './Data.js' import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) " `; @@ -67,7 +66,6 @@ exports[`kitchen-sink generated modules > modules/MethodsDocument.ts 1`] = ` "import type * as Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import type { Schema } from './Schema.js' import type * as SelectionSets from './SelectionSets.js' - export interface Document<$Context extends Utilities.ClientContext> { <$Document>( document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, @@ -93,52 +91,6 @@ import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-f import type { Schema } from './Schema.js' import type * as SelectionSet from './SelectionSets.js' -export interface MutationMethods<$Context extends $$Utilities.ClientContext> { - $batch: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutput< - $Context, - InferResult.Mutation<$SelectionSet, Schema<$Context['scalars']>> - > - > - > - __typename: () => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - { __typename: 'Mutation' }, - '__typename' - > - > - > - - id: <$SelectionSet>( - selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.id<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - InferResult.Mutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, - 'id' - > - > - > - - idNonNull: <$SelectionSet>( - selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.idNonNull<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - InferResult.Mutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, - 'idNonNull' - > - > - > -} - export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $batch: <$SelectionSet>( selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context['scalars']>>, @@ -146,7 +98,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Query<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<$SelectionSet, Schema<$Context['scalars']>> > > > @@ -166,7 +118,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ InputObjectNested: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ InputObjectNested: $SelectionSet }, Schema<$Context['scalars']>>, 'InputObjectNested' > > @@ -178,7 +130,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ InputObjectNestedNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ InputObjectNestedNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'InputObjectNestedNonNull' > > @@ -192,7 +144,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ abcEnum: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ abcEnum: $SelectionSet }, Schema<$Context['scalars']>>, 'abcEnum' > > @@ -204,7 +156,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ argInputObjectCircular: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ argInputObjectCircular: $SelectionSet }, Schema<$Context['scalars']>>, 'argInputObjectCircular' > > @@ -216,7 +168,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ date: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ date: $SelectionSet }, Schema<$Context['scalars']>>, 'date' > > @@ -228,7 +180,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArg: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArg' > > @@ -240,7 +192,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgInputObject' > > @@ -252,7 +204,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgList' > > @@ -264,7 +216,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNull' > > @@ -276,7 +228,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNullList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNullList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNullList' > > @@ -288,7 +240,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNullListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNullListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNullListNonNull' > > @@ -300,7 +252,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateInterface1: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateInterface1: $SelectionSet }, Schema<$Context['scalars']>>, 'dateInterface1' > > @@ -312,7 +264,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateList' > > @@ -324,7 +276,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateListList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateListList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateListList' > > @@ -336,7 +288,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateListNonNull' > > @@ -348,7 +300,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateNonNull' > > @@ -360,7 +312,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateObject1: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateObject1: $SelectionSet }, Schema<$Context['scalars']>>, 'dateObject1' > > @@ -372,7 +324,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateUnion: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateUnion: $SelectionSet }, Schema<$Context['scalars']>>, 'dateUnion' > > @@ -384,7 +336,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ error: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ error: $SelectionSet }, Schema<$Context['scalars']>>, 'error' > > @@ -396,7 +348,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ id: $SelectionSet }, Schema<$Context['scalars']>>, 'id' > > @@ -408,7 +360,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'idNonNull' > > @@ -420,7 +372,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interface: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interface: $SelectionSet }, Schema<$Context['scalars']>>, 'interface' > > @@ -432,7 +384,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interfaceNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interfaceNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'interfaceNonNull' > > @@ -444,7 +396,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interfaceWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interfaceWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'interfaceWithArgs' > > @@ -456,7 +408,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listInt: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listInt: $SelectionSet }, Schema<$Context['scalars']>>, 'listInt' > > @@ -468,7 +420,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'listIntNonNull' > > @@ -480,7 +432,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listListInt: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listListInt: $SelectionSet }, Schema<$Context['scalars']>>, 'listListInt' > > @@ -492,7 +444,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listListIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listListIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'listListIntNonNull' > > @@ -504,7 +456,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ lowerCaseUnion: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ lowerCaseUnion: $SelectionSet }, Schema<$Context['scalars']>>, 'lowerCaseUnion' > > @@ -516,7 +468,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ object: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ object: $SelectionSet }, Schema<$Context['scalars']>>, 'object' > > @@ -528,7 +480,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectList: $SelectionSet }, Schema<$Context['scalars']>>, 'objectList' > > @@ -540,7 +492,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'objectListNonNull' > > @@ -552,7 +504,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectNested: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectNested: $SelectionSet }, Schema<$Context['scalars']>>, 'objectNested' > > @@ -564,7 +516,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'objectNonNull' > > @@ -576,7 +528,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'objectWithArgs' > > @@ -588,7 +540,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ result: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ result: $SelectionSet }, Schema<$Context['scalars']>>, 'result' > > @@ -600,7 +552,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ resultNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ resultNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'resultNonNull' > > @@ -612,7 +564,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ string: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ string: $SelectionSet }, Schema<$Context['scalars']>>, 'string' > > @@ -624,7 +576,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgEnum: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgEnum: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgEnum' > > @@ -636,7 +588,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgInputObject' > > @@ -651,7 +603,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgInputObjectRequired: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgInputObjectRequired: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgInputObjectRequired' > > @@ -665,7 +617,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgs' > > @@ -677,7 +629,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithListArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithListArg: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithListArg' > > @@ -689,7 +641,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithListArgRequired: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithListArgRequired: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithListArgRequired' > > @@ -701,7 +653,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithRequiredArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithRequiredArg: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithRequiredArg' > > @@ -713,7 +665,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBar: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBar: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBar' > > @@ -725,7 +677,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBarNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBarNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBarNonNull' > > @@ -737,7 +689,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBarWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBarWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBarWithArgs' > > @@ -749,7 +701,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionObject: $SelectionSet }, Schema<$Context['scalars']>>, 'unionObject' > > @@ -761,16 +713,62 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionObjectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionObjectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'unionObjectNonNull' > > > } +export interface MutationMethods<$Context extends $$Utilities.ClientContext> { + $batch: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutput< + $Context, + InferResult.OperationMutation<$SelectionSet, Schema<$Context['scalars']>> + > + > + > + __typename: () => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + { __typename: 'Mutation' }, + '__typename' + > + > + > + + id: <$SelectionSet>( + selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.id<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + 'id' + > + > + > + + idNonNull: <$SelectionSet>( + selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.idNonNull<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + 'idNonNull' + > + > + > +} + export interface BuilderMethodsRoot<$Context extends $$Utilities.ClientContext> { - mutation: MutationMethods<$Context> query: QueryMethods<$Context> + mutation: MutationMethods<$Context> } export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction.Fn { @@ -801,8 +799,8 @@ import type * as $SelectionSets from './SelectionSets.js' // export interface $MethodsSelect { - Mutation: Mutation Query: Query + Mutation: Mutation Bar: Bar DateObject1: DateObject1 DateObject2: DateObject2 @@ -841,14 +839,14 @@ export interface $MethodsSelect { // // -export interface Mutation { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet -} - export interface Query { <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet } +export interface Mutation { + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet +} + // // // @@ -1027,45 +1025,6 @@ export namespace Schema { // // - // Mutation - // -------------------------------------------------------------------------------------------------- - // - - export interface Mutation extends $.OutputObject { - name: 'Mutation' - fields: { - __typename: Mutation.__typename - id: Mutation.id - idNonNull: Mutation.idNonNull - } - } - - export namespace Mutation { - export interface __typename extends $.OutputField { - name: '__typename' - arguments: {} - inlineType: [1] - namedType: { - kind: '__typename' - value: 'Mutation' - } - } - - export interface id extends $.OutputField { - name: 'id' - arguments: {} - inlineType: [0] - namedType: $$NamedTypes.$$ID - } - - export interface idNonNull extends $.OutputField { - name: 'idNonNull' - arguments: {} - inlineType: [1] - namedType: $$NamedTypes.$$ID - } - } - // Query // -------------------------------------------------------------------------------------------------- // @@ -1703,6 +1662,45 @@ export namespace Schema { } } + // Mutation + // -------------------------------------------------------------------------------------------------- + // + + export interface Mutation extends $.OutputObject { + name: 'Mutation' + fields: { + __typename: Mutation.__typename + id: Mutation.id + idNonNull: Mutation.idNonNull + } + } + + export namespace Mutation { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Mutation' + } + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface idNonNull extends $.OutputField { + name: 'idNonNull' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$ID + } + } + // // // @@ -2623,8 +2621,8 @@ export namespace Schema { */ namespace $$NamedTypes { - export type $$Mutation = Mutation export type $$Query = Query + export type $$Mutation = Mutation export type $$Bar = Bar export type $$DateObject1 = DateObject1 export type $$DateObject2 = DateObject2 @@ -2680,16 +2678,18 @@ export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$ extends $ { name: Data.Name - RootTypesPresent: ['Mutation', 'Query'] - RootUnion: Schema.Mutation | Schema.Query + operationsAvailable: ['query', 'mutation'] + RootUnion: + | Schema.Query + | Schema.Mutation Root: { - Query: Schema.Query - Mutation: Schema.Mutation - Subscription: null + query: Schema.Query + mutation: Schema.Mutation + subscription: null } allTypes: { - Mutation: Schema.Mutation Query: Schema.Query + Mutation: Schema.Mutation ABCEnum: Schema.ABCEnum Case: Schema.Case Bar: Schema.Bar @@ -3075,13 +3075,6 @@ const lowerCaseUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { - f: { - id: {}, - idNonNull: {}, - }, -} - const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { InputObjectNested: { @@ -3374,6 +3367,13 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { }, } +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + id: {}, + idNonNull: {}, + }, +} + // // // @@ -3434,9 +3434,9 @@ Query.f[\`unionObjectNonNull\`]!.nt = ObjectUnion // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Mutation, - Query, + operations: { + query: Query, + mutation: Mutation, }, directives: {}, types: { @@ -3472,8 +3472,8 @@ const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { FooBarUnion, Result, lowerCaseUnion, - Mutation, Query, + Mutation, }, } @@ -3482,7 +3482,8 @@ export { $schemaDrivenDataMap as schemaDrivenDataMap } `; exports[`kitchen-sink generated modules > modules/Select.ts 1`] = ` -"import type { InferResult } from '../../../../../../src/entrypoints/schema.js' +"import type { OperationTypeNode } from 'graphql' +import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import * as Data from './Data.js' import type { Schema } from './Schema.js' import type * as SelectionSets from './SelectionSets.js' @@ -3522,16 +3523,22 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Root< + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Operation< + $SelectionSet, + Schema, + OperationTypeNode.QUERY + > + export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Operation< $SelectionSet, Schema, - 'Mutation' + OperationTypeNode.MUTATION > - export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // OutputObject Types - // ------------------ + // OutputObject + // -------------------------------------------------------------------------------------------------- + // export type Bar<$SelectionSet extends SelectionSets.Bar> = InferResult.OutputObject< $SelectionSet, Schema, @@ -3591,8 +3598,9 @@ export namespace Select { Schema, Schema['allTypes']['lowerCaseObject2'] > - // Union Types - // ----------- + // Union + // -------------------------------------------------------------------------------------------------- + // export type DateUnion<$SelectionSet extends SelectionSets.DateUnion> = InferResult.Union< $SelectionSet, Schema, @@ -3613,8 +3621,9 @@ export namespace Select { Schema, Schema['allTypes']['lowerCaseUnion'] > - // Interface Types - // --------------- + // Interface + // -------------------------------------------------------------------------------------------------- + // export type DateInterface1<$SelectionSet extends SelectionSets.DateInterface1> = InferResult.Interface< $SelectionSet, Schema, @@ -3677,144 +3686,31 @@ export interface $Document< // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- -// Mutation +// Query // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Mutation< +export interface Query< _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, > { /** - * Select the \`id\` field on the \`Mutation\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). + * Select the \`InputObjectNested\` field on the \`Query\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). */ - id?: Mutation.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + InputObjectNested?: + | Query.InputObjectNested$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias> /** - * Select the \`idNonNull\` field on the \`Mutation\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). + * Select the \`InputObjectNestedNonNull\` field on the \`Query\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). */ - idNonNull?: Mutation.idNonNull$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> - + InputObjectNestedNonNull?: + | Query.InputObjectNestedNonNull<_$Scalars> + | $Select.SelectAlias.SelectAlias> /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an \`@include\` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + * Select the \`abcEnum\` field on the \`Query\` object. Its type is \`ABCEnum\` (a \`Enum\` kind of type). */ - ___?: - | Mutation$FragmentInline<_$Scalars> - | Mutation$FragmentInline<_$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Mutation$FragmentInline< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { -} - -// ----------------------------------------| Fields | - -export namespace Mutation { - export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<_$Scalars> - - export interface id$SelectionSet< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > extends $Select.Bases.Base {} - - // --- expanded --- - - /** - * This is the "expanded" version of the \`id\` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type id$Expanded< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<_$Scalars> - > - - // -------------------------------------------------------------------------------------------------- - - export type idNonNull< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = - | $Select.Indicator.NoArgsIndicator - | idNonNull$SelectionSet<_$Scalars> - - export interface idNonNull$SelectionSet< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > extends $Select.Bases.Base {} - - // --- expanded --- - - /** - * 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< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | idNonNull$SelectionSet<_$Scalars> - > -} - -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- -// Query -// -------------------------------------------------------------------------------------------------- -// -// - -// ----------------------------------------| Entrypoint Interface | - -export interface Query< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> { - /** - * Select the \`InputObjectNested\` field on the \`Query\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). - */ - InputObjectNested?: - | Query.InputObjectNested$Expanded<_$Scalars> - | $Select.SelectAlias.SelectAlias> - /** - * Select the \`InputObjectNestedNonNull\` field on the \`Query\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). - */ - InputObjectNestedNonNull?: - | Query.InputObjectNestedNonNull<_$Scalars> - | $Select.SelectAlias.SelectAlias> - /** - * Select the \`abcEnum\` field on the \`Query\` object. Its type is \`ABCEnum\` (a \`Enum\` kind of type). - */ - abcEnum?: Query.abcEnum$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + abcEnum?: Query.abcEnum$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> /** * Select the \`argInputObjectCircular\` field on the \`Query\` object. Its type is \`String\` (a \`ScalarStandard\` kind of type). */ @@ -5570,6 +5466,103 @@ export namespace Query { > } +// Mutation +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * Select the \`id\` field on the \`Mutation\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). + */ + id?: Mutation.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the \`idNonNull\` field on the \`Mutation\` object. Its type is \`ID\` (a \`ScalarStandard\` kind of type). + */ + idNonNull?: Mutation.idNonNull$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an \`@include\` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Mutation$FragmentInline<_$Scalars> + | Mutation$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Mutation$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Mutation { + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the \`id\` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type idNonNull< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = + | $Select.Indicator.NoArgsIndicator + | idNonNull$SelectionSet<_$Scalars> + + export interface idNonNull$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * 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< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | idNonNull$SelectionSet<_$Scalars> + > +} + // // // @@ -5676,17 +5669,9 @@ export interface InputObjectNestedNonNull< // // -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Bar // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -5751,17 +5736,9 @@ export namespace Bar { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // DateObject1 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -5826,17 +5803,9 @@ export namespace DateObject1 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // DateObject2 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -5901,17 +5870,9 @@ export namespace DateObject2 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ErrorOne // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6004,17 +5965,9 @@ export namespace ErrorOne { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ErrorTwo // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6107,17 +6060,9 @@ export namespace ErrorTwo { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Foo // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6185,17 +6130,9 @@ export namespace Foo { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object1 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6402,17 +6339,9 @@ export namespace Object1 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object1ImplementingInterface // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6509,17 +6438,9 @@ export namespace Object1ImplementingInterface { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object2ImplementingInterface // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6618,17 +6539,9 @@ export namespace Object2ImplementingInterface { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ObjectNested // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6719,16 +6632,8 @@ export namespace ObjectNested { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- -// ObjectUnion -// -------------------------------------------------------------------------------------------------- -// +// ObjectUnion +// -------------------------------------------------------------------------------------------------- // // ----------------------------------------| Entrypoint Interface | @@ -6795,17 +6700,9 @@ export namespace ObjectUnion { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // lowerCaseObject // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -6870,17 +6767,9 @@ export namespace lowerCaseObject { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // lowerCaseObject2 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -7309,11 +7198,11 @@ export namespace Interface { * would end up with an error of \`export interface Foo extends Foo ...\` */ export namespace $NamedTypes { + export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Query<_$Scalars> export type $Mutation< _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, > = Mutation<_$Scalars> - export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = - Query<_$Scalars> export type $ABCEnum = ABCEnum export type $Case = Case export type $InputObject< @@ -7387,3 +7276,309 @@ export namespace $NamedTypes { } " `; + +exports[`root-types-mapped 1`] = ` +"import type { Schema as $ } from 'graffle/utilities-for-generated' +import type * as $$Utilities from 'graffle/utilities-for-generated' +import type * as Data from './Data.js' +import type * as $Scalar from './Scalar.js' + +export namespace Schema { + // + // + // + // + // + // + // ================================================================================================== + // Root + // ================================================================================================== + // + // + // + // + // + // + + // QueryRoot + // -------------------------------------------------------------------------------------------------- + // + + export interface QueryRoot extends $.OutputObject { + name: 'QueryRoot' + fields: { + __typename: QueryRoot.__typename + id: QueryRoot.id + } + } + + export namespace QueryRoot { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'QueryRoot' + } + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + } + + // + // + // + // + // + // + // ================================================================================================== + // OutputObject + // ================================================================================================== + // + // + // + // + // + // + + // + // + // + // + // + // + // ================================================================================================== + // InputObject + // ================================================================================================== + // + // + // + // + // + // + + // + // + // + // + // + // + // ================================================================================================== + // Interface + // ================================================================================================== + // + // + // + // + // + // + + // + // + // + // + // + // + // ================================================================================================== + // Union + // ================================================================================================== + // + // + // + // + // + // + + // + // + // + // + // + // + // ================================================================================================== + // Enum + // ================================================================================================== + // + // + // + // + // + // + + // + // + // + // + // + // + // ================================================================================================== + // ScalarCustom + // ================================================================================================== + // + // + // + // + // + // + + // + // + // + // + // + // + // ================================================================================================== + // ScalarStandard + // ================================================================================================== + // + // + // + // + // + // + + // ID + // -------------------------------------------------------------------------------------------------- + // + + export type ID = $.StandardTypes.ID + + // Boolean + // -------------------------------------------------------------------------------------------------- + // + + export type Boolean = $.StandardTypes.Boolean + + // String + // -------------------------------------------------------------------------------------------------- + // + + export type String = $.StandardTypes.String + + // + // + // + // + // + // + // ================================================================================================== + // Named Types Index + // ================================================================================================== + // + // + // + // + // + // + + /** + * [1] These definitions serve to allow field selection interfaces to extend their respective object type without + * name clashing between the field name and the object name. + * + * For example imagine \`Query.Foo\` field with type also called \`Foo\`. Our generated interfaces for each field + * would end up with an error of \`export interface Foo extends Foo ...\` + */ + + namespace $$NamedTypes { + export type $$QueryRoot = QueryRoot + export type $$ID = ID + export type $$Boolean = Boolean + export type $$String = String + } +} + +// +// +// +// +// +// +// ================================================================================================== +// Schema +// ================================================================================================== +// +// +// +// +// +// + +export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $ +{ + name: Data.Name + operationsAvailable: ['query'] + RootUnion: Schema.QueryRoot + Root: { + query: Schema.QueryRoot + mutation: null + subscription: null + } + allTypes: { + QueryRoot: Schema.QueryRoot + } + objects: {} + unions: {} + interfaces: {} + scalars: $Scalars + extensions: $$Utilities.GlobalRegistry.TypeExtensions +} +" +`; + +exports[`root-types-mapped 2`] = ` +"import type { InferResult } from 'graffle/schema' +import type * as $$Utilities from 'graffle/utilities-for-generated' +import type { Schema } from './Schema.js' +import type * as SelectionSet from './SelectionSets.js' + +export interface QueryRootMethods<$Context extends $$Utilities.ClientContext> { + $batch: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.QueryRoot<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutput< + $Context, + InferResult.OperationQuery<$SelectionSet, Schema<$Context['scalars']>> + > + > + > + __typename: () => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + { __typename: 'QueryRoot' }, + '__typename' + > + > + > + + id: <$SelectionSet>( + selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.QueryRoot.id<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationQuery<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + 'id' + > + > + > +} + +export interface BuilderMethodsRoot<$Context extends $$Utilities.ClientContext> { + undefined: QueryRootMethods<$Context> +} + +export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction.Fn { + // @ts-expect-error parameter is Untyped. + return: BuilderMethodsRoot +} +" +`; diff --git a/src/generator/generator/generate.test.ts b/src/generator/generator/generate.test.ts index 7c92ffa72..7f49aff1f 100644 --- a/src/generator/generator/generate.test.ts +++ b/src/generator/generator/generate.test.ts @@ -1,7 +1,9 @@ import { globby } from 'globby' +import * as Memfs from 'memfs' import { readFile } from 'node:fs/promises' import * as Path from 'node:path' import { expect, test } from 'vitest' +import { generate } from './generate.js' test(`kitchen-sink generated modules`, async () => { const basePath = `./tests/_/schemas/kitchen-sink/graffle` @@ -12,3 +14,31 @@ test(`kitchen-sink generated modules`, async () => { expect(content).toMatchSnapshot(relativeFilePath) } }) + +test(`root-types-mapped`, async () => { + await Memfs.fs.promises.mkdir(process.cwd(), { recursive: true }) + await generate({ + fs: Memfs.fs.promises as any, + schema: { + type: `sdl`, + sdl: ` + schema { + query: QueryRoot + } + type QueryRoot { + id: ID + } + `, + }, + }) + + const SchemaTs = Memfs.fs.readFileSync(`./graffle/modules/Schema.ts`, `utf8`) + expect(SchemaTs).includes(`operationsAvailable: ['query']`) + expect(SchemaTs).includes(`RootUnion: Schema.QueryRoot`) + expect(SchemaTs).toMatchSnapshot() + + const MethodsRootTs = Memfs.fs.readFileSync(`./graffle/modules/MethodsRoot.ts`, `utf8`) + expect(MethodsRootTs).includes(`__typename: 'QueryRoot'`) + expect(MethodsRootTs).includes(`InferResult.OperationQuery<$SelectionSet`) + expect(MethodsRootTs).toMatchSnapshot() +}) diff --git a/src/generator/generator/generate.ts b/src/generator/generator/generate.ts index 5f775f449..df413ded7 100644 --- a/src/generator/generator/generate.ts +++ b/src/generator/generator/generate.ts @@ -1,4 +1,3 @@ -import fs from 'node:fs/promises' import { createConfig } from '../config/config.js' import type { Input } from '../config/input.js' import { ModuleGenerator_ } from '../generators/_.js' @@ -47,19 +46,19 @@ export const generate = async (input: Input) => { ) if (config.paths.project.outputs.sdl && config.schema.via !== `sdl`) { - await fs.writeFile(config.paths.project.outputs.sdl, config.schema.sdl) + await config.fs.writeFile(config.paths.project.outputs.sdl, config.schema.sdl) } // todo clear directory before generating so that removed or renamed files are cleaned up. - await fs.mkdir(config.paths.project.outputs.root, { recursive: true }) - await fs.mkdir(config.paths.project.outputs.modules, { recursive: true }) + await config.fs.mkdir(config.paths.project.outputs.root, { recursive: true }) + await config.fs.mkdir(config.paths.project.outputs.modules, { recursive: true }) await Promise.all( generatedModules.map((generatedModule) => { const isExportsModule = generatedModule.name.match(/^_+$/) !== null // dprint-ignore const filePath = `${config.paths.project.outputs.root}/${isExportsModule ? `` : `modules/`}${generatedModule.name}.ts` - return fs.writeFile(filePath, generatedModule.content) + return config.fs.writeFile(filePath, generatedModule.content) }), ) } diff --git a/src/generator/generators/Client.ts b/src/generator/generators/Client.ts index 69918fcc3..fa39aaa25 100644 --- a/src/generator/generators/Client.ts +++ b/src/generator/generators/Client.ts @@ -10,8 +10,7 @@ export const ModuleGeneratorClient = createModuleGenerator( `import { defaultSchemaUrl } from './${ModuleGeneratorData.name}.js'`, `import { schemaDrivenDataMap } from './${ModuleGeneratorSchemaDrivenDataMap.name}.js'`, `import { Name } from './${ModuleGeneratorData.name}.js'`, - ``, - `export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl)`, ) + code(`export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl)`) }, ) diff --git a/src/generator/generators/MethodsDocument.ts b/src/generator/generators/MethodsDocument.ts index 89854a9ea..51b04fa40 100644 --- a/src/generator/generators/MethodsDocument.ts +++ b/src/generator/generators/MethodsDocument.ts @@ -8,10 +8,11 @@ import { ModuleGeneratorSelectionSets } from './SelectionSets.js' export const ModuleGeneratorMethodsDocument = createModuleGenerator( `MethodsDocument`, ({ config, code }) => { - code(`import type * as SelectionSets from './${ModuleGeneratorSelectionSets.name}.js'`) - code(`import type * as Utilities from '${config.paths.imports.grafflePackage.utilitiesForGenerated}'`) - code(`import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js'`) - code() + code(` + import type * as SelectionSets from './${ModuleGeneratorSelectionSets.name}.js' + import type * as Utilities from '${config.paths.imports.grafflePackage.utilitiesForGenerated}' + import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js' + `) code(`export interface Document<$Context extends Utilities.ClientContext> { <$Document>(document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>): Utilities.DocumentRunner< $Context, diff --git a/src/generator/generators/MethodsRoot.ts b/src/generator/generators/MethodsRoot.ts index 1e9ae72fd..88216c88b 100644 --- a/src/generator/generators/MethodsRoot.ts +++ b/src/generator/generators/MethodsRoot.ts @@ -1,5 +1,7 @@ // todo remove use of Utils.Aug when schema errors not in use import { Grafaid } from '../../lib/grafaid/__.js' +import { capitalizeFirstLetter, entries } from '../../lib/prelude.js' +import type { Config } from '../config/config.js' import { identifiers } from '../helpers/identifiers.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { createCodeGenerator } from '../helpers/moduleGeneratorRunner.js' @@ -12,23 +14,20 @@ export const ModuleGeneratorMethodsRoot = createModuleGenerator( ({ config, code }) => { code( `import type * as ${identifiers.$$Utilities} from '${config.paths.imports.grafflePackage.utilitiesForGenerated}';`, + `import type { InferResult } from '${config.paths.imports.grafflePackage.schema}'`, + `import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js'`, + `import type * as SelectionSet from './${ModuleGeneratorSelectionSets.name}.js'`, ) - code(`import type { InferResult } from '${config.paths.imports.grafflePackage.schema}';`) - code(`import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js'`) - code(`import type * as SelectionSet from './${ModuleGeneratorSelectionSets.name}.js'`) code() - code() - - config.schema.kindMap.Root.forEach(node => { + config.schema.kindMap.list.Root.forEach(node => { code(renderRootType({ config, node })) code() }) - code(` export interface BuilderMethodsRoot<$Context extends ${identifiers.$$Utilities}.ClientContext> { ${ - config.schema.kindMap.Root.map(node => { + config.schema.kindMap.list.Root.map(node => { const operationName = Grafaid.Document .RootTypeToOperationType[node.name as keyof typeof Grafaid.Document.RootTypeToOperationType] return `${operationName}: ${node.name}Methods<$Context>` @@ -37,7 +36,6 @@ export const ModuleGeneratorMethodsRoot = createModuleGenerator( } `) code() - code(` export interface BuilderMethodsRootFn extends ${identifiers.$$Utilities}.TypeFunction.Fn { // @ts-expect-error parameter is Untyped. @@ -49,7 +47,9 @@ export const ModuleGeneratorMethodsRoot = createModuleGenerator( const renderRootType = createCodeGenerator<{ node: Grafaid.Schema.ObjectType }>(({ node, config, code }) => { const fieldMethods = renderFieldMethods({ config, node }) + const operationType = getOperationTypeOrThrow(config, node) + // dprint-ignore code(` export interface ${node.name}Methods<$Context extends ${identifiers.$$Utilities}.ClientContext> { $batch: <$SelectionSet>(selectionSet: ${identifiers.$$Utilities}.Exact<$SelectionSet, SelectionSet.${node.name}<$Context['scalars']>>) => @@ -57,7 +57,7 @@ const renderRootType = createCodeGenerator<{ node: Grafaid.Schema.ObjectType }>( ${identifiers.$$Utilities}.Simplify< ${identifiers.$$Utilities}.HandleOutput< $Context, - InferResult.${node.name}<$SelectionSet, ${identifiers.Schema}<$Context['scalars']>> + InferResult.Operation${capitalizeFirstLetter(operationType)}<$SelectionSet, ${identifiers.Schema}<$Context['scalars']>> > > > @@ -85,26 +85,30 @@ const renderFieldMethods = createCodeGenerator<{ node: Grafaid.Schema.ObjectType const isOptional = Grafaid.Schema.isScalarType(fieldTypeUnwrapped) && Grafaid.Schema.Args.isAllArgsNullable(field.args) + const operationType = getOperationTypeOrThrow(config, node) // dprint-ignore code(` ${field.name}: <$SelectionSet>(selectionSet${isOptional ? `?` : ``}: ${identifiers.$$Utilities}.Exact<$SelectionSet, SelectionSet.${renderName(node)}.${renderName(field)}<$Context['scalars']>>) => - ${Helpers.returnType(node.name, field.name, `$SelectionSet`)} + Promise< + ${identifiers.$$Utilities}.Simplify< + ${identifiers.$$Utilities}.HandleOutputGraffleRootField< + $Context, + InferResult.Operation${capitalizeFirstLetter(operationType)}<{ ${field.name}: $SelectionSet}, ${identifiers.Schema}<$Context['scalars']>>, + '${field.name}' + > + > + > `) } }) -namespace Helpers { - export const returnType = (rootName: string, fieldName: string, selectionSet: string) => { - return ` - Promise< - ${identifiers.$$Utilities}.Simplify< - ${identifiers.$$Utilities}.HandleOutputGraffleRootField< - $Context, - InferResult.${rootName}<{ ${fieldName}: ${selectionSet}}, ${identifiers.Schema}<$Context['scalars']>>, - '${fieldName}' - > - > - > - ` - } +const getOperationTypeOrThrow = (config: Config, node: Grafaid.Schema.ObjectType) => { + const rootsWithOpType = entries(config.schema.kindMap.index.Root) + .map(_ => { + if (_[1] === null) return null + return { operationType: _[0], objectType: _[1] } + }).filter(_ => _ !== null) + const operationType = rootsWithOpType.find(({ objectType }) => objectType.name === node.name)?.operationType + if (!operationType) throw new Error(`Operation type not found for ${node.name}`) + return operationType } diff --git a/src/generator/generators/MethodsSelect.ts b/src/generator/generators/MethodsSelect.ts index 91e594435..f3e3fcc8f 100644 --- a/src/generator/generators/MethodsSelect.ts +++ b/src/generator/generators/MethodsSelect.ts @@ -1,6 +1,6 @@ // todo jsdoc -import { Grafaid } from '../../lib/grafaid/__.js' -import { entries, pick } from '../../lib/prelude.js' +import { Code } from '../../lib/Code.js' +import { entries, pick, values } from '../../lib/prelude.js' import { Tex } from '../../lib/tex/__.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { renderName } from '../helpers/render.js' @@ -9,7 +9,7 @@ import { ModuleGeneratorSelectionSets } from './SelectionSets.js' export const ModuleGeneratorMethodsSelect = createModuleGenerator( `MethodsSelect`, ({ config, code }) => { - const kindMap = pick(config.schema.kindMap, [`Root`, `OutputObject`, `Union`, `Interface`]) + const kindMap = pick(config.schema.kindMap.list, [`Root`, `OutputObject`, `Union`, `Interface`]) const kinds = entries(kindMap) code(`import type * as $SelectionSets from './${ModuleGeneratorSelectionSets.name}.js'`) @@ -17,29 +17,26 @@ export const ModuleGeneratorMethodsSelect = createModuleGenerator( code() code(Tex.title1(`Select Methods Interface`)) code() - code(`export interface $MethodsSelect {`) - for (const [_, kind] of kinds) { - for (const type of kind) { - // dprint-ignore - code(`${type.name}: ${renderName(type)}`) - } - } - code(`}`) + code(Code.tsInterface({ + name: `$MethodsSelect`, + fields: values(kindMap).flatMap(type => { + return type.map(type => { + return [type.name, renderName(type)] as const + }) + }), + })) code() - - for (const [name, kind] of kinds) { - const titleText = Grafaid.Schema.isRootType(kind[0]!) ? `Root` : name - code(Tex.title1(titleText)) + for (const [kindName, kind] of kinds) { + code(Tex.title1(kindName)) code() - - for (const graphqlType of kind) { - // dprint-ignore - code(` - export interface ${renderName(graphqlType)} { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.${renderName(graphqlType)}>): + for (const type of kind) { + code(Code.tsInterface({ + name: type.name, + fields: ` + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.${renderName(type)}>): $SelectionSet - }` - ) + `, + })) code() } } diff --git a/src/generator/generators/Scalar.ts b/src/generator/generators/Scalar.ts index ab57c0fcb..d256b5450 100644 --- a/src/generator/generators/Scalar.ts +++ b/src/generator/generators/Scalar.ts @@ -19,9 +19,9 @@ export const ModuleGeneratorScalar = createModuleGenerator( code(`import * as ${identifiers.CustomScalars} from '${config.paths.imports.customScalarCodecs}'`) code() code(`export * from '${config.paths.imports.customScalarCodecs}'`) - const names = config.schema.kindMap.ScalarCustom.map((scalar) => scalar.name).join(`, `) + const names = config.schema.kindMap.list.ScalarCustom.map((scalar) => scalar.name).join(`, `) code(`export { ${names} } from '${config.paths.imports.customScalarCodecs}'`) - for (const scalar of config.schema.kindMap.ScalarCustom) { + for (const scalar of config.schema.kindMap.list.ScalarCustom) { code(typeTitle2(`custom scalar type`)(scalar)) code() code(`export type ${scalar.name} = typeof ${identifiers.CustomScalars}.${scalar.name}`) @@ -50,7 +50,7 @@ export const ModuleGeneratorScalar = createModuleGenerator( ) } - for (const scalar of config.schema.kindMap.ScalarCustom) { + for (const scalar of config.schema.kindMap.list.ScalarCustom) { code(typeTitle2(`custom scalar type`)(scalar)) code() code(`export type ${scalar.name} = ${identifiers.$$Utilities}.Schema.Scalar.ScalarCodecless<'Date'>`) diff --git a/src/generator/generators/Schema.ts b/src/generator/generators/Schema.ts index eb2ddc57f..dc6c6bb09 100644 --- a/src/generator/generators/Schema.ts +++ b/src/generator/generators/Schema.ts @@ -13,7 +13,7 @@ import { ModuleGeneratorScalar } from './Scalar.js' export const ModuleGeneratorSchema = createModuleGenerator( `Schema`, ({ config, code }) => { - const kindMap = config.schema.kindMap + const kindMap = config.schema.kindMap.list const kinds = entries(kindMap) // todo methods root is unused @@ -81,7 +81,7 @@ const OutputObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>(({ }), ), ) - code(Code.tsInterface$({ + code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), name: type.name, extends: `$.OutputObject`, @@ -94,7 +94,7 @@ const OutputObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>(({ code(Code.esmExport(Code.tsNamespace( type.name, - [Code.tsInterface$({ + [Code.tsInterface({ export: true, name: `__typename`, extends: `$.OutputField`, @@ -111,7 +111,7 @@ const OutputObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>(({ values(type.getFields()) .map((field) => { const namedType = Grafaid.Schema.getNamedType(field.type) - return Code.tsInterface$({ + return Code.tsInterface({ tsDoc: getTsDocContents(config, field), export: true, name: field.name, @@ -145,7 +145,7 @@ const OutputObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>(({ const Enum = createCodeGenerator<{ type: Grafaid.Schema.EnumType }>(({ config, code, type }) => { code( - Code.tsInterface$({ + Code.tsInterface({ tsDoc: getTsDocContents(config, type), export: true, name: type.name, @@ -161,7 +161,7 @@ const Enum = createCodeGenerator<{ type: Grafaid.Schema.EnumType }>(({ config, c }) const InputObject = createCodeGenerator<{ type: Grafaid.Schema.InputObjectType }>(({ config, code, type }) => { code( - Code.tsInterface$({ + Code.tsInterface({ tsDoc: getTsDocContents(config, type), name: type.name, extends: `$.InputObject`, @@ -182,7 +182,7 @@ const InputObject = createCodeGenerator<{ type: Grafaid.Schema.InputObjectType } values(type.getFields()) .map((field) => { const namedType = Grafaid.Schema.getNamedType(field.type) - return Code.tsInterface$({ + return Code.tsInterface({ tsDoc: getTsDocContents(config, field), name: field.name, extends: `$.InputField`, @@ -210,7 +210,7 @@ const ScalarCustom = createCodeGenerator<{ type: Grafaid.Schema.ScalarType }>(({ const Union = createCodeGenerator<{ type: Grafaid.Schema.UnionType }>(({ config, code, type }) => { const memberNames = type.getTypes().map((_) => renderName(_)) - code(Code.tsInterface$({ + code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), export: true, name: type.name, @@ -228,7 +228,7 @@ const Union = createCodeGenerator<{ type: Grafaid.Schema.UnionType }>(({ config, const Interface = createCodeGenerator<{ type: Grafaid.Schema.InterfaceType }>(({ config, code, type }) => { const implementorTypes = Grafaid.Schema.KindMap.getInterfaceImplementors(config.schema.kindMap, type) const implementorNames = implementorTypes.map((_) => _.name) - code(Code.tsInterface$({ + code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), name: type.name, extends: `$.Interface`, @@ -260,29 +260,28 @@ const namedTypesTypeReference = (name: string | Grafaid.Schema.NamedTypes) => { export const SchemaGenerator = createCodeGenerator( ({ config, code }) => { - code(Tex.title1(`Schema`)) - code() - - const rootTypesPresence = { - Query: Grafaid.Schema.KindMap.hasQuery(config.schema.kindMap), - Mutation: Grafaid.Schema.KindMap.hasMutation(config.schema.kindMap), - Subscription: Grafaid.Schema.KindMap.hasSubscription(config.schema.kindMap), - } - - const root = config.schema.kindMap.Root.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) - const objects = config.schema.kindMap.OutputObject.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) - const unions = config.schema.kindMap.Union.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) - const interfaces = config.schema.kindMap.Interface.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) - const enums = config.schema.kindMap.Enum.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) + const kindMap = config.schema.kindMap + // dprint-ignore + const root = kindMap.list.Root.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) + const objects = kindMap.list.OutputObject.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) + const unions = kindMap.list.Union.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) + const interfaces = kindMap.list.Interface.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) + const enums = kindMap.list.Enum.map(_ => [_.name, `${identifiers.Schema}.${_.name}`]) + const operationsAvailable = entries(kindMap.index.Root).filter(_ => _[1] !== null).map(_ => _[0]) const schema: Code.TermObject = { name: `Data.Name`, - RootTypesPresent: `[${config.schema.kindMap.Root.map((_) => Code.string(_.name)).join(`, `)}]`, - RootUnion: config.schema.kindMap.Root.map(_ => `${identifiers.Schema}.${_.name}`) - .join(`|`), + operationsAvailable: Code.tsTuple(operationsAvailable.map(_ => Code.string(_))), + RootUnion: Code.tsUnionItems(kindMap.list.Root.map(_ => `${identifiers.Schema}.${_.name}`)), Root: { - Query: rootTypesPresence.Query ? `${identifiers.Schema}.Query` : null, - Mutation: rootTypesPresence.Mutation ? `${identifiers.Schema}.Mutation` : null, - Subscription: rootTypesPresence.Subscription ? `${identifiers.Schema}.Subscription` : null, + [Grafaid.Document.OperationTypeNode.QUERY]: kindMap.index.Root.query?.name + ? `${identifiers.Schema}.${kindMap.index.Root.query.name}` + : null, + [Grafaid.Document.OperationTypeNode.MUTATION]: kindMap.index.Root.mutation?.name + ? `${identifiers.Schema}.${kindMap.index.Root.mutation.name}` + : null, + [Grafaid.Document.OperationTypeNode.SUBSCRIPTION]: kindMap.index.Root.subscription?.name + ? `${identifiers.Schema}.${kindMap.index.Root.subscription.name}` + : null, }, allTypes: Object.fromEntries([ ...root, @@ -312,8 +311,10 @@ export const SchemaGenerator = createCodeGenerator( // --- + code(Tex.title1(`Schema`)) + code() code( - Code.tsInterface$({ + Code.tsInterface({ name: identifiers.Schema, parameters: `$Scalars extends ${identifiers.$$Utilities}.Schema.Scalar.Registry = ${identifiers.$$Utilities}.Schema.Scalar.Registry.Empty`, diff --git a/src/generator/generators/SchemaDrivenDataMap.ts b/src/generator/generators/SchemaDrivenDataMap.ts index 2b45aa2ca..4292a9a01 100644 --- a/src/generator/generators/SchemaDrivenDataMap.ts +++ b/src/generator/generators/SchemaDrivenDataMap.ts @@ -16,14 +16,19 @@ type ReferenceAssignments = string[] export const ModuleGeneratorSchemaDrivenDataMap = createModuleGenerator( `SchemaDrivenDataMap`, ({ config, code }) => { + const rootsWithOpType = entries(config.schema.kindMap.index.Root) + .map(_ => { + if (_[1] === null) return null + return { operationType: _[0], objectType: _[1] } + }).filter(_ => _ !== null) + const kindMap: Grafaid.Schema.KindMap['list'] = getKindMap(config) + const kinds = entries(kindMap) + code(` import * as ${identifiers.$Scalar} from './${ModuleGeneratorScalar.name}.js' import type * as ${identifiers.$$Utilities} from '${config.paths.imports.grafflePackage.utilitiesForGenerated}' `) - const kindMap: Grafaid.Schema.KindMap = getKindMap(config) - const kinds = entries(kindMap) - const referenceAssignments: ReferenceAssignments = [] for (const [kindName, nodes] of kinds) { @@ -54,10 +59,12 @@ export const ModuleGeneratorSchemaDrivenDataMap = createModuleGenerator( code() code(`const $schemaDrivenDataMap: ${identifiers.$$Utilities}.SchemaDrivenDataMap =`) code(Code.termObject({ - roots: Code.directiveTermObject({ - $literal: kindMap.Root.map(type => type.name + `,`).join(`\n`), + operations: kindMap.Root.map(type => { + const operationType = rootsWithOpType.find(({ objectType }) => objectType.name === type.name)?.operationType + if (!operationType) throw new Error(`Operation type not found for ${type.name}`) + return [operationType, type.name] as const }), - directives: `{}`, + directives: {}, types: Code.directiveTermObject({ $literal: [ ...kinds.map(([, _]) => _).flat().map((_) => _.name), @@ -95,14 +102,14 @@ const getKindMap = (config: Config) => { const condition = typeCondition(config) return { // When "variables" enabled, we need to know all named types to be able to write them out. - ScalarStandard: kindMap.ScalarStandard.filter(() => config.runtimeFeatures.operationVariables), - ScalarCustom: kindMap.ScalarCustom.filter(() => config.runtimeFeatures.customScalars), - Enum: kindMap.Enum.filter(() => config.runtimeFeatures.operationVariables), - InputObject: kindMap.InputObject.filter(condition), - OutputObject: kindMap.OutputObject.filter(condition), - Interface: kindMap.Interface.filter(condition), - Union: kindMap.Union.filter(condition), - Root: kindMap.Root.filter(condition), + ScalarStandard: kindMap.list.ScalarStandard.filter(() => config.runtimeFeatures.operationVariables), + ScalarCustom: kindMap.list.ScalarCustom.filter(() => config.runtimeFeatures.customScalars), + Enum: kindMap.list.Enum.filter(() => config.runtimeFeatures.operationVariables), + InputObject: kindMap.list.InputObject.filter(condition), + OutputObject: kindMap.list.OutputObject.filter(condition), + Interface: kindMap.list.Interface.filter(condition), + Union: kindMap.list.Union.filter(condition), + Root: kindMap.list.Root.filter(condition), } } diff --git a/src/generator/generators/Select.ts b/src/generator/generators/Select.ts index 36c35da1c..97fe24dce 100644 --- a/src/generator/generators/Select.ts +++ b/src/generator/generators/Select.ts @@ -1,8 +1,9 @@ // todo jsdoc +import { entries } from '../../lib/prelude.js' import { Tex } from '../../lib/tex/__.js' import { identifiers } from '../helpers/identifiers.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' -import { renderName, typeTitle } from '../helpers/render.js' +import { renderName } from '../helpers/render.js' import { ModuleGeneratorData } from './Data.js' import { ModuleGeneratorSchema } from './Schema.js' import { ModuleGeneratorSelectionSets } from './SelectionSets.js' @@ -10,49 +11,51 @@ import { ModuleGeneratorSelectionSets } from './SelectionSets.js' export const ModuleGeneratorSelect = createModuleGenerator( `Select`, ({ config, code }) => { - code(`import * as Data from './${ModuleGeneratorData.name}.js'`) - code(`import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js'`) - code(`import type { InferResult } from '${config.paths.imports.grafflePackage.schema}'`) - code(`import type * as SelectionSets from './${ModuleGeneratorSelectionSets.name}.js'`) + const enumMemberName = { + query: `QUERY `, + mutation: `MUTATION`, + subscription: `SUBSCRIPTION`, + } as const + code(` + import * as Data from './${ModuleGeneratorData.name}.js' + import type { OperationTypeNode } from 'graphql' + import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js' + import type { InferResult } from '${config.paths.imports.grafflePackage.schema}' + import type * as SelectionSets from './${ModuleGeneratorSelectionSets.name}.js' + `) code() - code(Tex.title1(`Runtime`)) code(`import { createSelect } from '${config.paths.imports.grafflePackage.client}'`) code(`export const Select = createSelect(Data.Name)`) code() - code(Tex.title1(`Buildtime`)) code() - code(`export namespace Select {`) - - code(typeTitle(config, `Root`)) - - code(...config.schema.kindMap.Root.map((type) => { - return `export type ${type.name}<$SelectionSet extends SelectionSets.${ - renderName(type) - }> = InferResult.Root<$SelectionSet, ${identifiers.Schema}, '${type.name}'>` - })) - - code(typeTitle(config, `OutputObject`)) - - code(...config.schema.kindMap.OutputObject.map((type) => { + code(Tex.title2(`Root`)) + code( + ...entries(config.schema.kindMap.index.Root).map(([operationType, type]) => { + if (!type) return null + return `export type ${type.name}<$SelectionSet extends SelectionSets.${ + renderName(type) + }> = InferResult.Operation<$SelectionSet, ${identifiers.Schema}, OperationTypeNode.${ + enumMemberName[operationType] + }>` + }), + ) + code(Tex.title2(`OutputObject`)) + code(...config.schema.kindMap.list.OutputObject.map((type) => { return `export type ${type.name}<$SelectionSet extends SelectionSets.${ renderName(type) }> = InferResult.OutputObject<$SelectionSet, ${identifiers.Schema}, ${identifiers.Schema}['allTypes']['${type.name}']>` })) - - code(typeTitle(config, `Union`)) - - code(...config.schema.kindMap.Union.map((type) => { + code(Tex.title2(`Union`)) + code(...config.schema.kindMap.list.Union.map((type) => { return `export type ${type.name}<$SelectionSet extends SelectionSets.${ renderName(type) }> = InferResult.Union<$SelectionSet, ${identifiers.Schema}, ${identifiers.Schema}['allTypes']['${type.name}']>` })) - - code(typeTitle(config, `Interface`)) - - code(...config.schema.kindMap.Interface.map((type) => { + code(Tex.title2(`Interface`)) + code(...config.schema.kindMap.list.Interface.map((type) => { return `export type ${type.name}<$SelectionSet extends SelectionSets.${ renderName(type) }> = InferResult.Interface<$SelectionSet, ${identifiers.Schema}, ${identifiers.Schema}['allTypes']['${type.name}']>` diff --git a/src/generator/generators/SelectionSets.ts b/src/generator/generators/SelectionSets.ts index 1e0c266e6..a0c2b7253 100644 --- a/src/generator/generators/SelectionSets.ts +++ b/src/generator/generators/SelectionSets.ts @@ -5,7 +5,6 @@ import { Select } from '../../documentBuilder/Select/__.js' import { Code } from '../../lib/Code.js' import { Grafaid } from '../../lib/grafaid/__.js' import { analyzeArgsNullability } from '../../lib/grafaid/schema/args.js' -import { RootTypeName } from '../../lib/grafaid/schema/schema.js' import { entries, pick, values } from '../../lib/prelude.js' import { Tex } from '../../lib/tex/__.js' import { borderThin } from '../../lib/tex/tex.js' @@ -13,7 +12,7 @@ import type { Config } from '../config/config.js' import { identifiers } from '../helpers/identifiers.js' import { createModuleGenerator } from '../helpers/moduleGenerator.js' import { createCodeGenerator } from '../helpers/moduleGeneratorRunner.js' -import { getTsDocContents, renderName, typeTitle2SelectionSet } from '../helpers/render.js' +import { getTsDocContents, renderName } from '../helpers/render.js' import type { KindRenderers } from '../helpers/types.js' const i = { @@ -26,7 +25,14 @@ const $ScalarsTypeParameter = export const ModuleGeneratorSelectionSets = createModuleGenerator( `SelectionSets`, ({ config, code }) => { - const kindMap = pick(config.schema.kindMap, [`Root`, `Enum`, `InputObject`, `OutputObject`, `Union`, `Interface`]) + const kindMap = pick(config.schema.kindMap.list, [ + `Root`, + `Enum`, + `InputObject`, + `OutputObject`, + `Union`, + `Interface`, + ]) const kindEntries = entries(kindMap).filter(_ => _[1].length > 0) const kinds = kindEntries.map(_ => _[1]) @@ -37,13 +43,13 @@ export const ModuleGeneratorSelectionSets = createModuleGenerator( code() code(Tex.title1(`Document`)) code() - code(Code.tsInterface$({ + code(Code.tsInterface({ name: `$Document`, parameters: $ScalarsTypeParameter, // dprint-ignore fields: ` - ${Grafaid.Schema.KindMap.hasQuery(config.schema.kindMap) ? `query?: Record>` : ``} - ${Grafaid.Schema.KindMap.hasMutation(config.schema.kindMap) ? `mutation?: Record>` : ``} + ${config.schema.kindMap.index.Root.query ? `query?: Record>` : ``} + ${config.schema.kindMap.index.Root.mutation ? `mutation?: Record>` : ``} `, })) code() @@ -94,7 +100,7 @@ const Union = createCodeGenerator<{ type: Grafaid.Schema.UnionType }>( const fragmentsInlineType = type.getTypes().map((type) => `${Select.InlineFragment.typeConditionPRefix}${type.name}?: ${H.forwardTypeParameter$Scalars(type)}` ).join(`\n`) - code(Code.tsInterface$({ + code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), name: type.name, parameters: $ScalarsTypeParameter, @@ -122,7 +128,7 @@ const Enum = createCodeGenerator<{ type: Grafaid.Schema.EnumType }>( const InputObject = createCodeGenerator<{ type: Grafaid.Schema.InputObjectType }>( ({ config, type, code }) => { - code(Code.tsInterface$({ + code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), name: type.name, parameters: $ScalarsTypeParameter, @@ -144,7 +150,7 @@ const Interface = createCodeGenerator<{ type: Grafaid.Schema.InterfaceType }>( code() code(Tex.title2(type.name)) code() - code(Code.tsInterface$({ + code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), name: type.name, parameters: $ScalarsTypeParameter, @@ -172,7 +178,7 @@ const OutputObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>( ({ config, type, code }) => { const fields = Object.values(type.getFields()) - code(typeTitle2SelectionSet(type)) + code(Tex.title2(type.name)) code() code(Tex.title3(`Entrypoint Interface`)) code() @@ -193,10 +199,10 @@ const OutputObject = createCodeGenerator<{ type: Grafaid.Schema.ObjectType }>( + key }).join(`\n`) - const isRootType = type.name in RootTypeName + const isRootType = config.schema.kindMap.list.Root.some(_ => _.name === type.name) const extendsClause = isRootType ? null : `$Select.Bases.ObjectLike` - code(Code.tsInterface$({ + code(Code.tsInterface({ tsDoc: getTsDocContents(config, type), name: type.name, parameters: $ScalarsTypeParameter, @@ -266,7 +272,7 @@ const renderOutputField = createCodeGenerator<{ field: Grafaid.Schema.Field getInputFieldLike(config, arg)), @@ -446,7 +452,7 @@ namespace H { export const fragmentInlineInterface = ( node: Grafaid.Schema.ObjectType | Grafaid.Schema.UnionType | Grafaid.Schema.InterfaceType, ) => { - return Code.tsInterface$({ + return Code.tsInterface({ name: `${renderName(node)}${fragmentInlineNameSuffix}`, parameters: $ScalarsTypeParameter, extends: [forwardTypeParameter$Scalars(node), `$Select.Directive.$Groups.InlineFragment.Fields`], diff --git a/src/generator/generators/global.ts b/src/generator/generators/global.ts index 87f523865..fa0ed32e1 100644 --- a/src/generator/generators/global.ts +++ b/src/generator/generators/global.ts @@ -17,7 +17,6 @@ export const ModuleGeneratorGlobal = createModuleGenerator( `import type * as MethodsRoot from './${ModuleGeneratorMethodsRoot.name}.js'`, `import type { ${identifiers.Schema} } from './${ModuleGeneratorSchema.name}.js'`, ) - code() const defaultSchemaUrlTsDoc = config.options.defaultSchemaUrl diff --git a/src/generator/helpers/render.ts b/src/generator/helpers/render.ts index 9b9a601cd..432c45e2d 100644 --- a/src/generator/helpers/render.ts +++ b/src/generator/helpers/render.ts @@ -47,19 +47,6 @@ export const typeTitle2 = (category: string) => (type: Grafaid.Schema.NamedTypes return title } -export const typeTitle2SelectionSet = typeTitle2(`GRAPHQL SELECTION SET`) - -export const typeTitle = (config: Config, kindName: Grafaid.Schema.KindMap.KindName) => { - const hasItems = config.schema.kindMap[kindName].length > 0 - const title = `${kindName} Types` - const titleDecorated = `// ${title}\n// ${`-`.repeat(title.length)}\n` - if (hasItems) { - return titleDecorated - } else { - return `${titleDecorated}\n// -- None --\n` - } -} - const defaultDescription = (node: Grafaid.Schema.DescribableTypes) => { const entity = Grafaid.Schema.isField(node) ? `Field` : Grafaid.getTypeAndKind(node).kindName return `There is no documentation for this ${entity}.` diff --git a/src/generator/helpers/types.ts b/src/generator/helpers/types.ts index aa55c15d9..001aa267f 100644 --- a/src/generator/helpers/types.ts +++ b/src/generator/helpers/types.ts @@ -1,3 +1,3 @@ import type { Grafaid } from '../../lib/grafaid/__.js' -export type KindRenderers = Record +export type KindRenderers = Record diff --git a/src/layers/5_request/core.ts b/src/layers/5_request/core.ts index 448767fa4..35a80b4b5 100644 --- a/src/layers/5_request/core.ts +++ b/src/layers/5_request/core.ts @@ -1,6 +1,6 @@ import { SelectionSetGraphqlMapper } from '../../documentBuilder/SelectGraphQLMapper/__.js' import { Anyware } from '../../lib/anyware/__.js' -import { Grafaid } from '../../lib/grafaid/__.js' +import type { Grafaid } from '../../lib/grafaid/__.js' import { getOperationDefinition, OperationTypeToAccessKind, print } from '../../lib/grafaid/document.js' import { execute } from '../../lib/grafaid/execute.js' // todo import { @@ -42,7 +42,6 @@ export const graffleMappedResultToRequest = ( if (!operation_) throw new Error(`Unknown operation named "${String(operationName)}".`) return { - rootType: Grafaid.Document.OperationTypeToRootType[operation_.operation], operationName, operation: operation_, query: document, diff --git a/src/layers/6_client/gql/gql.ts b/src/layers/6_client/gql/gql.ts index 51fbe87f3..258fab0cc 100644 --- a/src/layers/6_client/gql/gql.ts +++ b/src/layers/6_client/gql/gql.ts @@ -1,6 +1,6 @@ import type { Fluent } from '../../../lib/fluent/__.js' import type { Grafaid } from '../../../lib/grafaid/__.js' -import { getOperationType, OperationTypeToRootType } from '../../../lib/grafaid/document.js' +import { getOperationType } from '../../../lib/grafaid/document.js' import { isTemplateStringArguments, joinTemplateStringArrayAndArgs, @@ -54,7 +54,6 @@ export const gqlProperties = defineTerminus((state) => { if (!operationType) throw new Error(`Could not get operation type`) const analyzedRequest = { - rootType: OperationTypeToRootType[operationType], operation: operationType, query, variables, diff --git a/src/layers/6_client/requestMethods/document.ts b/src/layers/6_client/requestMethods/document.ts index 3c34503c2..7a152736f 100644 --- a/src/layers/6_client/requestMethods/document.ts +++ b/src/layers/6_client/requestMethods/document.ts @@ -20,10 +20,10 @@ export type DocumentRunner< Promise< HandleOutput< $$ClientContext, - InferResult.Root< + InferResult.Operation< Select.Document.GetOperation<$$Document, $Name>, $$Schema, - Select.Document.GetRootTypeNameOfOperation<$$Document, $Name> + Select.Document.GetOperationType<$$Document, $Name> > > & {} diff --git a/src/layers/6_client/requestMethods/requestMethods.ts b/src/layers/6_client/requestMethods/requestMethods.ts index 5d1160c8b..0a683596f 100644 --- a/src/layers/6_client/requestMethods/requestMethods.ts +++ b/src/layers/6_client/requestMethods/requestMethods.ts @@ -1,3 +1,4 @@ +import { OperationTypeNode } from 'graphql' import { Select } from '../../../documentBuilder/Select/__.js' import type { TypeFunction } from '../../../entrypoints/utilities-for-generated.js' import type { Fluent } from '../../../lib/fluent/__.js' @@ -39,8 +40,8 @@ export type BuilderRequestMethods<$Context extends ClientContext> = export const requestMethodsProperties = defineTerminus((state) => { return { document: createMethodDocument(state), - query: createMethodRootType(state, `Query`), - mutation: createMethodRootType(state, `Mutation`), + query: createMethodOperationType(state, OperationTypeNode.QUERY), + mutation: createMethodOperationType(state, OperationTypeNode.MUTATION), // todo // subscription: async () => {}, } @@ -55,18 +56,18 @@ export const createMethodDocument = (state: ClientContext) => (document: Select. } } -const createMethodRootType = (state: ClientContext, rootTypeName: Grafaid.Schema.RootTypeName) => { +const createMethodOperationType = (state: ClientContext, operationType: OperationTypeNode) => { return new Proxy({}, { get: (_, key) => { if (isSymbol(key)) throw new Error(`Symbols not supported.`) if (key.startsWith(`$batch`)) { return async (selectionSetOrIndicator: Select.SelectionSet.AnySelectionSet) => - executeRootType(state, rootTypeName, selectionSetOrIndicator) + executeOperation(state, operationType, selectionSetOrIndicator) } else { const fieldName = key return (selectionSetOrArgs: Select.SelectionSet.AnySelectionSet) => - executeRootField(state, rootTypeName, fieldName, selectionSetOrArgs) + executeRootField(state, operationType, fieldName, selectionSetOrArgs) } }, }) @@ -74,11 +75,11 @@ const createMethodRootType = (state: ClientContext, rootTypeName: Grafaid.Schema const executeRootField = async ( state: ClientContext, - rootTypeName: Grafaid.Schema.RootTypeName, + operationType: OperationTypeNode, rootFieldName: string, rootFieldSelectionSet?: Select.SelectionSet.AnySelectionSet, ) => { - const result = await executeRootType(state, rootTypeName, { + const result = await executeOperation(state, operationType, { [rootFieldName]: rootFieldSelectionSet ?? {}, }) @@ -90,15 +91,15 @@ const executeRootField = async ( : result[rootFieldName] } -const executeRootType = async ( +const executeOperation = async ( state: ClientContext, - rootTypeName: Grafaid.Schema.RootTypeName, + operationType: OperationTypeNode, rootTypeSelectionSet: Select.SelectionSet.AnySelectionSet, ) => { return executeDocument( state, Select.Document.createDocumentNormalizedFromRootTypeSelection( - rootTypeName, + operationType, rootTypeSelectionSet, ), ) diff --git a/src/lib/Code.ts b/src/lib/Code.ts index 8d4f6961d..4456bd455 100644 --- a/src/lib/Code.ts +++ b/src/lib/Code.ts @@ -29,12 +29,18 @@ export namespace Code { return isString(value) || typeof value === `number` || typeof value === `boolean` || value === null } - type FieldValue = TermPrimitive | DirectiveTermObject | TermObject + type FieldValue = + | DirectiveField + | FieldValueNonDirective + + type FieldValueNonDirective = TermPrimitive | TermObjectLike + + type TermFieldTuple = readonly [string, FieldValue] interface DirectiveField { $TS_DOC?: string | null $OPTIONAL?: boolean - $VALUE: FieldValue + $VALUE: FieldValueNonDirective } const isDirectiveField = (value: unknown): value is DirectiveField => { @@ -45,7 +51,7 @@ export namespace Code { export const objectField$ = (input: { tsDoc?: null | string optional?: boolean - value: FieldValue + value: FieldValueNonDirective }): DirectiveField => { return { $TS_DOC: input.tsDoc, @@ -60,7 +66,7 @@ export namespace Code { } export interface TermObject { - [key: string]: FieldValue | DirectiveField + [key: string]: FieldValue } export type TermObjectOf = { @@ -77,9 +83,10 @@ export namespace Code { ) } - // terms + type TermObjectLike = TermObject | DirectiveTermObject | TermFieldTuple[] - export const termObject = (object: TermObject | DirectiveTermObject): string => { + export const termObject = (object: TermObjectLike): string => { + if (Array.isArray(object)) return termObject(Object.fromEntries(object)) if (isDirectiveTermObject(object)) return directiveTermObject(object) return block(termObjectFields(object)) } @@ -87,6 +94,7 @@ export namespace Code { export const termObjectFields = (object: TermObject | DirectiveTermObject): string => entries(object) .map(([key, value]): [string, DirectiveField] => { + value if (value === null) return [key, { $VALUE: null }] if (isDirectiveTermObject(value)) return [key, { $VALUE: directiveTermObject(value) }] if (isDirectiveField(value)) return [key, value] @@ -99,7 +107,12 @@ export namespace Code { }) .join(`,\n`) - const termObjectField = (field: FieldValue): string => { + const isFieldTuples = (value: unknown): value is TermFieldTuple[] => { + return Array.isArray(value) && value.every(([key, _]) => isString(key)) + } + + const termObjectField = (field: FieldValueNonDirective): string => { + if (isFieldTuples(field)) return termObjectField(Object.fromEntries(field)) if (isFieldPrimitive(field)) return String(field) return termObject(field) } @@ -204,9 +217,9 @@ export namespace Code { fields?: FieldsInput } - type FieldsInput = string | TermObject | (readonly [name: string, field: DirectiveField])[] + type FieldsInput = string | TermObject | (readonly [name: string, field: string | DirectiveField])[] - export const tsInterface$ = ( + export const tsInterface = ( { name, parameters, extends: extends_, fields, tsDoc, export: export_ }: InterfaceDefinitionInput, ) => { const tsDoc_ = tsDoc ? TSDoc(tsDoc) + `\n` : `` diff --git a/src/lib/fsp.ts b/src/lib/fsp.ts index 0958c0099..27e433f42 100644 --- a/src/lib/fsp.ts +++ b/src/lib/fsp.ts @@ -1,10 +1,12 @@ -import fs from 'node:fs/promises' +import * as Fs from 'node:fs/promises' import { extname, isAbsolute, join } from 'node:path' import type { JsonValue } from 'type-fest' import { errorFromMaybeError } from './prelude.js' +export type Fs = typeof Fs + export const statMaybeExists = async (path: string) => { - return await fs.stat(path).catch((_: unknown) => { + return await Fs.stat(path).catch((_: unknown) => { const error = errorFromMaybeError(_) return `code` in error && typeof error.code === `string` && error.code === `ENOENT` ? null @@ -17,7 +19,7 @@ export const fileExists = async (path: string) => { } export const isPathToADirectory = async (path: string) => { - const stat = await fs.stat(path) + const stat = await Fs.stat(path) return stat.isDirectory() } @@ -40,7 +42,7 @@ export const readJsonFile = async <$Json extends JsonValue>(path: string): Promi let content: string try { - content = await fs.readFile(path, `utf8`) + content = await Fs.readFile(path, `utf8`) } catch (error) { return null } diff --git a/src/lib/grafaid/document.ts b/src/lib/grafaid/document.ts index 97a4f37de..a63fb8a6a 100644 --- a/src/lib/grafaid/document.ts +++ b/src/lib/grafaid/document.ts @@ -30,8 +30,8 @@ import { isString } from '../prelude.js' import { Kind } from './document/kind.js' import { OperationTypeNode } from './document/OperationTypeNode.js' import type { RequestDocumentNodeInput, RequestInput } from './graphql.js' -import { RootTypeName } from './schema/schema.js' import { TypedDocument } from './typed-document/__.js' +export { OperationType } from './schema/OperationType/__.js' export type { ArgumentNode, @@ -268,12 +268,6 @@ export const OperationTypeToAccessKind = { subscription: `read`, } as const -export const OperationTypeToRootType = { - query: RootTypeName.Query, - mutation: RootTypeName.Mutation, - subscription: RootTypeName.Subscription, -} as const - export const print = (document: TypedDocument.TypedDocumentLike): string => { const documentUntyped = TypedDocument.unType(document) return isString(documentUntyped) ? documentUntyped : graphqlPrint(documentUntyped) diff --git a/src/lib/grafaid/graphql.ts b/src/lib/grafaid/graphql.ts index 90703c057..cd19a975c 100644 --- a/src/lib/grafaid/graphql.ts +++ b/src/lib/grafaid/graphql.ts @@ -2,7 +2,7 @@ import type { GraphQLNamedType, GraphQLScalarType } from 'graphql' import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isUnionType } from 'graphql' import { casesExhausted } from '../prelude.js' import type { KindMap } from './schema/schema.js' -import { isRootType, isScalarTypeCustom } from './schema/schema.js' +import { isScalarTypeCustom } from './schema/schema.js' export { type ExecutionResult, @@ -61,9 +61,7 @@ export const getTypeAndKind = ( let kindName: KindMap.KindName - if (isRootType(node)) { - kindName = `Root` - } else if (isScalarType(node)) { + if (isScalarType(node)) { kindName = isScalarTypeCustom(node) ? `ScalarCustom` : `ScalarStandard` } else if (isUnionType(node)) { kindName = `Union` diff --git a/src/lib/grafaid/request.ts b/src/lib/grafaid/request.ts index 31d091c2d..c1d1efa5e 100644 --- a/src/lib/grafaid/request.ts +++ b/src/lib/grafaid/request.ts @@ -2,7 +2,6 @@ import type { GraphQLError, OperationDefinitionNode, OperationTypeNode } from 'g import type { Errors } from '../errors/__.js' import type { Grafaid } from './__.js' import { getOperationDefinition, normalizeDocumentToNode } from './document.js' -import type { RootTypeName } from './schema/schema.js' import type { TypedDocument } from './typed-document/__.js' export interface RequestInput { @@ -19,12 +18,10 @@ export interface RequestDocumentNodeInput { export interface RequestAnalyzedInput extends RequestInput { operation: OperationTypeNode | OperationDefinitionNode - rootType: RootTypeName } export interface RequestAnalyzedDocumentNodeInput extends RequestDocumentNodeInput { operation: OperationDefinitionNode - rootType: RootTypeName } export type Variables = { diff --git a/src/lib/grafaid/schema/KindMap/_.ts b/src/lib/grafaid/schema/KindMap/_.ts index 62dc1b478..17186839a 100644 --- a/src/lib/grafaid/schema/KindMap/_.ts +++ b/src/lib/grafaid/schema/KindMap/_.ts @@ -1,14 +1,17 @@ +import type { GraphQLInterfaceType } from 'graphql' import { - GraphQLEnumType, - GraphQLInputObjectType, - GraphQLInterfaceType, - GraphQLObjectType, - GraphQLScalarType, type GraphQLSchema, - GraphQLUnionType, + isEnumType, + isInputObjectType, + isInterfaceType, + isObjectType, + isScalarType, + isUnionType, } from 'graphql' -import { isScalarTypeAndCustom } from '../schema.js' +import { isScalarTypeCustom } from '../schema.js' +import { includesUnknown } from '../../../prelude.js' +import type { Grafaid } from '../../__.js' import type { KindMap } from './__.js' export const Name = { @@ -22,49 +25,76 @@ export const Name = { Union: `Union`, } satisfies Record -export type KindName = keyof KindMap +export type KindName = keyof KindMap['list'] export const getKindMap = (schema: GraphQLSchema): KindMap => { + const queryType = schema.getQueryType() ?? null + const mutationType = schema.getMutationType() ?? null + const subscriptionType = schema.getSubscriptionType() ?? null + const rootTypeNames = [queryType?.name, mutationType?.name, subscriptionType?.name].filter(_ => + _ !== undefined + ) as (Grafaid.Document.OperationTypeNode)[] const typeMap = schema.getTypeMap() const typeMapValues = Object.values(typeMap) const kindMap: KindMap = { - Root: [], - OutputObject: [], - InputObject: [], - Interface: [], - Union: [], - Enum: [], - ScalarCustom: [], - ScalarStandard: [], + index: { + Root: { + query: queryType, + mutation: mutationType, + subscription: subscriptionType, + }, + OutputObject: {}, + InputObject: {}, + Interface: {}, + Union: {}, + Enum: {}, + ScalarCustom: {}, + ScalarStandard: {}, + }, + list: { + Root: [queryType, mutationType, subscriptionType].filter(_ => _ !== null), + OutputObject: [], + InputObject: [], + Interface: [], + Union: [], + Enum: [], + ScalarCustom: [], + ScalarStandard: [], + }, } for (const type of typeMapValues) { if (type.name.startsWith(`__`)) continue switch (true) { - case type instanceof GraphQLScalarType: - if (isScalarTypeAndCustom(type)) { - kindMap.ScalarCustom.push(type) + case isScalarType(type): + if (isScalarTypeCustom(type)) { + kindMap.list.ScalarCustom.push(type) + kindMap.index.ScalarCustom[type.name] = type } else { - kindMap.ScalarStandard.push(type) + kindMap.list.ScalarStandard.push(type) + kindMap.index.ScalarStandard[type.name] = type } break - case type instanceof GraphQLEnumType: - kindMap.Enum.push(type) + case isEnumType(type): + kindMap.list.Enum.push(type) + kindMap.index.Enum[type.name] = type break - case type instanceof GraphQLInputObjectType: - kindMap.InputObject.push(type) + case isInputObjectType(type): + kindMap.list.InputObject.push(type) + kindMap.index.InputObject[type.name] = type break - case type instanceof GraphQLInterfaceType: - kindMap.Interface.push(type) + case isInterfaceType(type): + kindMap.list.Interface.push(type) + kindMap.index.Interface[type.name] = type break - case type instanceof GraphQLObjectType: - if (type.name === `Query` || type.name === `Mutation` || type.name === `Subscription`) { - kindMap.Root.push(type) - } else { - kindMap.OutputObject.push(type) + case isObjectType(type): + if (!includesUnknown(rootTypeNames, type.name)) { + kindMap.list.OutputObject.push(type) + kindMap.index.OutputObject[type.name] = type } break - case type instanceof GraphQLUnionType: - kindMap.Union.push(type) + case isUnionType(type): + kindMap.list.Union.push(type) + kindMap.index.Union[type.name] = type break default: // skip @@ -74,18 +104,12 @@ export const getKindMap = (schema: GraphQLSchema): KindMap => { return kindMap } -export const hasMutation = (typeMapByKind: KindMap) => typeMapByKind.Root.some((_) => _.name === `Mutation`) - -export const hasSubscription = (typeMapByKind: KindMap) => typeMapByKind.Root.some((_) => _.name === `Subscription`) - -export const hasQuery = (typeMapByKind: KindMap) => typeMapByKind.Root.some((_) => _.name === `Query`) - export const hasCustomScalars = (typeMapByKind: KindMap) => { - return typeMapByKind.ScalarCustom.length > 0 + return typeMapByKind.list.ScalarCustom.length > 0 } export const getInterfaceImplementors = (typeMap: KindMap, interfaceTypeSearch: GraphQLInterfaceType) => { - return typeMap.OutputObject.filter(objectType => + return typeMap.list.OutputObject.filter(objectType => objectType.getInterfaces().filter(interfaceType => interfaceType.name === interfaceTypeSearch.name).length > 0 ) } diff --git a/src/lib/grafaid/schema/KindMap/__.ts b/src/lib/grafaid/schema/KindMap/__.ts index cf67d3df5..26f8ea152 100644 --- a/src/lib/grafaid/schema/KindMap/__.ts +++ b/src/lib/grafaid/schema/KindMap/__.ts @@ -10,12 +10,28 @@ import type { export * as KindMap from './_.js' export interface KindMap { - Root: GraphQLObjectType[] - OutputObject: GraphQLObjectType[] - InputObject: GraphQLInputObjectType[] - Interface: GraphQLInterfaceType[] - Union: GraphQLUnionType[] - Enum: GraphQLEnumType[] - ScalarCustom: GraphQLScalarType[] - ScalarStandard: GraphQLScalarType[] + index: { + Root: { + query: GraphQLObjectType | null + mutation: GraphQLObjectType | null + subscription: GraphQLObjectType | null + } + OutputObject: Record + InputObject: Record + Interface: Record + Union: Record + Enum: Record + ScalarCustom: Record + ScalarStandard: Record + } + list: { + Root: GraphQLObjectType[] + OutputObject: GraphQLObjectType[] + InputObject: GraphQLInputObjectType[] + Interface: GraphQLInterfaceType[] + Union: GraphQLUnionType[] + Enum: GraphQLEnumType[] + ScalarCustom: GraphQLScalarType[] + ScalarStandard: GraphQLScalarType[] + } } diff --git a/src/lib/grafaid/schema/OperationType/_.ts b/src/lib/grafaid/schema/OperationType/_.ts new file mode 100644 index 000000000..0a6a62433 --- /dev/null +++ b/src/lib/grafaid/schema/OperationType/_.ts @@ -0,0 +1,8 @@ +export const OperationTypeQuery = `query` +export type OperationTypeQuery = typeof OperationTypeQuery + +export const OperationTypeMutation = `mutation` +export type OperationTypeMutation = typeof OperationTypeMutation + +export const OperationTypeSubscription = `subscription` +export type OperationTypeSubscription = typeof OperationTypeSubscription diff --git a/src/lib/grafaid/schema/OperationType/__.ts b/src/lib/grafaid/schema/OperationType/__.ts new file mode 100644 index 000000000..cf221cdf9 --- /dev/null +++ b/src/lib/grafaid/schema/OperationType/__.ts @@ -0,0 +1,4 @@ +import type { OperationTypeMutation, OperationTypeQuery, OperationTypeSubscription } from './_.js' + +export * as OperationType from './_.js' +export type OperationType = OperationTypeQuery | OperationTypeMutation | OperationTypeSubscription diff --git a/src/lib/grafaid/schema/schema.ts b/src/lib/grafaid/schema/schema.ts index 8d187874b..7078c9f5f 100644 --- a/src/lib/grafaid/schema/schema.ts +++ b/src/lib/grafaid/schema/schema.ts @@ -149,24 +149,6 @@ export const NameToClassNamedType = { export type NameToClassNamedType = typeof NameToClassNamedType -export const RootTypeName = { - Query: `Query`, - Mutation: `Mutation`, - Subscription: `Subscription`, -} as const - -export type RootTypeName = keyof typeof RootTypeName - -export type RootTypeNameQuery = typeof RootTypeName['Query'] - -export type RootTypeNameMutation = typeof RootTypeName['Mutation'] - -export type RootTypeNameSubscription = typeof RootTypeName['Subscription'] - -export const isRootType = (value: unknown): value is GraphQLObjectType => { - return isObjectType(value) && value.name in RootTypeName -} - export type NodeName = keyof NameToClass // export type AnyClass = InstanceType diff --git a/src/lib/prelude.ts b/src/lib/prelude.ts index 1a7a62b1a..5adb7e808 100644 --- a/src/lib/prelude.ts +++ b/src/lib/prelude.ts @@ -6,6 +6,8 @@ export type RemoveIndex = { [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K] } +export const includesUnknown = (array: T[], value: unknown): value is T => array.includes(value as any) + export const pick = (obj: T, keys: K[]): Pick => { const result: Partial = {} keys.forEach(key => { diff --git a/src/types/Schema/StandardTypes/_.ts b/src/types/Schema/StandardTypes/_.ts index 3e47c5405..413e3adb8 100644 --- a/src/types/Schema/StandardTypes/_.ts +++ b/src/types/Schema/StandardTypes/_.ts @@ -1,2 +1 @@ -export * from './object.js' export * from './scalar.js' diff --git a/src/types/Schema/StandardTypes/object.ts b/src/types/Schema/StandardTypes/object.ts deleted file mode 100644 index 779e1dfd4..000000000 --- a/src/types/Schema/StandardTypes/object.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Grafaid } from '../../../lib/grafaid/__.js' -import type { OutputFields, OutputObject } from '../_.js' - -export interface Query< - $Fields extends OutputFields = OutputFields, -> extends OutputObject {} - -export interface Mutation< - $Fields extends OutputFields = OutputFields, -> extends OutputObject {} - -export interface Subscription< - $Fields extends OutputFields = OutputFields, -> extends OutputObject {} - -export type RootType = Query | Mutation | Subscription diff --git a/src/types/Schema/__.ts b/src/types/Schema/__.ts index 9b7b737c2..e0bfbfb72 100644 --- a/src/types/Schema/__.ts +++ b/src/types/Schema/__.ts @@ -1,12 +1,13 @@ export * as Schema from './_.js' +import type { Grafaid } from '../../lib/grafaid/__.js' import type { GlobalRegistry } from '../GlobalRegistry/GlobalRegistry.js' import type { Enum } from './nodes/Enum.js' import type { Interface } from './nodes/Interface.js' import type { OutputObject } from './nodes/OutputObject.js' import type { Scalar } from './nodes/Scalar/Scalar.js' import type { Union } from './nodes/Union.js' -import type { Mutation, Query, RootType, Subscription } from './StandardTypes/object.js' +// import type { Mutation, Query, RootType, Subscription } from './StandardTypes/object.js' /** * A generic schema type. Any particular schema will be a subtype of this, with @@ -17,18 +18,16 @@ export interface Schema< $Scalars extends Scalar.Registry = Scalar.Registry, > { name: GlobalRegistry.ClientNames - RootTypesPresent: ('Query' | 'Mutation' | 'Subscription')[] - RootUnion: RootType + operationsAvailable: Grafaid.Document.OperationType[] + RootUnion: OutputObject Root: { - Query: null | Query - Mutation: null | Mutation - Subscription: null | Subscription + query: null | OutputObject + mutation: null | OutputObject + subscription: null | OutputObject } allTypes: Record< string, | Enum - | Query - | Mutation | OutputObject | Union | Interface diff --git a/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts b/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts index 197ca64a8..e81ebd541 100644 --- a/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts +++ b/src/types/SchemaDrivenDataMap/SchemaDrivenDataMap.ts @@ -8,10 +8,10 @@ export * from './InlineType.js' declare global { namespace GraffleGlobal { export interface SchemaDrivenDataMap { - roots: { - [Grafaid.Schema.RootTypeName.Mutation]?: SchemaDrivenDataMap.OutputObject - [Grafaid.Schema.RootTypeName.Query]?: SchemaDrivenDataMap.OutputObject - [Grafaid.Schema.RootTypeName.Subscription]?: SchemaDrivenDataMap.OutputObject + operations: { + [Grafaid.Document.OperationTypeNode.MUTATION]?: SchemaDrivenDataMap.OutputObject + [Grafaid.Document.OperationTypeNode.QUERY]?: SchemaDrivenDataMap.OutputObject + [Grafaid.Document.OperationTypeNode.SUBSCRIPTION]?: SchemaDrivenDataMap.OutputObject } types: Record directives: Record diff --git a/tests/_/helpers.ts b/tests/_/helpers.ts index c12fde758..de1dd9653 100644 --- a/tests/_/helpers.ts +++ b/tests/_/helpers.ts @@ -75,6 +75,7 @@ export const test = testBase.extend({ }, dependencies: { tsx: `4.19.1`, + graphql: `16.9.0`, typescript: `5.6.3`, '@tsconfig/strictest': `2.0.5`, // '@rollup/plugin-node-resolve': `^15.3.0`, diff --git a/tests/_/schemas/generate.ts b/tests/_/schemas/generate.ts index 10fa1fb48..ff3dbe139 100644 --- a/tests/_/schemas/generate.ts +++ b/tests/_/schemas/generate.ts @@ -17,7 +17,10 @@ const generate = async ( await Generator.generate({ currentWorkingDirectory: import.meta.dirname, - schema, + schema: { + type: `instance`, + instance: schema, + }, // todo funky between this and passing path to sdl sourceDirPath: inputPathRootDir, outputSDL: true, diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/Client.ts b/tests/_/schemas/kitchen-sink/graffle/modules/Client.ts index 5a25cf4ed..9080daf87 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/Client.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/Client.ts @@ -2,5 +2,4 @@ import { createPrefilled } from '../../../../../../src/entrypoints/client.js' import { defaultSchemaUrl } from './Data.js' import { Name } from './Data.js' import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsDocument.ts b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsDocument.ts index ac1681bcf..f12a02bd5 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsDocument.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsDocument.ts @@ -1,7 +1,6 @@ import type * as Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import type { Schema } from './Schema.js' import type * as SelectionSets from './SelectionSets.js' - export interface Document<$Context extends Utilities.ClientContext> { <$Document>( document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsRoot.ts b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsRoot.ts index d2e849f2c..749efd35c 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsRoot.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsRoot.ts @@ -3,52 +3,6 @@ import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-f import type { Schema } from './Schema.js' import type * as SelectionSet from './SelectionSets.js' -export interface MutationMethods<$Context extends $$Utilities.ClientContext> { - $batch: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutput< - $Context, - InferResult.Mutation<$SelectionSet, Schema<$Context['scalars']>> - > - > - > - __typename: () => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - { __typename: 'Mutation' }, - '__typename' - > - > - > - - id: <$SelectionSet>( - selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.id<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - InferResult.Mutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, - 'id' - > - > - > - - idNonNull: <$SelectionSet>( - selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.idNonNull<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - InferResult.Mutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, - 'idNonNull' - > - > - > -} - export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $batch: <$SelectionSet>( selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context['scalars']>>, @@ -56,7 +10,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Query<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<$SelectionSet, Schema<$Context['scalars']>> > > > @@ -76,7 +30,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ InputObjectNested: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ InputObjectNested: $SelectionSet }, Schema<$Context['scalars']>>, 'InputObjectNested' > > @@ -88,7 +42,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ InputObjectNestedNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ InputObjectNestedNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'InputObjectNestedNonNull' > > @@ -102,7 +56,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ abcEnum: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ abcEnum: $SelectionSet }, Schema<$Context['scalars']>>, 'abcEnum' > > @@ -114,7 +68,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ argInputObjectCircular: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ argInputObjectCircular: $SelectionSet }, Schema<$Context['scalars']>>, 'argInputObjectCircular' > > @@ -126,7 +80,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ date: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ date: $SelectionSet }, Schema<$Context['scalars']>>, 'date' > > @@ -138,7 +92,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArg: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArg' > > @@ -150,7 +104,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgInputObject' > > @@ -162,7 +116,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgList' > > @@ -174,7 +128,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNull' > > @@ -186,7 +140,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNullList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNullList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNullList' > > @@ -198,7 +152,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateArgNonNullListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateArgNonNullListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateArgNonNullListNonNull' > > @@ -210,7 +164,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateInterface1: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateInterface1: $SelectionSet }, Schema<$Context['scalars']>>, 'dateInterface1' > > @@ -222,7 +176,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateList' > > @@ -234,7 +188,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateListList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateListList: $SelectionSet }, Schema<$Context['scalars']>>, 'dateListList' > > @@ -246,7 +200,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateListNonNull' > > @@ -258,7 +212,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'dateNonNull' > > @@ -270,7 +224,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateObject1: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateObject1: $SelectionSet }, Schema<$Context['scalars']>>, 'dateObject1' > > @@ -282,7 +236,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ dateUnion: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ dateUnion: $SelectionSet }, Schema<$Context['scalars']>>, 'dateUnion' > > @@ -294,7 +248,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ error: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ error: $SelectionSet }, Schema<$Context['scalars']>>, 'error' > > @@ -306,7 +260,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ id: $SelectionSet }, Schema<$Context['scalars']>>, 'id' > > @@ -318,7 +272,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'idNonNull' > > @@ -330,7 +284,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interface: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interface: $SelectionSet }, Schema<$Context['scalars']>>, 'interface' > > @@ -342,7 +296,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interfaceNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interfaceNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'interfaceNonNull' > > @@ -354,7 +308,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ interfaceWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ interfaceWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'interfaceWithArgs' > > @@ -366,7 +320,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listInt: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listInt: $SelectionSet }, Schema<$Context['scalars']>>, 'listInt' > > @@ -378,7 +332,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'listIntNonNull' > > @@ -390,7 +344,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listListInt: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listListInt: $SelectionSet }, Schema<$Context['scalars']>>, 'listListInt' > > @@ -402,7 +356,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ listListIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ listListIntNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'listListIntNonNull' > > @@ -414,7 +368,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ lowerCaseUnion: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ lowerCaseUnion: $SelectionSet }, Schema<$Context['scalars']>>, 'lowerCaseUnion' > > @@ -426,7 +380,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ object: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ object: $SelectionSet }, Schema<$Context['scalars']>>, 'object' > > @@ -438,7 +392,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectList: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectList: $SelectionSet }, Schema<$Context['scalars']>>, 'objectList' > > @@ -450,7 +404,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectListNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'objectListNonNull' > > @@ -462,7 +416,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectNested: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectNested: $SelectionSet }, Schema<$Context['scalars']>>, 'objectNested' > > @@ -474,7 +428,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'objectNonNull' > > @@ -486,7 +440,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ objectWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ objectWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'objectWithArgs' > > @@ -498,7 +452,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ result: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ result: $SelectionSet }, Schema<$Context['scalars']>>, 'result' > > @@ -510,7 +464,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ resultNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ resultNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'resultNonNull' > > @@ -522,7 +476,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ string: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ string: $SelectionSet }, Schema<$Context['scalars']>>, 'string' > > @@ -534,7 +488,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgEnum: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgEnum: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgEnum' > > @@ -546,7 +500,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgInputObject: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgInputObject' > > @@ -561,7 +515,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgInputObjectRequired: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgInputObjectRequired: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgInputObjectRequired' > > @@ -575,7 +529,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithArgs' > > @@ -587,7 +541,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithListArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithListArg: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithListArg' > > @@ -599,7 +553,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithListArgRequired: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithListArgRequired: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithListArgRequired' > > @@ -611,7 +565,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ stringWithRequiredArg: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ stringWithRequiredArg: $SelectionSet }, Schema<$Context['scalars']>>, 'stringWithRequiredArg' > > @@ -623,7 +577,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBar: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBar: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBar' > > @@ -635,7 +589,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBarNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBarNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBarNonNull' > > @@ -647,7 +601,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionFooBarWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionFooBarWithArgs: $SelectionSet }, Schema<$Context['scalars']>>, 'unionFooBarWithArgs' > > @@ -659,7 +613,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionObject: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionObject: $SelectionSet }, Schema<$Context['scalars']>>, 'unionObject' > > @@ -671,16 +625,62 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ unionObjectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ unionObjectNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'unionObjectNonNull' > > > } +export interface MutationMethods<$Context extends $$Utilities.ClientContext> { + $batch: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutput< + $Context, + InferResult.OperationMutation<$SelectionSet, Schema<$Context['scalars']>> + > + > + > + __typename: () => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + { __typename: 'Mutation' }, + '__typename' + > + > + > + + id: <$SelectionSet>( + selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.id<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + 'id' + > + > + > + + idNonNull: <$SelectionSet>( + selectionSet?: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.idNonNull<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + 'idNonNull' + > + > + > +} + export interface BuilderMethodsRoot<$Context extends $$Utilities.ClientContext> { - mutation: MutationMethods<$Context> query: QueryMethods<$Context> + mutation: MutationMethods<$Context> } export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction.Fn { diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts index 8c26b9ecb..c3ddd85cc 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/MethodsSelect.ts @@ -18,8 +18,8 @@ import type * as $SelectionSets from './SelectionSets.js' // export interface $MethodsSelect { - Mutation: Mutation Query: Query + Mutation: Mutation Bar: Bar DateObject1: DateObject1 DateObject2: DateObject2 @@ -58,14 +58,14 @@ export interface $MethodsSelect { // // -export interface Mutation { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet -} - export interface Query { <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet } +export interface Mutation { + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet +} + // // // diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts b/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts index 40150a401..337a1678c 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/Schema.ts @@ -20,45 +20,6 @@ export namespace Schema { // // - // Mutation - // -------------------------------------------------------------------------------------------------- - // - - export interface Mutation extends $.OutputObject { - name: 'Mutation' - fields: { - __typename: Mutation.__typename - id: Mutation.id - idNonNull: Mutation.idNonNull - } - } - - export namespace Mutation { - export interface __typename extends $.OutputField { - name: '__typename' - arguments: {} - inlineType: [1] - namedType: { - kind: '__typename' - value: 'Mutation' - } - } - - export interface id extends $.OutputField { - name: 'id' - arguments: {} - inlineType: [0] - namedType: $$NamedTypes.$$ID - } - - export interface idNonNull extends $.OutputField { - name: 'idNonNull' - arguments: {} - inlineType: [1] - namedType: $$NamedTypes.$$ID - } - } - // Query // -------------------------------------------------------------------------------------------------- // @@ -696,6 +657,45 @@ export namespace Schema { } } + // Mutation + // -------------------------------------------------------------------------------------------------- + // + + export interface Mutation extends $.OutputObject { + name: 'Mutation' + fields: { + __typename: Mutation.__typename + id: Mutation.id + idNonNull: Mutation.idNonNull + } + } + + export namespace Mutation { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Mutation' + } + } + + export interface id extends $.OutputField { + name: 'id' + arguments: {} + inlineType: [0] + namedType: $$NamedTypes.$$ID + } + + export interface idNonNull extends $.OutputField { + name: 'idNonNull' + arguments: {} + inlineType: [1] + namedType: $$NamedTypes.$$ID + } + } + // // // @@ -1616,8 +1616,8 @@ export namespace Schema { */ namespace $$NamedTypes { - export type $$Mutation = Mutation export type $$Query = Query + export type $$Mutation = Mutation export type $$Bar = Bar export type $$DateObject1 = DateObject1 export type $$DateObject2 = DateObject2 @@ -1673,16 +1673,18 @@ export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$ extends $ { name: Data.Name - RootTypesPresent: ['Mutation', 'Query'] - RootUnion: Schema.Mutation | Schema.Query + operationsAvailable: ['query', 'mutation'] + RootUnion: + | Schema.Query + | Schema.Mutation Root: { - Query: Schema.Query - Mutation: Schema.Mutation - Subscription: null + query: Schema.Query + mutation: Schema.Mutation + subscription: null } allTypes: { - Mutation: Schema.Mutation Query: Schema.Query + Mutation: Schema.Mutation ABCEnum: Schema.ABCEnum Case: Schema.Case Bar: Schema.Bar diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts index 0d9497821..e53a31ae8 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/SchemaDrivenDataMap.ts @@ -327,13 +327,6 @@ const lowerCaseUnion: $$Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { - f: { - id: {}, - idNonNull: {}, - }, -} - const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { InputObjectNested: { @@ -626,6 +619,13 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { }, } +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + id: {}, + idNonNull: {}, + }, +} + // // // @@ -686,9 +686,9 @@ Query.f[`unionObjectNonNull`]!.nt = ObjectUnion // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Mutation, - Query, + operations: { + query: Query, + mutation: Mutation, }, directives: {}, types: { @@ -724,8 +724,8 @@ const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { FooBarUnion, Result, lowerCaseUnion, - Mutation, Query, + Mutation, }, } diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts b/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts index 60200f83e..49d882ca5 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/Select.ts @@ -1,3 +1,4 @@ +import type { OperationTypeNode } from 'graphql' import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import * as Data from './Data.js' import type { Schema } from './Schema.js' @@ -38,16 +39,22 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Root< + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Operation< $SelectionSet, Schema, - 'Mutation' + OperationTypeNode.QUERY > - export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // OutputObject Types - // ------------------ + export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Operation< + $SelectionSet, + Schema, + OperationTypeNode.MUTATION + > + // OutputObject + // -------------------------------------------------------------------------------------------------- + // export type Bar<$SelectionSet extends SelectionSets.Bar> = InferResult.OutputObject< $SelectionSet, Schema, @@ -107,8 +114,9 @@ export namespace Select { Schema, Schema['allTypes']['lowerCaseObject2'] > - // Union Types - // ----------- + // Union + // -------------------------------------------------------------------------------------------------- + // export type DateUnion<$SelectionSet extends SelectionSets.DateUnion> = InferResult.Union< $SelectionSet, Schema, @@ -129,8 +137,9 @@ export namespace Select { Schema, Schema['allTypes']['lowerCaseUnion'] > - // Interface Types - // --------------- + // Interface + // -------------------------------------------------------------------------------------------------- + // export type DateInterface1<$SelectionSet extends SelectionSets.DateInterface1> = InferResult.Interface< $SelectionSet, Schema, diff --git a/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts b/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts index 7c7d99852..24ff87d00 100644 --- a/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/kitchen-sink/graffle/modules/SelectionSets.ts @@ -40,122 +40,9 @@ export interface $Document< // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- -// Mutation -// -------------------------------------------------------------------------------------------------- -// -// - -// ----------------------------------------| Entrypoint Interface | - -export interface Mutation< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> { - /** - * Select the `id` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). - */ - id?: Mutation.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> - /** - * Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). - */ - idNonNull?: Mutation.idNonNull$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Mutation$FragmentInline<_$Scalars> - | Mutation$FragmentInline<_$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Mutation$FragmentInline< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { -} - -// ----------------------------------------| Fields | - -export namespace Mutation { - export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<_$Scalars> - - export interface id$SelectionSet< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > extends $Select.Bases.Base {} - - // --- expanded --- - - /** - * This is the "expanded" version of the `id` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type id$Expanded< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<_$Scalars> - > - - // -------------------------------------------------------------------------------------------------- - - export type idNonNull< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = - | $Select.Indicator.NoArgsIndicator - | idNonNull$SelectionSet<_$Scalars> - - export interface idNonNull$SelectionSet< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > extends $Select.Bases.Base {} - - // --- expanded --- - - /** - * 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< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = $$Utilities.Simplify< - | $Select.Indicator.NoArgsIndicator - | idNonNull$SelectionSet<_$Scalars> - > -} - -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -1933,6 +1820,103 @@ export namespace Query { > } +// Mutation +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * Select the `id` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + id?: Mutation.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + /** + * Select the `idNonNull` field on the `Mutation` object. Its type is `ID` (a `ScalarStandard` kind of type). + */ + idNonNull?: Mutation.idNonNull$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Mutation$FragmentInline<_$Scalars> + | Mutation$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Mutation$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Mutation { + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * This is the "expanded" version of the `id` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | id$SelectionSet<_$Scalars> + > + + // -------------------------------------------------------------------------------------------------- + + export type idNonNull< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = + | $Select.Indicator.NoArgsIndicator + | idNonNull$SelectionSet<_$Scalars> + + export interface idNonNull$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} + + // --- expanded --- + + /** + * 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< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + | $Select.Indicator.NoArgsIndicator + | idNonNull$SelectionSet<_$Scalars> + > +} + // // // @@ -2039,17 +2023,9 @@ export interface InputObjectNestedNonNull< // // -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Bar // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2114,17 +2090,9 @@ export namespace Bar { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // DateObject1 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2189,17 +2157,9 @@ export namespace DateObject1 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // DateObject2 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2264,17 +2224,9 @@ export namespace DateObject2 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ErrorOne // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2367,17 +2319,9 @@ export namespace ErrorOne { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ErrorTwo // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2470,17 +2414,9 @@ export namespace ErrorTwo { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Foo // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2548,17 +2484,9 @@ export namespace Foo { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object1 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2765,17 +2693,9 @@ export namespace Object1 { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object1ImplementingInterface // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2872,17 +2792,9 @@ export namespace Object1ImplementingInterface { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Object2ImplementingInterface // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2981,17 +2893,9 @@ export namespace Object2ImplementingInterface { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ObjectNested // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3082,17 +2986,9 @@ export namespace ObjectNested { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // ObjectUnion // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3158,17 +3054,9 @@ export namespace ObjectUnion { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // lowerCaseObject // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3233,17 +3121,9 @@ export namespace lowerCaseObject { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // lowerCaseObject2 // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -3672,11 +3552,11 @@ export namespace Interface { * would end up with an error of `export interface Foo extends Foo ...` */ export namespace $NamedTypes { + export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Query<_$Scalars> export type $Mutation< _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, > = Mutation<_$Scalars> - export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = - Query<_$Scalars> export type $ABCEnum = ABCEnum export type $Case = Case export type $InputObject< diff --git a/tests/_/schemas/mutation-only/graffle/modules/Client.ts b/tests/_/schemas/mutation-only/graffle/modules/Client.ts index 5a25cf4ed..9080daf87 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/Client.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/Client.ts @@ -2,5 +2,4 @@ import { createPrefilled } from '../../../../../../src/entrypoints/client.js' import { defaultSchemaUrl } from './Data.js' import { Name } from './Data.js' import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) diff --git a/tests/_/schemas/mutation-only/graffle/modules/MethodsDocument.ts b/tests/_/schemas/mutation-only/graffle/modules/MethodsDocument.ts index ac1681bcf..f12a02bd5 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/MethodsDocument.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/MethodsDocument.ts @@ -1,7 +1,6 @@ import type * as Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import type { Schema } from './Schema.js' import type * as SelectionSets from './SelectionSets.js' - export interface Document<$Context extends Utilities.ClientContext> { <$Document>( document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, diff --git a/tests/_/schemas/mutation-only/graffle/modules/MethodsRoot.ts b/tests/_/schemas/mutation-only/graffle/modules/MethodsRoot.ts index c23d8df66..34d80197b 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/MethodsRoot.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/MethodsRoot.ts @@ -10,7 +10,7 @@ export interface MutationMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Mutation<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationMutation<$SelectionSet, Schema<$Context['scalars']>> > > > @@ -30,7 +30,7 @@ export interface MutationMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Mutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationMutation<{ id: $SelectionSet }, Schema<$Context['scalars']>>, 'id' > > @@ -42,7 +42,7 @@ export interface MutationMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Mutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationMutation<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'idNonNull' > > diff --git a/tests/_/schemas/mutation-only/graffle/modules/Schema.ts b/tests/_/schemas/mutation-only/graffle/modules/Schema.ts index e2d130e4a..6090bde90 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/Schema.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/Schema.ts @@ -255,12 +255,12 @@ export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$ extends $ { name: Data.Name - RootTypesPresent: ['Mutation'] + operationsAvailable: ['mutation'] RootUnion: Schema.Mutation Root: { - Query: null - Mutation: Schema.Mutation - Subscription: null + query: null + mutation: Schema.Mutation + subscription: null } allTypes: { Mutation: Schema.Mutation diff --git a/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts index cff96ae6c..03a51f428 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/SchemaDrivenDataMap.ts @@ -193,8 +193,8 @@ const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Mutation, + operations: { + mutation: Mutation, }, directives: {}, types: { diff --git a/tests/_/schemas/mutation-only/graffle/modules/Select.ts b/tests/_/schemas/mutation-only/graffle/modules/Select.ts index d1945bb22..345bcc8a9 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/Select.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/Select.ts @@ -1,3 +1,4 @@ +import type { OperationTypeNode } from 'graphql' import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import * as Data from './Data.js' import type { Schema } from './Schema.js' @@ -38,25 +39,23 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Root< + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Operation< $SelectionSet, Schema, - 'Mutation' + OperationTypeNode.MUTATION > - // OutputObject Types - // ------------------ + // OutputObject + // -------------------------------------------------------------------------------------------------- + // - // -- None -- + // Union + // -------------------------------------------------------------------------------------------------- + // - // Union Types - // ----------- - - // -- None -- - - // Interface Types - // --------------- - - // -- None -- + // Interface + // -------------------------------------------------------------------------------------------------- + // } diff --git a/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts b/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts index b14fb261b..e904316c1 100644 --- a/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/mutation-only/graffle/modules/SelectionSets.ts @@ -39,17 +39,9 @@ export interface $Document< // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- // Mutation // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | diff --git a/tests/_/schemas/pokemon/graffle/modules/Client.ts b/tests/_/schemas/pokemon/graffle/modules/Client.ts index 5a25cf4ed..9080daf87 100644 --- a/tests/_/schemas/pokemon/graffle/modules/Client.ts +++ b/tests/_/schemas/pokemon/graffle/modules/Client.ts @@ -2,5 +2,4 @@ import { createPrefilled } from '../../../../../../src/entrypoints/client.js' import { defaultSchemaUrl } from './Data.js' import { Name } from './Data.js' import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) diff --git a/tests/_/schemas/pokemon/graffle/modules/MethodsDocument.ts b/tests/_/schemas/pokemon/graffle/modules/MethodsDocument.ts index ac1681bcf..f12a02bd5 100644 --- a/tests/_/schemas/pokemon/graffle/modules/MethodsDocument.ts +++ b/tests/_/schemas/pokemon/graffle/modules/MethodsDocument.ts @@ -1,7 +1,6 @@ import type * as Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import type { Schema } from './Schema.js' import type * as SelectionSets from './SelectionSets.js' - export interface Document<$Context extends Utilities.ClientContext> { <$Document>( document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, diff --git a/tests/_/schemas/pokemon/graffle/modules/MethodsRoot.ts b/tests/_/schemas/pokemon/graffle/modules/MethodsRoot.ts index f829343ba..49034403d 100644 --- a/tests/_/schemas/pokemon/graffle/modules/MethodsRoot.ts +++ b/tests/_/schemas/pokemon/graffle/modules/MethodsRoot.ts @@ -3,40 +3,6 @@ import type * as $$Utilities from '../../../../../../src/entrypoints/utilities-f import type { Schema } from './Schema.js' import type * as SelectionSet from './SelectionSets.js' -export interface MutationMethods<$Context extends $$Utilities.ClientContext> { - $batch: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutput< - $Context, - InferResult.Mutation<$SelectionSet, Schema<$Context['scalars']>> - > - > - > - __typename: () => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - { __typename: 'Mutation' }, - '__typename' - > - > - > - - addPokemon: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.addPokemon<$Context['scalars']>>, - ) => Promise< - $$Utilities.Simplify< - $$Utilities.HandleOutputGraffleRootField< - $Context, - InferResult.Mutation<{ addPokemon: $SelectionSet }, Schema<$Context['scalars']>>, - 'addPokemon' - > - > - > -} - export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $batch: <$SelectionSet>( selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context['scalars']>>, @@ -44,7 +10,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Query<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<$SelectionSet, Schema<$Context['scalars']>> > > > @@ -64,7 +30,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ battles: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ battles: $SelectionSet }, Schema<$Context['scalars']>>, 'battles' > > @@ -76,7 +42,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ beings: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ beings: $SelectionSet }, Schema<$Context['scalars']>>, 'beings' > > @@ -88,7 +54,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ pokemon: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ pokemon: $SelectionSet }, Schema<$Context['scalars']>>, 'pokemon' > > @@ -100,7 +66,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ pokemonByName: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ pokemonByName: $SelectionSet }, Schema<$Context['scalars']>>, 'pokemonByName' > > @@ -112,7 +78,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ pokemons: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ pokemons: $SelectionSet }, Schema<$Context['scalars']>>, 'pokemons' > > @@ -124,7 +90,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ trainerByName: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ trainerByName: $SelectionSet }, Schema<$Context['scalars']>>, 'trainerByName' > > @@ -136,16 +102,50 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ trainers: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ trainers: $SelectionSet }, Schema<$Context['scalars']>>, 'trainers' > > > } +export interface MutationMethods<$Context extends $$Utilities.ClientContext> { + $batch: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutput< + $Context, + InferResult.OperationMutation<$SelectionSet, Schema<$Context['scalars']>> + > + > + > + __typename: () => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + { __typename: 'Mutation' }, + '__typename' + > + > + > + + addPokemon: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.addPokemon<$Context['scalars']>>, + ) => Promise< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< + $Context, + InferResult.OperationMutation<{ addPokemon: $SelectionSet }, Schema<$Context['scalars']>>, + 'addPokemon' + > + > + > +} + export interface BuilderMethodsRoot<$Context extends $$Utilities.ClientContext> { - mutation: MutationMethods<$Context> query: QueryMethods<$Context> + mutation: MutationMethods<$Context> } export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction.Fn { diff --git a/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts b/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts index f6147989d..80ada538c 100644 --- a/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts +++ b/tests/_/schemas/pokemon/graffle/modules/MethodsSelect.ts @@ -18,8 +18,8 @@ import type * as $SelectionSets from './SelectionSets.js' // export interface $MethodsSelect { - Mutation: Mutation Query: Query + Mutation: Mutation BattleRoyale: BattleRoyale BattleTrainer: BattleTrainer BattleWild: BattleWild @@ -48,14 +48,14 @@ export interface $MethodsSelect { // // -export interface Mutation { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet -} - export interface Query { <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet } +export interface Mutation { + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet +} + // // // diff --git a/tests/_/schemas/pokemon/graffle/modules/Schema.ts b/tests/_/schemas/pokemon/graffle/modules/Schema.ts index b285ad820..4b8cedda1 100644 --- a/tests/_/schemas/pokemon/graffle/modules/Schema.ts +++ b/tests/_/schemas/pokemon/graffle/modules/Schema.ts @@ -20,68 +20,6 @@ export namespace Schema { // // - // Mutation - // -------------------------------------------------------------------------------------------------- - // - - export interface Mutation extends $.OutputObject { - name: 'Mutation' - fields: { - __typename: Mutation.__typename - addPokemon: Mutation.addPokemon - } - } - - export namespace Mutation { - export interface __typename extends $.OutputField { - name: '__typename' - arguments: {} - inlineType: [1] - namedType: { - kind: '__typename' - value: 'Mutation' - } - } - - export interface addPokemon extends $.OutputField { - name: 'addPokemon' - arguments: { - attack: { - kind: 'InputField' - name: 'attack' - inlineType: [0] - namedType: $$NamedTypes.$$Int - } - defense: { - kind: 'InputField' - name: 'defense' - inlineType: [0] - namedType: $$NamedTypes.$$Int - } - hp: { - kind: 'InputField' - name: 'hp' - inlineType: [0] - namedType: $$NamedTypes.$$Int - } - name: { - kind: 'InputField' - name: 'name' - inlineType: [1] - namedType: $$NamedTypes.$$String - } - type: { - kind: 'InputField' - name: 'type' - inlineType: [1] - namedType: $$NamedTypes.$$PokemonType - } - } - inlineType: [0] - namedType: $$NamedTypes.$$Pokemon - } - } - // Query // -------------------------------------------------------------------------------------------------- // @@ -182,6 +120,68 @@ export namespace Schema { } } + // Mutation + // -------------------------------------------------------------------------------------------------- + // + + export interface Mutation extends $.OutputObject { + name: 'Mutation' + fields: { + __typename: Mutation.__typename + addPokemon: Mutation.addPokemon + } + } + + export namespace Mutation { + export interface __typename extends $.OutputField { + name: '__typename' + arguments: {} + inlineType: [1] + namedType: { + kind: '__typename' + value: 'Mutation' + } + } + + export interface addPokemon extends $.OutputField { + name: 'addPokemon' + arguments: { + attack: { + kind: 'InputField' + name: 'attack' + inlineType: [0] + namedType: $$NamedTypes.$$Int + } + defense: { + kind: 'InputField' + name: 'defense' + inlineType: [0] + namedType: $$NamedTypes.$$Int + } + hp: { + kind: 'InputField' + name: 'hp' + inlineType: [0] + namedType: $$NamedTypes.$$Int + } + name: { + kind: 'InputField' + name: 'name' + inlineType: [1] + namedType: $$NamedTypes.$$String + } + type: { + kind: 'InputField' + name: 'type' + inlineType: [1] + namedType: $$NamedTypes.$$PokemonType + } + } + inlineType: [0] + namedType: $$NamedTypes.$$Pokemon + } + } + // // // @@ -1001,8 +1001,8 @@ export namespace Schema { */ namespace $$NamedTypes { - export type $$Mutation = Mutation export type $$Query = Query + export type $$Mutation = Mutation export type $$BattleRoyale = BattleRoyale export type $$BattleTrainer = BattleTrainer export type $$BattleWild = BattleWild @@ -1048,16 +1048,18 @@ export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$ extends $ { name: Data.Name - RootTypesPresent: ['Mutation', 'Query'] - RootUnion: Schema.Mutation | Schema.Query + operationsAvailable: ['query', 'mutation'] + RootUnion: + | Schema.Query + | Schema.Mutation Root: { - Query: Schema.Query - Mutation: Schema.Mutation - Subscription: null + query: Schema.Query + mutation: Schema.Mutation + subscription: null } allTypes: { - Mutation: Schema.Mutation Query: Schema.Query + Mutation: Schema.Mutation BattleWildResult: Schema.BattleWildResult PokemonType: Schema.PokemonType TrainerClass: Schema.TrainerClass diff --git a/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts index 122846baf..9cc1d9ec5 100644 --- a/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/pokemon/graffle/modules/SchemaDrivenDataMap.ts @@ -309,36 +309,6 @@ const Battle: $$Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { - f: { - addPokemon: { - a: { - attack: { - nt: Int, - it: [0], - }, - defense: { - nt: Int, - it: [0], - }, - hp: { - nt: Int, - it: [0], - }, - name: { - nt: String, - it: [1], - }, - type: { - nt: PokemonType, - it: [1], - }, - }, - // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. - }, - }, -} - const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { battles: { @@ -383,6 +353,36 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { }, } +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + addPokemon: { + a: { + attack: { + nt: Int, + it: [0], + }, + defense: { + nt: Int, + it: [0], + }, + hp: { + nt: Int, + it: [0], + }, + name: { + nt: String, + it: [1], + }, + type: { + nt: PokemonType, + it: [1], + }, + }, + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + }, +} + // // // @@ -416,7 +416,6 @@ CombatantSinglePokemon.f[`trainer`]!.nt = Trainer Pokemon.f[`trainer`]!.nt = Trainer Trainer.f[`fans`]!.nt = Patron Trainer.f[`pokemon`]!.nt = Pokemon -Mutation.f[`addPokemon`]!.nt = Pokemon Query.f[`battles`]!.nt = Battle Query.f[`beings`]!.nt = Being Query.f[`pokemon`]!.nt = Pokemon @@ -424,6 +423,7 @@ Query.f[`pokemonByName`]!.nt = Pokemon Query.f[`pokemons`]!.nt = Pokemon Query.f[`trainerByName`]!.nt = Trainer Query.f[`trainers`]!.nt = Trainer +Mutation.f[`addPokemon`]!.nt = Pokemon // // @@ -442,9 +442,9 @@ Query.f[`trainers`]!.nt = Trainer // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Mutation, - Query, + operations: { + query: Query, + mutation: Mutation, }, directives: {}, types: { @@ -470,8 +470,8 @@ const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { Trainer, Being, Battle, - Mutation, Query, + Mutation, }, } diff --git a/tests/_/schemas/pokemon/graffle/modules/Select.ts b/tests/_/schemas/pokemon/graffle/modules/Select.ts index 2789fc307..3833f714a 100644 --- a/tests/_/schemas/pokemon/graffle/modules/Select.ts +++ b/tests/_/schemas/pokemon/graffle/modules/Select.ts @@ -1,3 +1,4 @@ +import type { OperationTypeNode } from 'graphql' import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import * as Data from './Data.js' import type { Schema } from './Schema.js' @@ -38,16 +39,22 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Root< + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Operation< $SelectionSet, Schema, - 'Mutation' + OperationTypeNode.QUERY > - export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // OutputObject Types - // ------------------ + export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Operation< + $SelectionSet, + Schema, + OperationTypeNode.MUTATION + > + // OutputObject + // -------------------------------------------------------------------------------------------------- + // export type BattleRoyale<$SelectionSet extends SelectionSets.BattleRoyale> = InferResult.OutputObject< $SelectionSet, Schema, @@ -82,15 +89,17 @@ export namespace Select { Schema, Schema['allTypes']['Trainer'] > - // Union Types - // ----------- + // Union + // -------------------------------------------------------------------------------------------------- + // export type Battle<$SelectionSet extends SelectionSets.Battle> = InferResult.Union< $SelectionSet, Schema, Schema['allTypes']['Battle'] > - // Interface Types - // --------------- + // Interface + // -------------------------------------------------------------------------------------------------- + // export type Being<$SelectionSet extends SelectionSets.Being> = InferResult.Interface< $SelectionSet, Schema, diff --git a/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts b/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts index 128c0dfb9..9a10919eb 100644 --- a/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/pokemon/graffle/modules/SelectionSets.ts @@ -40,106 +40,9 @@ export interface $Document< // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- -// Mutation -// -------------------------------------------------------------------------------------------------- -// -// - -// ----------------------------------------| Entrypoint Interface | - -export interface Mutation< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> { - /** - * Select the `addPokemon` field on the `Mutation` object. Its type is `Pokemon` (a `OutputObject` kind of type). - */ - addPokemon?: Mutation.addPokemon<_$Scalars> | $Select.SelectAlias.SelectAlias> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Mutation$FragmentInline<_$Scalars> - | Mutation$FragmentInline<_$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Mutation$FragmentInline< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, -> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { -} - -// ----------------------------------------| Fields | - -export namespace Mutation { - export type addPokemon< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = addPokemon$SelectionSet<_$Scalars> - - export interface addPokemon$SelectionSet< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { - /** - * Arguments for `addPokemon` field. Some (2/5) arguments are required so you must include this. - */ - $: addPokemon$Arguments<_$Scalars> - } - - export interface addPokemon$Arguments< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > { - attack?: number | undefined | null - defense?: number | undefined | null - hp?: number | undefined | null - name: string - $type: $NamedTypes.$PokemonType - } - - // --- expanded --- - - /** - * This is the "expanded" version of the `addPokemon` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type addPokemon$Expanded< - _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, - > = $$Utilities.Simplify< - addPokemon$SelectionSet<_$Scalars> - > -} - -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -395,6 +298,87 @@ export namespace Query { > } +// Mutation +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * Select the `addPokemon` field on the `Mutation` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + addPokemon?: Mutation.addPokemon<_$Scalars> | $Select.SelectAlias.SelectAlias> + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Mutation$FragmentInline<_$Scalars> + | Mutation$FragmentInline<_$Scalars>[] + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> +} + +export interface Mutation$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Mutation { + export type addPokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = addPokemon$SelectionSet<_$Scalars> + + export interface addPokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { + /** + * Arguments for `addPokemon` field. Some (2/5) arguments are required so you must include this. + */ + $: addPokemon$Arguments<_$Scalars> + } + + export interface addPokemon$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + attack?: number | undefined | null + defense?: number | undefined | null + hp?: number | undefined | null + name: string + $type: $NamedTypes.$PokemonType + } + + // --- expanded --- + + /** + * This is the "expanded" version of the `addPokemon` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type addPokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + addPokemon$SelectionSet<_$Scalars> + > +} + // // // @@ -501,17 +485,9 @@ export interface StringFilter< // // -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // BattleRoyale // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -659,17 +635,9 @@ export namespace BattleRoyale { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // BattleTrainer // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -846,17 +814,9 @@ export namespace BattleTrainer { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // BattleWild // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -1058,17 +1018,9 @@ export namespace BattleWild { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // CombatantMultiPokemon // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -1162,17 +1114,9 @@ export namespace CombatantMultiPokemon { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // CombatantSinglePokemon // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -1265,17 +1209,9 @@ export namespace CombatantSinglePokemon { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Patron // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -1396,17 +1332,9 @@ export namespace Patron { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Pokemon // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -1667,17 +1595,9 @@ export namespace Pokemon { > } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Trainer // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | @@ -2011,11 +1931,11 @@ export namespace Being { * would end up with an error of `export interface Foo extends Foo ...` */ export namespace $NamedTypes { + export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Query<_$Scalars> export type $Mutation< _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, > = Mutation<_$Scalars> - export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = - Query<_$Scalars> export type $BattleWildResult = BattleWildResult export type $PokemonType = PokemonType export type $TrainerClass = TrainerClass diff --git a/tests/_/schemas/query-only/graffle/modules/Client.ts b/tests/_/schemas/query-only/graffle/modules/Client.ts index 5a25cf4ed..9080daf87 100644 --- a/tests/_/schemas/query-only/graffle/modules/Client.ts +++ b/tests/_/schemas/query-only/graffle/modules/Client.ts @@ -2,5 +2,4 @@ import { createPrefilled } from '../../../../../../src/entrypoints/client.js' import { defaultSchemaUrl } from './Data.js' import { Name } from './Data.js' import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) diff --git a/tests/_/schemas/query-only/graffle/modules/MethodsDocument.ts b/tests/_/schemas/query-only/graffle/modules/MethodsDocument.ts index ac1681bcf..f12a02bd5 100644 --- a/tests/_/schemas/query-only/graffle/modules/MethodsDocument.ts +++ b/tests/_/schemas/query-only/graffle/modules/MethodsDocument.ts @@ -1,7 +1,6 @@ import type * as Utilities from '../../../../../../src/entrypoints/utilities-for-generated.js' import type { Schema } from './Schema.js' import type * as SelectionSets from './SelectionSets.js' - export interface Document<$Context extends Utilities.ClientContext> { <$Document>( document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, diff --git a/tests/_/schemas/query-only/graffle/modules/MethodsRoot.ts b/tests/_/schemas/query-only/graffle/modules/MethodsRoot.ts index 3d0bc83dd..d9c12a74c 100644 --- a/tests/_/schemas/query-only/graffle/modules/MethodsRoot.ts +++ b/tests/_/schemas/query-only/graffle/modules/MethodsRoot.ts @@ -10,7 +10,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Query<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<$SelectionSet, Schema<$Context['scalars']>> > > > @@ -30,7 +30,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ id: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ id: $SelectionSet }, Schema<$Context['scalars']>>, 'id' > > @@ -42,7 +42,7 @@ export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, + InferResult.OperationQuery<{ idNonNull: $SelectionSet }, Schema<$Context['scalars']>>, 'idNonNull' > > diff --git a/tests/_/schemas/query-only/graffle/modules/Schema.ts b/tests/_/schemas/query-only/graffle/modules/Schema.ts index 16d6d27db..40cd45967 100644 --- a/tests/_/schemas/query-only/graffle/modules/Schema.ts +++ b/tests/_/schemas/query-only/graffle/modules/Schema.ts @@ -255,12 +255,12 @@ export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$ extends $ { name: Data.Name - RootTypesPresent: ['Query'] + operationsAvailable: ['query'] RootUnion: Schema.Query Root: { - Query: Schema.Query - Mutation: null - Subscription: null + query: Schema.Query + mutation: null + subscription: null } allTypes: { Query: Schema.Query diff --git a/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts b/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts index 6beade569..503ab65f0 100644 --- a/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts +++ b/tests/_/schemas/query-only/graffle/modules/SchemaDrivenDataMap.ts @@ -193,8 +193,8 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Query, + operations: { + query: Query, }, directives: {}, types: { diff --git a/tests/_/schemas/query-only/graffle/modules/Select.ts b/tests/_/schemas/query-only/graffle/modules/Select.ts index 879b049fa..74d06db5d 100644 --- a/tests/_/schemas/query-only/graffle/modules/Select.ts +++ b/tests/_/schemas/query-only/graffle/modules/Select.ts @@ -1,3 +1,4 @@ +import type { OperationTypeNode } from 'graphql' import type { InferResult } from '../../../../../../src/entrypoints/schema.js' import * as Data from './Data.js' import type { Schema } from './Schema.js' @@ -38,21 +39,23 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // OutputObject Types - // ------------------ - - // -- None -- - - // Union Types - // ----------- - - // -- None -- - - // Interface Types - // --------------- - - // -- None -- + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Operation< + $SelectionSet, + Schema, + OperationTypeNode.QUERY + > + // OutputObject + // -------------------------------------------------------------------------------------------------- + // + + // Union + // -------------------------------------------------------------------------------------------------- + // + + // Interface + // -------------------------------------------------------------------------------------------------- + // } diff --git a/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts b/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts index 65e6e6f93..db81450c9 100644 --- a/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts +++ b/tests/_/schemas/query-only/graffle/modules/SelectionSets.ts @@ -39,17 +39,9 @@ export interface $Document< // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | diff --git a/tests/e2e/e2e.test.ts b/tests/e2e/e2e.test.ts index 76bc1f939..5014ff094 100644 --- a/tests/e2e/e2e.test.ts +++ b/tests/e2e/e2e.test.ts @@ -24,18 +24,18 @@ test(`client works without generation`, async ({ project, pokemonService }) => { import { Graffle } from 'graffle' const graffle = Graffle.create({ schema: '${pokemonService.url.href}' }) const data = await graffle.gql\` - query ($name: String!) { - pokemonByName (name: $name) { - name - hp - attack - defense - trainer { - name - } - } - } - \`.send({ name: 'Pikachu' }) + query ($name: String!) { + pokemonByName (name: $name) { + name + hp + attack + defense + trainer { + name + } + } + } + \`.send({ name: 'Pikachu' }) console.log(data?.pokemonByName) `, ) diff --git a/website/content/_snippets/examples/extension/introspection.detail.md b/website/content/_snippets/examples/extension/introspection.detail.md index 15c9b734d..4f235ce15 100644 --- a/website/content/_snippets/examples/extension/introspection.detail.md +++ b/website/content/_snippets/examples/extension/introspection.detail.md @@ -19,6 +19,7 @@ console.log(data) ```txt { __schema: { + description: null, queryType: { name: 'Query' }, mutationType: { name: 'Mutation' }, subscriptionType: null, @@ -27,6 +28,8 @@ console.log(data) kind: 'UNION', name: 'Battle', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -41,6 +44,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleRoyale', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatants', @@ -96,6 +101,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleTrainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatant1', @@ -155,6 +162,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleWild', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'date', @@ -222,6 +231,8 @@ console.log(data) kind: 'ENUM', name: 'BattleWildResult', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -251,6 +262,8 @@ console.log(data) kind: 'INTERFACE', name: 'Being', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -282,6 +295,8 @@ console.log(data) kind: 'SCALAR', name: 'Boolean', description: 'The `Boolean` scalar type represents `true` or `false`.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -292,6 +307,8 @@ console.log(data) kind: 'OBJECT', name: 'CombatantMultiPokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemons', @@ -327,6 +344,8 @@ console.log(data) kind: 'OBJECT', name: 'CombatantSinglePokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemon', @@ -354,6 +373,8 @@ console.log(data) kind: 'SCALAR', name: 'Date', description: 'A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -364,19 +385,25 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'DateFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'gte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'lte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -387,6 +414,8 @@ console.log(data) kind: 'SCALAR', name: 'Float', description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -397,6 +426,8 @@ console.log(data) kind: 'SCALAR', name: 'ID', description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -407,6 +438,8 @@ console.log(data) kind: 'SCALAR', name: 'Int', description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -417,6 +450,8 @@ console.log(data) kind: 'OBJECT', name: 'Mutation', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'addPokemon', @@ -426,19 +461,25 @@ console.log(data) name: 'attack', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'defense', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'hp', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -448,7 +489,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'type', @@ -458,7 +501,9 @@ console.log(data) name: null, ofType: { kind: 'ENUM', name: 'PokemonType', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Pokemon', ofType: null }, @@ -475,6 +520,8 @@ console.log(data) kind: 'OBJECT', name: 'Patron', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -510,6 +557,8 @@ console.log(data) kind: 'OBJECT', name: 'Pokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'attack', @@ -585,13 +634,17 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'PokemonFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'birthday', description: null, type: { kind: 'INPUT_OBJECT', name: 'DateFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -601,7 +654,9 @@ console.log(data) name: 'StringFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -612,6 +667,8 @@ console.log(data) kind: 'ENUM', name: 'PokemonType', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -653,6 +710,8 @@ console.log(data) kind: 'OBJECT', name: 'Query', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'battles', @@ -722,7 +781,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -749,7 +810,9 @@ console.log(data) name: 'PokemonFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -776,7 +839,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Trainer', ofType: null }, @@ -809,6 +874,8 @@ console.log(data) kind: 'SCALAR', name: 'String', description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -819,13 +886,17 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'StringFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'contains', description: null, type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'in', @@ -839,7 +910,9 @@ console.log(data) ofType: { kind: 'SCALAR', name: 'String', ofType: null } } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -850,6 +923,8 @@ console.log(data) kind: 'OBJECT', name: 'Trainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'class', @@ -917,6 +992,8 @@ console.log(data) kind: 'ENUM', name: 'TrainerClass', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1008,6 +1085,8 @@ console.log(data) description: 'A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n' + '\n' + "In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1073,7 +1152,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1106,6 +1187,8 @@ console.log(data) kind: 'ENUM', name: '__DirectiveLocation', description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1231,6 +1314,8 @@ console.log(data) kind: 'OBJECT', name: '__EnumValue', description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1282,6 +1367,8 @@ console.log(data) kind: 'OBJECT', name: '__Field', description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1311,7 +1398,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1376,6 +1465,8 @@ console.log(data) kind: 'OBJECT', name: '__InputValue', description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1447,6 +1538,8 @@ console.log(data) kind: 'OBJECT', name: '__Schema', description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'description', @@ -1536,6 +1629,8 @@ console.log(data) description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n' + '\n' + 'Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'kind', @@ -1581,7 +1676,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1636,7 +1733,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1659,7 +1758,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1700,6 +1801,8 @@ console.log(data) kind: 'ENUM', name: '__TypeKind', description: 'An enum describing what kind of type a given `__Type` is.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1760,6 +1863,7 @@ console.log(data) { name: 'deprecated', description: 'Marks an element of a GraphQL schema as no longer supported.', + isRepeatable: false, locations: [ 'ARGUMENT_DEFINITION', 'ENUM_VALUE', @@ -1771,13 +1875,16 @@ console.log(data) name: 'reason', description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: '"No longer supported"' + defaultValue: '"No longer supported"', + isDeprecated: false, + deprecationReason: null } ] }, { name: 'include', description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1788,19 +1895,23 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'oneOf', description: 'Indicates exactly one field must be supplied and this field must not be `null`.', + isRepeatable: false, locations: [ 'INPUT_OBJECT' ], args: [] }, { name: 'skip', description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1811,13 +1922,16 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'specifiedBy', description: 'Exposes a URL that specifies the behavior of this scalar.', + isRepeatable: false, locations: [ 'SCALAR' ], args: [ { @@ -1828,7 +1942,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] } diff --git a/website/content/_snippets/examples/extension/introspection.md b/website/content/_snippets/examples/extension/introspection.md index 596d05535..72d868199 100644 --- a/website/content/_snippets/examples/extension/introspection.md +++ b/website/content/_snippets/examples/extension/introspection.md @@ -17,6 +17,7 @@ console.log(data) ```txt { __schema: { + description: null, queryType: { name: 'Query' }, mutationType: { name: 'Mutation' }, subscriptionType: null, @@ -25,6 +26,8 @@ console.log(data) kind: 'UNION', name: 'Battle', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -39,6 +42,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleRoyale', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatants', @@ -94,6 +99,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleTrainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatant1', @@ -153,6 +160,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleWild', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'date', @@ -220,6 +229,8 @@ console.log(data) kind: 'ENUM', name: 'BattleWildResult', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -249,6 +260,8 @@ console.log(data) kind: 'INTERFACE', name: 'Being', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -280,6 +293,8 @@ console.log(data) kind: 'SCALAR', name: 'Boolean', description: 'The `Boolean` scalar type represents `true` or `false`.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -290,6 +305,8 @@ console.log(data) kind: 'OBJECT', name: 'CombatantMultiPokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemons', @@ -325,6 +342,8 @@ console.log(data) kind: 'OBJECT', name: 'CombatantSinglePokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemon', @@ -352,6 +371,8 @@ console.log(data) kind: 'SCALAR', name: 'Date', description: 'A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -362,19 +383,25 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'DateFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'gte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'lte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -385,6 +412,8 @@ console.log(data) kind: 'SCALAR', name: 'Float', description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -395,6 +424,8 @@ console.log(data) kind: 'SCALAR', name: 'ID', description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -405,6 +436,8 @@ console.log(data) kind: 'SCALAR', name: 'Int', description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -415,6 +448,8 @@ console.log(data) kind: 'OBJECT', name: 'Mutation', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'addPokemon', @@ -424,19 +459,25 @@ console.log(data) name: 'attack', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'defense', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'hp', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -446,7 +487,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'type', @@ -456,7 +499,9 @@ console.log(data) name: null, ofType: { kind: 'ENUM', name: 'PokemonType', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Pokemon', ofType: null }, @@ -473,6 +518,8 @@ console.log(data) kind: 'OBJECT', name: 'Patron', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -508,6 +555,8 @@ console.log(data) kind: 'OBJECT', name: 'Pokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'attack', @@ -583,13 +632,17 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'PokemonFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'birthday', description: null, type: { kind: 'INPUT_OBJECT', name: 'DateFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -599,7 +652,9 @@ console.log(data) name: 'StringFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -610,6 +665,8 @@ console.log(data) kind: 'ENUM', name: 'PokemonType', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -651,6 +708,8 @@ console.log(data) kind: 'OBJECT', name: 'Query', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'battles', @@ -720,7 +779,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -747,7 +808,9 @@ console.log(data) name: 'PokemonFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -774,7 +837,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Trainer', ofType: null }, @@ -807,6 +872,8 @@ console.log(data) kind: 'SCALAR', name: 'String', description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -817,13 +884,17 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'StringFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'contains', description: null, type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'in', @@ -837,7 +908,9 @@ console.log(data) ofType: { kind: 'SCALAR', name: 'String', ofType: null } } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -848,6 +921,8 @@ console.log(data) kind: 'OBJECT', name: 'Trainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'class', @@ -915,6 +990,8 @@ console.log(data) kind: 'ENUM', name: 'TrainerClass', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1006,6 +1083,8 @@ console.log(data) description: 'A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n' + '\n' + "In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1071,7 +1150,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1104,6 +1185,8 @@ console.log(data) kind: 'ENUM', name: '__DirectiveLocation', description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1229,6 +1312,8 @@ console.log(data) kind: 'OBJECT', name: '__EnumValue', description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1280,6 +1365,8 @@ console.log(data) kind: 'OBJECT', name: '__Field', description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1309,7 +1396,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1374,6 +1463,8 @@ console.log(data) kind: 'OBJECT', name: '__InputValue', description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1445,6 +1536,8 @@ console.log(data) kind: 'OBJECT', name: '__Schema', description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'description', @@ -1534,6 +1627,8 @@ console.log(data) description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n' + '\n' + 'Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'kind', @@ -1579,7 +1674,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1634,7 +1731,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1657,7 +1756,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1698,6 +1799,8 @@ console.log(data) kind: 'ENUM', name: '__TypeKind', description: 'An enum describing what kind of type a given `__Type` is.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1758,6 +1861,7 @@ console.log(data) { name: 'deprecated', description: 'Marks an element of a GraphQL schema as no longer supported.', + isRepeatable: false, locations: [ 'ARGUMENT_DEFINITION', 'ENUM_VALUE', @@ -1769,13 +1873,16 @@ console.log(data) name: 'reason', description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: '"No longer supported"' + defaultValue: '"No longer supported"', + isDeprecated: false, + deprecationReason: null } ] }, { name: 'include', description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1786,19 +1893,23 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'oneOf', description: 'Indicates exactly one field must be supplied and this field must not be `null`.', + isRepeatable: false, locations: [ 'INPUT_OBJECT' ], args: [] }, { name: 'skip', description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1809,13 +1920,16 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'specifiedBy', description: 'Exposes a URL that specifies the behavior of this scalar.', + isRepeatable: false, locations: [ 'SCALAR' ], args: [ { @@ -1826,7 +1940,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] } diff --git a/website/content/_snippets/examples/extension/opentelemetry.detail.md b/website/content/_snippets/examples/extension/opentelemetry.detail.md index 8ae539afa..f33986547 100644 --- a/website/content/_snippets/examples/extension/opentelemetry.detail.md +++ b/website/content/_snippets/examples/extension/opentelemetry.detail.md @@ -37,14 +37,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'encode', - id: 'bb6b0c035e3cbc85', + id: '6165d2d039ddc330', kind: 0, - timestamp: 1729824584441000, - duration: 1365.042, + timestamp: 1730036847285000, + duration: 1356.625, attributes: {}, status: { code: 0 }, events: [], @@ -64,14 +64,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'pack', - id: '996cd2f8c264080a', + id: 'bb6311c736ff6b68', kind: 0, - timestamp: 1729824584444000, - duration: 12774.667, + timestamp: 1730036847288000, + duration: 12403.5, attributes: {}, status: { code: 0 }, events: [], @@ -91,14 +91,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'exchange', - id: '3ad972c399fb8ec2', + id: 'd20f5ebfbc8710b0', kind: 0, - timestamp: 1729824584458000, - duration: 21008.167, + timestamp: 1730036847301000, + duration: 24152.959, attributes: {}, status: { code: 0 }, events: [], @@ -118,14 +118,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'unpack', - id: 'bbdb7c3156b126e9', + id: 'b16337bf48d7aa8a', kind: 0, - timestamp: 1729824584479000, - duration: 1927.291, + timestamp: 1730036847325000, + duration: 1765.417, attributes: {}, status: { code: 0 }, events: [], @@ -145,14 +145,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'decode', - id: 'e311421c9b0a3a5d', + id: 'd1716e5187f9ee3c', kind: 0, - timestamp: 1729824584481000, - duration: 221.916, + timestamp: 1730036847327000, + duration: 219.459, attributes: {}, status: { code: 0 }, events: [], @@ -172,14 +172,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', + traceId: '384833e31759d7c8c990afcdc091163c', parentId: undefined, traceState: undefined, name: 'request', - id: 'f1eb7799e82ca59a', + id: '02ea45a5cb1a818f', kind: 0, - timestamp: 1729824584440000, - duration: 40916.625, + timestamp: 1730036847284000, + duration: 43532.666, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/_snippets/examples/extension/opentelemetry.md b/website/content/_snippets/examples/extension/opentelemetry.md index 7b1ea8cf3..245d9d3ee 100644 --- a/website/content/_snippets/examples/extension/opentelemetry.md +++ b/website/content/_snippets/examples/extension/opentelemetry.md @@ -35,14 +35,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'encode', - id: 'bb6b0c035e3cbc85', + id: '6165d2d039ddc330', kind: 0, - timestamp: 1729824584441000, - duration: 1365.042, + timestamp: 1730036847285000, + duration: 1356.625, attributes: {}, status: { code: 0 }, events: [], @@ -62,14 +62,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'pack', - id: '996cd2f8c264080a', + id: 'bb6311c736ff6b68', kind: 0, - timestamp: 1729824584444000, - duration: 12774.667, + timestamp: 1730036847288000, + duration: 12403.5, attributes: {}, status: { code: 0 }, events: [], @@ -89,14 +89,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'exchange', - id: '3ad972c399fb8ec2', + id: 'd20f5ebfbc8710b0', kind: 0, - timestamp: 1729824584458000, - duration: 21008.167, + timestamp: 1730036847301000, + duration: 24152.959, attributes: {}, status: { code: 0 }, events: [], @@ -116,14 +116,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'unpack', - id: 'bbdb7c3156b126e9', + id: 'b16337bf48d7aa8a', kind: 0, - timestamp: 1729824584479000, - duration: 1927.291, + timestamp: 1730036847325000, + duration: 1765.417, attributes: {}, status: { code: 0 }, events: [], @@ -143,14 +143,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'decode', - id: 'e311421c9b0a3a5d', + id: 'd1716e5187f9ee3c', kind: 0, - timestamp: 1729824584481000, - duration: 221.916, + timestamp: 1730036847327000, + duration: 219.459, attributes: {}, status: { code: 0 }, events: [], @@ -170,14 +170,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', + traceId: '384833e31759d7c8c990afcdc091163c', parentId: undefined, traceState: undefined, name: 'request', - id: 'f1eb7799e82ca59a', + id: '02ea45a5cb1a818f', kind: 0, - timestamp: 1729824584440000, - duration: 40916.625, + timestamp: 1730036847284000, + duration: 43532.666, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/content/_snippets/examples/output/envelope.detail.md b/website/content/_snippets/examples/output/envelope.detail.md index 5c1b6955d..64d16428c 100644 --- a/website/content/_snippets/examples/output/envelope.detail.md +++ b/website/content/_snippets/examples/output/envelope.detail.md @@ -38,7 +38,7 @@ console.log(result) headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Fri, 25 Oct 2024 02:49:44 GMT', + date: 'Sun, 27 Oct 2024 13:47:26 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/_snippets/examples/output/envelope.md b/website/content/_snippets/examples/output/envelope.md index a02f376f9..0a284ce84 100644 --- a/website/content/_snippets/examples/output/envelope.md +++ b/website/content/_snippets/examples/output/envelope.md @@ -36,7 +36,7 @@ console.log(result) headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Fri, 25 Oct 2024 02:49:44 GMT', + date: 'Sun, 27 Oct 2024 13:47:26 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md b/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md index 9ee3b7b05..ab6ebf6ae 100644 --- a/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md +++ b/website/content/_snippets/examples/transport-http/dynamic-headers.detail.md @@ -38,7 +38,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729824583010' + 'x-sent-at-time': '1730036844970' }, signal: undefined, method: 'post', diff --git a/website/content/_snippets/examples/transport-http/dynamic-headers.md b/website/content/_snippets/examples/transport-http/dynamic-headers.md index f23f94867..b3a146e68 100644 --- a/website/content/_snippets/examples/transport-http/dynamic-headers.md +++ b/website/content/_snippets/examples/transport-http/dynamic-headers.md @@ -36,7 +36,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729824583010' + 'x-sent-at-time': '1730036844970' }, signal: undefined, method: 'post', diff --git a/website/content/examples/10_transport-http/dynamic-headers.md b/website/content/examples/10_transport-http/dynamic-headers.md index 292ef6f5e..48c0e6213 100644 --- a/website/content/examples/10_transport-http/dynamic-headers.md +++ b/website/content/examples/10_transport-http/dynamic-headers.md @@ -43,7 +43,7 @@ await graffle.gql`{ pokemons { name } }`.send() headers: Headers { accept: 'application/graphql-response+json; charset=utf-8, application/json; charset=utf-8', 'content-type': 'application/json', - 'x-sent-at-time': '1729824583010' + 'x-sent-at-time': '1730036844970' }, signal: undefined, method: 'post', diff --git a/website/content/examples/20_output/envelope.md b/website/content/examples/20_output/envelope.md index e164f120a..17942e45f 100644 --- a/website/content/examples/20_output/envelope.md +++ b/website/content/examples/20_output/envelope.md @@ -43,7 +43,7 @@ console.log(result) headers: Headers { 'content-type': 'application/graphql-response+json; charset=utf-8', 'content-length': '142', - date: 'Fri, 25 Oct 2024 02:49:44 GMT', + date: 'Sun, 27 Oct 2024 13:47:26 GMT', connection: 'keep-alive', 'keep-alive': 'timeout=5' }, diff --git a/website/content/examples/60_extension/introspection.md b/website/content/examples/60_extension/introspection.md index 34869410e..c8b664d0c 100644 --- a/website/content/examples/60_extension/introspection.md +++ b/website/content/examples/60_extension/introspection.md @@ -24,6 +24,7 @@ console.log(data) ```txt { __schema: { + description: null, queryType: { name: 'Query' }, mutationType: { name: 'Mutation' }, subscriptionType: null, @@ -32,6 +33,8 @@ console.log(data) kind: 'UNION', name: 'Battle', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -46,6 +49,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleRoyale', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatants', @@ -101,6 +106,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleTrainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'combatant1', @@ -160,6 +167,8 @@ console.log(data) kind: 'OBJECT', name: 'BattleWild', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'date', @@ -227,6 +236,8 @@ console.log(data) kind: 'ENUM', name: 'BattleWildResult', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -256,6 +267,8 @@ console.log(data) kind: 'INTERFACE', name: 'Being', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -287,6 +300,8 @@ console.log(data) kind: 'SCALAR', name: 'Boolean', description: 'The `Boolean` scalar type represents `true` or `false`.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -297,6 +312,8 @@ console.log(data) kind: 'OBJECT', name: 'CombatantMultiPokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemons', @@ -332,6 +349,8 @@ console.log(data) kind: 'OBJECT', name: 'CombatantSinglePokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'pokemon', @@ -359,6 +378,8 @@ console.log(data) kind: 'SCALAR', name: 'Date', description: 'A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.This scalar is serialized to a string in ISO 8601 format and parsed from a string in ISO 8601 format.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -369,19 +390,25 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'DateFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'gte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'lte', description: null, type: { kind: 'SCALAR', name: 'Date', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -392,6 +419,8 @@ console.log(data) kind: 'SCALAR', name: 'Float', description: 'The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -402,6 +431,8 @@ console.log(data) kind: 'SCALAR', name: 'ID', description: 'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -412,6 +443,8 @@ console.log(data) kind: 'SCALAR', name: 'Int', description: 'The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -422,6 +455,8 @@ console.log(data) kind: 'OBJECT', name: 'Mutation', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'addPokemon', @@ -431,19 +466,25 @@ console.log(data) name: 'attack', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'defense', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'hp', description: null, type: { kind: 'SCALAR', name: 'Int', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -453,7 +494,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'type', @@ -463,7 +506,9 @@ console.log(data) name: null, ofType: { kind: 'ENUM', name: 'PokemonType', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Pokemon', ofType: null }, @@ -480,6 +525,8 @@ console.log(data) kind: 'OBJECT', name: 'Patron', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'id', @@ -515,6 +562,8 @@ console.log(data) kind: 'OBJECT', name: 'Pokemon', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'attack', @@ -590,13 +639,17 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'PokemonFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'birthday', description: null, type: { kind: 'INPUT_OBJECT', name: 'DateFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'name', @@ -606,7 +659,9 @@ console.log(data) name: 'StringFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -617,6 +672,8 @@ console.log(data) kind: 'ENUM', name: 'PokemonType', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -658,6 +715,8 @@ console.log(data) kind: 'OBJECT', name: 'Query', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'battles', @@ -727,7 +786,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -754,7 +815,9 @@ console.log(data) name: 'PokemonFilter', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { @@ -781,7 +844,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], type: { kind: 'OBJECT', name: 'Trainer', ofType: null }, @@ -814,6 +879,8 @@ console.log(data) kind: 'SCALAR', name: 'String', description: 'The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -824,13 +891,17 @@ console.log(data) kind: 'INPUT_OBJECT', name: 'StringFilter', description: null, + specifiedByURL: null, + isOneOf: false, fields: null, inputFields: [ { name: 'contains', description: null, type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null }, { name: 'in', @@ -844,7 +915,9 @@ console.log(data) ofType: { kind: 'SCALAR', name: 'String', ofType: null } } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ], interfaces: null, @@ -855,6 +928,8 @@ console.log(data) kind: 'OBJECT', name: 'Trainer', description: null, + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'class', @@ -922,6 +997,8 @@ console.log(data) kind: 'ENUM', name: 'TrainerClass', description: null, + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1013,6 +1090,8 @@ console.log(data) description: 'A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n' + '\n' + "In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1078,7 +1157,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1111,6 +1192,8 @@ console.log(data) kind: 'ENUM', name: '__DirectiveLocation', description: 'A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1236,6 +1319,8 @@ console.log(data) kind: 'OBJECT', name: '__EnumValue', description: 'One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1287,6 +1372,8 @@ console.log(data) kind: 'OBJECT', name: '__Field', description: 'Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1316,7 +1403,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1381,6 +1470,8 @@ console.log(data) kind: 'OBJECT', name: '__InputValue', description: 'Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'name', @@ -1452,6 +1543,8 @@ console.log(data) kind: 'OBJECT', name: '__Schema', description: 'A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'description', @@ -1541,6 +1634,8 @@ console.log(data) description: 'The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n' + '\n' + 'Depending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.', + specifiedByURL: null, + isOneOf: null, fields: [ { name: 'kind', @@ -1586,7 +1681,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1641,7 +1738,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1664,7 +1763,9 @@ console.log(data) name: 'includeDeprecated', description: null, type: { kind: 'SCALAR', name: 'Boolean', ofType: null }, - defaultValue: 'false' + defaultValue: 'false', + isDeprecated: false, + deprecationReason: null } ], type: { @@ -1705,6 +1806,8 @@ console.log(data) kind: 'ENUM', name: '__TypeKind', description: 'An enum describing what kind of type a given `__Type` is.', + specifiedByURL: null, + isOneOf: null, fields: null, inputFields: null, interfaces: null, @@ -1765,6 +1868,7 @@ console.log(data) { name: 'deprecated', description: 'Marks an element of a GraphQL schema as no longer supported.', + isRepeatable: false, locations: [ 'ARGUMENT_DEFINITION', 'ENUM_VALUE', @@ -1776,13 +1880,16 @@ console.log(data) name: 'reason', description: 'Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).', type: { kind: 'SCALAR', name: 'String', ofType: null }, - defaultValue: '"No longer supported"' + defaultValue: '"No longer supported"', + isDeprecated: false, + deprecationReason: null } ] }, { name: 'include', description: 'Directs the executor to include this field or fragment only when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1793,19 +1900,23 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'oneOf', description: 'Indicates exactly one field must be supplied and this field must not be `null`.', + isRepeatable: false, locations: [ 'INPUT_OBJECT' ], args: [] }, { name: 'skip', description: 'Directs the executor to skip this field or fragment when the `if` argument is true.', + isRepeatable: false, locations: [ 'FIELD', 'FRAGMENT_SPREAD', 'INLINE_FRAGMENT' ], args: [ { @@ -1816,13 +1927,16 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'Boolean', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] }, { name: 'specifiedBy', description: 'Exposes a URL that specifies the behavior of this scalar.', + isRepeatable: false, locations: [ 'SCALAR' ], args: [ { @@ -1833,7 +1947,9 @@ console.log(data) name: null, ofType: { kind: 'SCALAR', name: 'String', ofType: null } }, - defaultValue: null + defaultValue: null, + isDeprecated: false, + deprecationReason: null } ] } diff --git a/website/content/examples/60_extension/opentelemetry.md b/website/content/examples/60_extension/opentelemetry.md index 8d567328c..611cde810 100644 --- a/website/content/examples/60_extension/opentelemetry.md +++ b/website/content/examples/60_extension/opentelemetry.md @@ -40,14 +40,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'encode', - id: 'bb6b0c035e3cbc85', + id: '6165d2d039ddc330', kind: 0, - timestamp: 1729824584441000, - duration: 1365.042, + timestamp: 1730036847285000, + duration: 1356.625, attributes: {}, status: { code: 0 }, events: [], @@ -67,14 +67,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'pack', - id: '996cd2f8c264080a', + id: 'bb6311c736ff6b68', kind: 0, - timestamp: 1729824584444000, - duration: 12774.667, + timestamp: 1730036847288000, + duration: 12403.5, attributes: {}, status: { code: 0 }, events: [], @@ -94,14 +94,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'exchange', - id: '3ad972c399fb8ec2', + id: 'd20f5ebfbc8710b0', kind: 0, - timestamp: 1729824584458000, - duration: 21008.167, + timestamp: 1730036847301000, + duration: 24152.959, attributes: {}, status: { code: 0 }, events: [], @@ -121,14 +121,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'unpack', - id: 'bbdb7c3156b126e9', + id: 'b16337bf48d7aa8a', kind: 0, - timestamp: 1729824584479000, - duration: 1927.291, + timestamp: 1730036847325000, + duration: 1765.417, attributes: {}, status: { code: 0 }, events: [], @@ -148,14 +148,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', - parentId: 'f1eb7799e82ca59a', + traceId: '384833e31759d7c8c990afcdc091163c', + parentId: '02ea45a5cb1a818f', traceState: undefined, name: 'decode', - id: 'e311421c9b0a3a5d', + id: 'd1716e5187f9ee3c', kind: 0, - timestamp: 1729824584481000, - duration: 221.916, + timestamp: 1730036847327000, + duration: 219.459, attributes: {}, status: { code: 0 }, events: [], @@ -175,14 +175,14 @@ console.log(data) } }, instrumentationScope: { name: 'graffle', version: undefined, schemaUrl: undefined }, - traceId: '3b96fa441684458a1d46a660a7980d58', + traceId: '384833e31759d7c8c990afcdc091163c', parentId: undefined, traceState: undefined, name: 'request', - id: 'f1eb7799e82ca59a', + id: '02ea45a5cb1a818f', kind: 0, - timestamp: 1729824584440000, - duration: 40916.625, + timestamp: 1730036847284000, + duration: 43532.666, attributes: {}, status: { code: 0 }, events: [], diff --git a/website/graffle/_.ts b/website/graffle/_.ts index d27e9e3d3..dbebc63cb 100644 --- a/website/graffle/_.ts +++ b/website/graffle/_.ts @@ -2,9 +2,9 @@ // It at least helps with Twoslash wherein without this import here Twoslash will not include the global module. // In real TypeScript projects it seems the global module is included automatically. But there could be certain tsconfig // setups where this still indeed does help. -import './modules/Global.js' +import "./modules/Global.js"; -export { create } from './modules/Client.js' -export { schemaDrivenDataMap } from './modules/SchemaDrivenDataMap.js' -export { Select } from './modules/Select.js' -export * as SelectionSets from './modules/SelectionSets.js' +export { create } from "./modules/Client.js"; +export { schemaDrivenDataMap } from "./modules/SchemaDrivenDataMap.js"; +export { Select } from "./modules/Select.js"; +export * as SelectionSets from "./modules/SelectionSets.js"; diff --git a/website/graffle/__.ts b/website/graffle/__.ts index 4fba9ada3..558fffc52 100644 --- a/website/graffle/__.ts +++ b/website/graffle/__.ts @@ -1 +1 @@ -export * as Graffle from './_.js' +export * as Graffle from "./_.js"; diff --git a/website/graffle/modules/Client.ts b/website/graffle/modules/Client.ts index d6d0b8bf6..b8c827873 100644 --- a/website/graffle/modules/Client.ts +++ b/website/graffle/modules/Client.ts @@ -1,6 +1,5 @@ -import { createPrefilled } from 'graffle/client' -import { defaultSchemaUrl } from './Data.js' -import { Name } from './Data.js' -import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - -export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) +import { createPrefilled } from "graffle/client"; +import { defaultSchemaUrl } from "./Data.js"; +import { Name } from "./Data.js"; +import { schemaDrivenDataMap } from "./SchemaDrivenDataMap.js"; +export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl); diff --git a/website/graffle/modules/Data.ts b/website/graffle/modules/Data.ts index ef2ad4cf6..d6d22530d 100644 --- a/website/graffle/modules/Data.ts +++ b/website/graffle/modules/Data.ts @@ -1,4 +1,4 @@ -export const Name = `default` -export type Name = 'default' +export const Name = `default`; +export type Name = "default"; -export const defaultSchemaUrl = undefined +export const defaultSchemaUrl = undefined; diff --git a/website/graffle/modules/Global.ts b/website/graffle/modules/Global.ts index 5e242e36f..89ac0455b 100644 --- a/website/graffle/modules/Global.ts +++ b/website/graffle/modules/Global.ts @@ -1,22 +1,22 @@ -import type * as Data from './Data.js' -import type * as MethodsDocument from './MethodsDocument.js' -import type * as MethodsRoot from './MethodsRoot.js' -import type * as MethodsSelect from './MethodsSelect.js' -import type { Schema } from './Schema.js' +import type * as Data from "./Data.js"; +import type * as MethodsDocument from "./MethodsDocument.js"; +import type * as MethodsRoot from "./MethodsRoot.js"; +import type * as MethodsSelect from "./MethodsSelect.js"; +import type { Schema } from "./Schema.js"; declare global { export namespace GraffleGlobal { export interface Clients { default: { - name: Data.Name - schema: Schema + name: Data.Name; + schema: Schema; interfaces: { - MethodsSelect: MethodsSelect.$MethodsSelect - Document: MethodsDocument.BuilderMethodsDocumentFn - Root: MethodsRoot.BuilderMethodsRootFn - } - defaultSchemaUrl: null - } + MethodsSelect: MethodsSelect.$MethodsSelect; + Document: MethodsDocument.BuilderMethodsDocumentFn; + Root: MethodsRoot.BuilderMethodsRootFn; + }; + defaultSchemaUrl: null; + }; } } } diff --git a/website/graffle/modules/MethodsDocument.ts b/website/graffle/modules/MethodsDocument.ts index 469191c77..f0f74d3c9 100644 --- a/website/graffle/modules/MethodsDocument.ts +++ b/website/graffle/modules/MethodsDocument.ts @@ -1,20 +1,19 @@ -import type * as Utilities from 'graffle/utilities-for-generated' -import type { Schema } from './Schema.js' -import type * as SelectionSets from './SelectionSets.js' - +import type * as Utilities from "graffle/utilities-for-generated"; +import type { Schema } from "./Schema.js"; +import type * as SelectionSets from "./SelectionSets.js"; export interface Document<$Context extends Utilities.ClientContext> { <$Document>( - document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, + document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context["scalars"]>>, ): Utilities.DocumentRunner< $Context, Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as // Satisfying the constraint on the DocumentRunner type. $Document - > + >; } export interface BuilderMethodsDocumentFn extends Utilities.TypeFunction.Fn { // @ts-expect-error parameter is Untyped. - return: Document + return: Document; } diff --git a/website/graffle/modules/MethodsRoot.ts b/website/graffle/modules/MethodsRoot.ts index 76601950d..f30c97215 100644 --- a/website/graffle/modules/MethodsRoot.ts +++ b/website/graffle/modules/MethodsRoot.ts @@ -1,102 +1,107 @@ -import type { InferResult } from 'graffle/schema' -import type * as $$Utilities from 'graffle/utilities-for-generated' -import { type Simplify } from 'type-fest' -import type { Schema } from './Schema.js' -import type * as SelectionSet from './SelectionSets.js' +import type { InferResult } from "graffle/schema"; +import type * as $$Utilities from "graffle/utilities-for-generated"; +import type { Schema } from "./Schema.js"; +import type * as SelectionSet from "./SelectionSets.js"; export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $batch: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Query<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<$SelectionSet, Schema<$Context["scalars"]>> > > - > + >; __typename: () => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - { __typename: 'Query' }, - '__typename' + { __typename: "Query" }, + "__typename" > > - > + >; + continent: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.continent<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.continent<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ continent: $SelectionSet }, Schema<$Context['scalars']>>, - 'continent' + InferResult.OperationQuery<{ continent: $SelectionSet }, Schema<$Context["scalars"]>>, + "continent" > > - > + >; + continents: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.continents<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.continents<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ continents: $SelectionSet }, Schema<$Context['scalars']>>, - 'continents' + InferResult.OperationQuery<{ continents: $SelectionSet }, Schema<$Context["scalars"]>>, + "continents" > > - > + >; + countries: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.countries<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.countries<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ countries: $SelectionSet }, Schema<$Context['scalars']>>, - 'countries' + InferResult.OperationQuery<{ countries: $SelectionSet }, Schema<$Context["scalars"]>>, + "countries" > > - > + >; + country: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.country<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.country<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ country: $SelectionSet }, Schema<$Context['scalars']>>, - 'country' + InferResult.OperationQuery<{ country: $SelectionSet }, Schema<$Context["scalars"]>>, + "country" > > - > + >; + language: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.language<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.language<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ language: $SelectionSet }, Schema<$Context['scalars']>>, - 'language' + InferResult.OperationQuery<{ language: $SelectionSet }, Schema<$Context["scalars"]>>, + "language" > > - > + >; + languages: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.languages<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.languages<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ languages: $SelectionSet }, Schema<$Context['scalars']>>, - 'languages' + InferResult.OperationQuery<{ languages: $SelectionSet }, Schema<$Context["scalars"]>>, + "languages" > > - > + >; } export interface BuilderMethodsRoot<$Context extends $$Utilities.ClientContext> { - query: QueryMethods<$Context> + query: QueryMethods<$Context>; } export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction.Fn { // @ts-expect-error parameter is Untyped. - return: BuilderMethodsRoot + return: BuilderMethodsRoot; } diff --git a/website/graffle/modules/MethodsSelect.ts b/website/graffle/modules/MethodsSelect.ts index 35ba5869e..ed90d373f 100644 --- a/website/graffle/modules/MethodsSelect.ts +++ b/website/graffle/modules/MethodsSelect.ts @@ -1,5 +1,5 @@ -import type * as $Utilities from 'graffle/utilities-for-generated' -import type * as $SelectionSets from './SelectionSets.js' +import type * as $Utilities from "graffle/utilities-for-generated"; +import type * as $SelectionSets from "./SelectionSets.js"; // // @@ -18,12 +18,12 @@ import type * as $SelectionSets from './SelectionSets.js' // export interface $MethodsSelect { - Query: Query - Continent: Continent - Country: Country - Language: Language - State: State - Subdivision: Subdivision + Query: Query; + Continent: Continent; + Country: Country; + Language: Language; + State: State; + Subdivision: Subdivision; } // @@ -43,7 +43,7 @@ export interface $MethodsSelect { // export interface Query { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet; } // @@ -63,23 +63,23 @@ export interface Query { // export interface Continent { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Continent>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Continent>): $SelectionSet; } export interface Country { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Country>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Country>): $SelectionSet; } export interface Language { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Language>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Language>): $SelectionSet; } export interface State { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.State>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.State>): $SelectionSet; } export interface Subdivision { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Subdivision>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Subdivision>): $SelectionSet; } // diff --git a/website/graffle/modules/Scalar.ts b/website/graffle/modules/Scalar.ts index 98c8e1666..8ec8e232e 100644 --- a/website/graffle/modules/Scalar.ts +++ b/website/graffle/modules/Scalar.ts @@ -1,3 +1,3 @@ -import type * as $$Utilities from 'graffle/utilities-for-generated' +import type * as $$Utilities from "graffle/utilities-for-generated"; -export * from 'graffle/generator-helpers/standard-scalar-types' +export * from "graffle/generator-helpers/standard-scalar-types"; diff --git a/website/graffle/modules/Schema.ts b/website/graffle/modules/Schema.ts index 4ca689c19..0a9728721 100644 --- a/website/graffle/modules/Schema.ts +++ b/website/graffle/modules/Schema.ts @@ -1,8 +1,8 @@ -import type { Schema as $ } from 'graffle/utilities-for-generated' -import type * as $$Utilities from 'graffle/utilities-for-generated' -import type * as Data from './Data.js' -import type * as MethodsRoot from './MethodsRoot.js' -import type * as $Scalar from './Scalar.js' +import type { Schema as $ } from "graffle/utilities-for-generated"; +import type * as $$Utilities from "graffle/utilities-for-generated"; +import type * as Data from "./Data.js"; +import type * as $Scalar from "./Scalar.js"; + export namespace Schema { // // @@ -20,50 +20,118 @@ export namespace Schema { // // - export type Query = $.StandardTypes.Query<{ - continent: $.OutputField< - 'continent', - $.Nullable, - $.Args<{ - code: $.InputField<$Scalar.ID> - }, false> - > - continents: $.OutputField< - 'continents', - $.List, - $.Args<{ - filter: $.InputField<$.Nullable> - }, true> - > - countries: $.OutputField< - 'countries', - $.List, - $.Args<{ - filter: $.InputField<$.Nullable> - }, true> - > - country: $.OutputField< - 'country', - $.Nullable, - $.Args<{ - code: $.InputField<$Scalar.ID> - }, false> - > - language: $.OutputField< - 'language', - $.Nullable, - $.Args<{ - code: $.InputField<$Scalar.ID> - }, false> - > - languages: $.OutputField< - 'languages', - $.List, - $.Args<{ - filter: $.InputField<$.Nullable> - }, true> - > - }> + // Query + // -------------------------------------------------------------------------------------------------- + // + + export interface Query extends $.OutputObject { + name: "Query"; + fields: { + __typename: Query.__typename; + continent: Query.continent; + continents: Query.continents; + countries: Query.countries; + country: Query.country; + language: Query.language; + languages: Query.languages; + }; + } + + export namespace Query { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Query"; + }; + } + + export interface continent extends $.OutputField { + name: "continent"; + arguments: { + code: { + kind: "InputField"; + name: "code"; + inlineType: [1]; + namedType: $$NamedTypes.$$ID; + }; + }; + inlineType: [0]; + namedType: $$NamedTypes.$$Continent; + } + + export interface continents extends $.OutputField { + name: "continents"; + arguments: { + filter: { + kind: "InputField"; + name: "filter"; + inlineType: [0]; + namedType: $$NamedTypes.$$ContinentFilterInput; + }; + }; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Continent; + } + + export interface countries extends $.OutputField { + name: "countries"; + arguments: { + filter: { + kind: "InputField"; + name: "filter"; + inlineType: [0]; + namedType: $$NamedTypes.$$CountryFilterInput; + }; + }; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Country; + } + + export interface country extends $.OutputField { + name: "country"; + arguments: { + code: { + kind: "InputField"; + name: "code"; + inlineType: [1]; + namedType: $$NamedTypes.$$ID; + }; + }; + inlineType: [0]; + namedType: $$NamedTypes.$$Country; + } + + export interface language extends $.OutputField { + name: "language"; + arguments: { + code: { + kind: "InputField"; + name: "code"; + inlineType: [1]; + namedType: $$NamedTypes.$$ID; + }; + }; + inlineType: [0]; + namedType: $$NamedTypes.$$Language; + } + + export interface languages extends $.OutputField { + name: "languages"; + arguments: { + filter: { + kind: "InputField"; + name: "filter"; + inlineType: [0]; + namedType: $$NamedTypes.$$LanguageFilterInput; + }; + }; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Language; + } + } // // @@ -81,54 +149,351 @@ export namespace Schema { // // - export type Continent = $.OutputObject<'Continent', { - code: $.OutputField<'code', $Scalar.ID, null> - countries: $.OutputField<'countries', $.List, null> - name: $.OutputField<'name', $Scalar.String, null> - }> + // Continent + // -------------------------------------------------------------------------------------------------- + // + + export interface Continent extends $.OutputObject { + name: "Continent"; + fields: { + __typename: Continent.__typename; + code: Continent.code; + countries: Continent.countries; + name: Continent.name; + }; + } + + export namespace Continent { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Continent"; + }; + } + + export interface code extends $.OutputField { + name: "code"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$ID; + } + + export interface countries extends $.OutputField { + name: "countries"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Country; + } + + export interface name extends $.OutputField { + name: "name"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + } + + // Country + // -------------------------------------------------------------------------------------------------- + // + + export interface Country extends $.OutputObject { + name: "Country"; + fields: { + __typename: Country.__typename; + awsRegion: Country.awsRegion; + capital: Country.capital; + code: Country.code; + continent: Country.continent; + currencies: Country.currencies; + currency: Country.currency; + emoji: Country.emoji; + emojiU: Country.emojiU; + languages: Country.languages; + name: Country.name; + native: Country.native; + phone: Country.phone; + phones: Country.phones; + states: Country.states; + subdivisions: Country.subdivisions; + }; + } + + export namespace Country { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Country"; + }; + } + + export interface awsRegion extends $.OutputField { + name: "awsRegion"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface capital extends $.OutputField { + name: "capital"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } + + export interface code extends $.OutputField { + name: "code"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$ID; + } + + export interface continent extends $.OutputField { + name: "continent"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$Continent; + } + + export interface currencies extends $.OutputField { + name: "currencies"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$String; + } + + export interface currency extends $.OutputField { + name: "currency"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } + + export interface emoji extends $.OutputField { + name: "emoji"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface emojiU extends $.OutputField { + name: "emojiU"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface languages extends $.OutputField { + name: "languages"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Language; + } + + export interface name extends $.OutputField { + name: "name"; + arguments: { + lang: { + kind: "InputField"; + name: "lang"; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + }; + }; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface native extends $.OutputField { + name: "native"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface phone extends $.OutputField { + name: "phone"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface phones extends $.OutputField { + name: "phones"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$String; + } + + export interface states extends $.OutputField { + name: "states"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$State; + } + + export interface subdivisions extends $.OutputField { + name: "subdivisions"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Subdivision; + } + } + + // Language + // -------------------------------------------------------------------------------------------------- + // + + export interface Language extends $.OutputObject { + name: "Language"; + fields: { + __typename: Language.__typename; + code: Language.code; + name: Language.name; + native: Language.native; + rtl: Language.rtl; + }; + } + + export namespace Language { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Language"; + }; + } + + export interface code extends $.OutputField { + name: "code"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$ID; + } + + export interface name extends $.OutputField { + name: "name"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface native extends $.OutputField { + name: "native"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + + export interface rtl extends $.OutputField { + name: "rtl"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$Boolean; + } + } + + // State + // -------------------------------------------------------------------------------------------------- + // + + export interface State extends $.OutputObject { + name: "State"; + fields: { + __typename: State.__typename; + code: State.code; + country: State.country; + name: State.name; + }; + } + + export namespace State { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "State"; + }; + } + + export interface code extends $.OutputField { + name: "code"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } + + export interface country extends $.OutputField { + name: "country"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$Country; + } + + export interface name extends $.OutputField { + name: "name"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + } + + // Subdivision + // -------------------------------------------------------------------------------------------------- + // + + export interface Subdivision extends $.OutputObject { + name: "Subdivision"; + fields: { + __typename: Subdivision.__typename; + code: Subdivision.code; + emoji: Subdivision.emoji; + name: Subdivision.name; + }; + } - 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, 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, null> - subdivisions: $.OutputField<'subdivisions', $.List, null> - }> + export namespace Subdivision { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Subdivision"; + }; + } - 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 interface code extends $.OutputField { + name: "code"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$ID; + } - export type State = $.OutputObject<'State', { - code: $.OutputField<'code', $.Nullable<$Scalar.String>, null> - country: $.OutputField<'country', Country, null> - name: $.OutputField<'name', $Scalar.String, null> - }> + export interface emoji extends $.OutputField { + name: "emoji"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } - export type Subdivision = $.OutputObject<'Subdivision', { - code: $.OutputField<'code', $Scalar.ID, null> - emoji: $.OutputField<'emoji', $.Nullable<$Scalar.String>, null> - name: $.OutputField<'name', $Scalar.String, null> - }> + export interface name extends $.OutputField { + name: "name"; + arguments: {}; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + } + } // // @@ -146,28 +511,134 @@ export namespace Schema { // // - export type ContinentFilterInput = $.InputObject<'ContinentFilterInput', { - code: $.InputField<$.Nullable> - }, true> + // ContinentFilterInput + // -------------------------------------------------------------------------------------------------- + // + + export interface ContinentFilterInput extends $.InputObject { + name: "ContinentFilterInput"; + isAllFieldsNullable: true; + fields: { + code: ContinentFilterInput.code; + }; + } + + export namespace ContinentFilterInput { + export interface code extends $.InputField { + name: "code"; + inlineType: [0]; + namedType: $$NamedTypes.$$StringQueryOperatorInput; + } + } + + // CountryFilterInput + // -------------------------------------------------------------------------------------------------- + // + + export interface CountryFilterInput extends $.InputObject { + name: "CountryFilterInput"; + isAllFieldsNullable: true; + fields: { + code: CountryFilterInput.code; + continent: CountryFilterInput.continent; + currency: CountryFilterInput.currency; + name: CountryFilterInput.name; + }; + } + + export namespace CountryFilterInput { + export interface code extends $.InputField { + name: "code"; + inlineType: [0]; + namedType: $$NamedTypes.$$StringQueryOperatorInput; + } + + export interface continent extends $.InputField { + name: "continent"; + inlineType: [0]; + namedType: $$NamedTypes.$$StringQueryOperatorInput; + } + + export interface currency extends $.InputField { + name: "currency"; + inlineType: [0]; + namedType: $$NamedTypes.$$StringQueryOperatorInput; + } + + export interface name extends $.InputField { + name: "name"; + inlineType: [0]; + namedType: $$NamedTypes.$$StringQueryOperatorInput; + } + } + + // LanguageFilterInput + // -------------------------------------------------------------------------------------------------- + // + + export interface LanguageFilterInput extends $.InputObject { + name: "LanguageFilterInput"; + isAllFieldsNullable: true; + fields: { + code: LanguageFilterInput.code; + }; + } + + export namespace LanguageFilterInput { + export interface code extends $.InputField { + name: "code"; + inlineType: [0]; + namedType: $$NamedTypes.$$StringQueryOperatorInput; + } + } + + // StringQueryOperatorInput + // -------------------------------------------------------------------------------------------------- + // + + export interface StringQueryOperatorInput extends $.InputObject { + name: "StringQueryOperatorInput"; + isAllFieldsNullable: true; + fields: { + eq: StringQueryOperatorInput.eq; + in: StringQueryOperatorInput.$in; + ne: StringQueryOperatorInput.ne; + nin: StringQueryOperatorInput.nin; + regex: StringQueryOperatorInput.regex; + }; + } + + export namespace StringQueryOperatorInput { + export interface eq extends $.InputField { + name: "eq"; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } - export type CountryFilterInput = $.InputObject<'CountryFilterInput', { - code: $.InputField<$.Nullable> - continent: $.InputField<$.Nullable> - currency: $.InputField<$.Nullable> - name: $.InputField<$.Nullable> - }, true> + export interface $in extends $.InputField { + name: "in"; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$String; + } - export type LanguageFilterInput = $.InputObject<'LanguageFilterInput', { - code: $.InputField<$.Nullable> - }, true> + export interface ne extends $.InputField { + name: "ne"; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } - export type StringQueryOperatorInput = $.InputObject<'StringQueryOperatorInput', { - eq: $.InputField<$.Nullable<$Scalar.String>> - in: $.InputField<$.Nullable<$.List<$Scalar.String>>> - ne: $.InputField<$.Nullable<$Scalar.String>> - nin: $.InputField<$.Nullable<$.List<$Scalar.String>>> - regex: $.InputField<$.Nullable<$Scalar.String>> - }, true> + export interface nin extends $.InputField { + name: "nin"; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$String; + } + + export interface regex extends $.InputField { + name: "regex"; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } + } // // @@ -185,8 +656,6 @@ export namespace Schema { // // - // -- no types -- - // // // @@ -203,8 +672,6 @@ export namespace Schema { // // - // -- no types -- - // // // @@ -221,7 +688,109 @@ export namespace Schema { // // - // -- no types -- + // + // + // + // + // + // + // ================================================================================================== + // ScalarCustom + // ================================================================================================== + // + // + // + // + // + // + + // + // + // + // + // + // + // ================================================================================================== + // ScalarStandard + // ================================================================================================== + // + // + // + // + // + // + + // Boolean + // -------------------------------------------------------------------------------------------------- + // + + export type Boolean = $.StandardTypes.Boolean; + + // Float + // -------------------------------------------------------------------------------------------------- + // + + export type Float = $.StandardTypes.Float; + + // ID + // -------------------------------------------------------------------------------------------------- + // + + export type ID = $.StandardTypes.ID; + + // Int + // -------------------------------------------------------------------------------------------------- + // + + export type Int = $.StandardTypes.Int; + + // String + // -------------------------------------------------------------------------------------------------- + // + + export type String = $.StandardTypes.String; + + // + // + // + // + // + // + // ================================================================================================== + // Named Types Index + // ================================================================================================== + // + // + // + // + // + // + + /** + * [1] These definitions serve to allow field selection interfaces to extend their respective object type without + * name clashing between the field name and the object name. + * + * For example imagine `Query.Foo` field with type also called `Foo`. Our generated interfaces for each field + * would end up with an error of `export interface Foo extends Foo ...` + */ + + namespace $$NamedTypes { + export type $$Query = Query; + export type $$Continent = Continent; + export type $$Country = Country; + export type $$Language = Language; + export type $$State = State; + export type $$Subdivision = Subdivision; + export type $$ContinentFilterInput = ContinentFilterInput; + export type $$CountryFilterInput = CountryFilterInput; + export type $$LanguageFilterInput = LanguageFilterInput; + export type $$StringQueryOperatorInput = StringQueryOperatorInput; + export type $$Boolean = Boolean; + export type $$Float = Float; + export type $$ID = ID; + export type $$Int = Int; + export type $$String = String; + } } // @@ -239,32 +808,35 @@ export namespace Schema { // // // -export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $$Utilities.Schema { - name: Data.Name - RootTypesPresent: ['Query'] - RootUnion: Schema.Query + +export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $ +{ + name: Data.Name; + operationsAvailable: ["query"]; + RootUnion: Schema.Query; Root: { - Query: Schema.Query - Mutation: null - Subscription: null - } + query: Schema.Query; + mutation: null; + subscription: null; + }; allTypes: { - Query: Schema.Query - Continent: Schema.Continent - Country: Schema.Country - Language: Schema.Language - State: Schema.State - Subdivision: Schema.Subdivision - } + Query: Schema.Query; + Continent: Schema.Continent; + Country: Schema.Country; + Language: Schema.Language; + State: Schema.State; + Subdivision: Schema.Subdivision; + }; objects: { - Continent: Schema.Continent - Country: Schema.Country - Language: Schema.Language - State: Schema.State - Subdivision: Schema.Subdivision - } - unions: {} - interfaces: {} - scalars: $Scalars - extensions: $$Utilities.GlobalRegistry.TypeExtensions + Continent: Schema.Continent; + Country: Schema.Country; + Language: Schema.Language; + State: Schema.State; + Subdivision: Schema.Subdivision; + }; + unions: {}; + interfaces: {}; + scalars: $Scalars; + extensions: $$Utilities.GlobalRegistry.TypeExtensions; } diff --git a/website/graffle/modules/SchemaDrivenDataMap.ts b/website/graffle/modules/SchemaDrivenDataMap.ts index 3596deb27..78f8860c3 100644 --- a/website/graffle/modules/SchemaDrivenDataMap.ts +++ b/website/graffle/modules/SchemaDrivenDataMap.ts @@ -1,5 +1,5 @@ -import type * as $$Utilities from 'graffle/utilities-for-generated' -import * as $Scalar from './Scalar.js' +import type * as $$Utilities from "graffle/utilities-for-generated"; +import * as $Scalar from "./Scalar.js"; // // // @@ -16,15 +16,15 @@ import * as $Scalar from './Scalar.js' // // -const Boolean = $Scalar.Boolean +const Boolean = $Scalar.Boolean; -const Float = $Scalar.Float +const Float = $Scalar.Float; -const ID = $Scalar.ID +const ID = $Scalar.ID; -const Int = $Scalar.Int +const Int = $Scalar.Int; -const String = $Scalar.String +const String = $Scalar.String; // // @@ -79,31 +79,31 @@ const String = $Scalar.String // const ContinentFilterInput: $$Utilities.SchemaDrivenDataMap.InputObject = { - n: 'ContinentFilterInput', + n: "ContinentFilterInput", f: { code: {}, }, -} +}; const CountryFilterInput: $$Utilities.SchemaDrivenDataMap.InputObject = { - n: 'CountryFilterInput', + n: "CountryFilterInput", f: { code: {}, continent: {}, currency: {}, name: {}, }, -} +}; const LanguageFilterInput: $$Utilities.SchemaDrivenDataMap.InputObject = { - n: 'LanguageFilterInput', + n: "LanguageFilterInput", f: { code: {}, }, -} +}; const StringQueryOperatorInput: $$Utilities.SchemaDrivenDataMap.InputObject = { - n: 'StringQueryOperatorInput', + n: "StringQueryOperatorInput", f: { eq: {}, in: {}, @@ -111,7 +111,7 @@ const StringQueryOperatorInput: $$Utilities.SchemaDrivenDataMap.InputObject = { nin: {}, regex: {}, }, -} +}; // // @@ -137,7 +137,7 @@ const Continent: $$Utilities.SchemaDrivenDataMap.OutputObject = { }, name: {}, }, -} +}; const Country: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -172,7 +172,7 @@ const Country: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Subdivision, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; const Language: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -181,7 +181,7 @@ const Language: $$Utilities.SchemaDrivenDataMap.OutputObject = { native: {}, rtl: {}, }, -} +}; const State: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -191,7 +191,7 @@ const State: $$Utilities.SchemaDrivenDataMap.OutputObject = { }, name: {}, }, -} +}; const Subdivision: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -199,7 +199,7 @@ const Subdivision: $$Utilities.SchemaDrivenDataMap.OutputObject = { emoji: {}, name: {}, }, -} +}; // // @@ -310,7 +310,7 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Language, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; // // @@ -329,18 +329,18 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { // // -Continent.f[`countries`]!.nt = Country -Country.f[`continent`]!.nt = Continent -Country.f[`languages`]!.nt = Language -Country.f[`states`]!.nt = State -Country.f[`subdivisions`]!.nt = Subdivision -State.f[`country`]!.nt = Country -Query.f[`continent`]!.nt = Continent -Query.f[`continents`]!.nt = Continent -Query.f[`countries`]!.nt = Country -Query.f[`country`]!.nt = Country -Query.f[`language`]!.nt = Language -Query.f[`languages`]!.nt = Language +Continent.f[`countries`]!.nt = Country; +Country.f[`continent`]!.nt = Continent; +Country.f[`languages`]!.nt = Language; +Country.f[`states`]!.nt = State; +Country.f[`subdivisions`]!.nt = Subdivision; +State.f[`country`]!.nt = Country; +Query.f[`continent`]!.nt = Continent; +Query.f[`continents`]!.nt = Continent; +Query.f[`countries`]!.nt = Country; +Query.f[`country`]!.nt = Country; +Query.f[`language`]!.nt = Language; +Query.f[`languages`]!.nt = Language; // // @@ -359,8 +359,8 @@ Query.f[`languages`]!.nt = Language // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Query, + operations: { + query: Query, }, directives: {}, types: { @@ -380,6 +380,6 @@ const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { Subdivision, Query, }, -} +}; -export { $schemaDrivenDataMap as schemaDrivenDataMap } +export { $schemaDrivenDataMap as schemaDrivenDataMap }; diff --git a/website/graffle/modules/SchemaRuntime.ts b/website/graffle/modules/SchemaRuntime.ts index d6c840408..e5648df29 100644 --- a/website/graffle/modules/SchemaRuntime.ts +++ b/website/graffle/modules/SchemaRuntime.ts @@ -115,7 +115,7 @@ export const Query = $.Object$(`Query`, { }) export const $Index: Index = { name: Data.Name, - RootTypesPresent: ['Query'] as const, + operationsAvailable: ['Query'] as const, RootUnion: undefined as any, // Type level only. Root: { Query, diff --git a/website/graffle/modules/Select.ts b/website/graffle/modules/Select.ts index 5ea001514..d1734b6b4 100644 --- a/website/graffle/modules/Select.ts +++ b/website/graffle/modules/Select.ts @@ -1,7 +1,8 @@ -import type { InferResult } from 'graffle/schema' -import * as Data from './Data.js' -import type { Schema } from './Schema.js' -import type * as SelectionSets from './SelectionSets.js' +import type { InferResult } from "graffle/schema"; +import type { OperationTypeNode } from "graphql"; +import * as Data from "./Data.js"; +import type { Schema } from "./Schema.js"; +import type * as SelectionSets from "./SelectionSets.js"; // // @@ -18,8 +19,8 @@ import type * as SelectionSets from './SelectionSets.js' // // // -import { createSelect } from 'graffle/client' -export const Select = createSelect(Data.Name) +import { createSelect } from "graffle/client"; +export const Select = createSelect(Data.Name); // // @@ -38,43 +39,47 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // OutputObject Types - // ------------------ - export type Continent<$SelectionSet extends SelectionSets.Continent> = InferResult.Object< + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Operation< $SelectionSet, Schema, - Schema['allTypes']['Continent'] - > - export type Country<$SelectionSet extends SelectionSets.Country> = InferResult.Object< + OperationTypeNode.QUERY + >; + // OutputObject + // -------------------------------------------------------------------------------------------------- + // + export type Continent<$SelectionSet extends SelectionSets.Continent> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['Country'] - > - export type Language<$SelectionSet extends SelectionSets.Language> = InferResult.Object< + Schema["allTypes"]["Continent"] + >; + export type Country<$SelectionSet extends SelectionSets.Country> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['Language'] - > - export type State<$SelectionSet extends SelectionSets.State> = InferResult.Object< + Schema["allTypes"]["Country"] + >; + export type Language<$SelectionSet extends SelectionSets.Language> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['State'] - > - export type Subdivision<$SelectionSet extends SelectionSets.Subdivision> = InferResult.Object< + Schema["allTypes"]["Language"] + >; + export type State<$SelectionSet extends SelectionSets.State> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['Subdivision'] - > - // Union Types - // ----------- - - // -- None -- - - // Interface Types - // --------------- + Schema["allTypes"]["State"] + >; + export type Subdivision<$SelectionSet extends SelectionSets.Subdivision> = InferResult.OutputObject< + $SelectionSet, + Schema, + Schema["allTypes"]["Subdivision"] + >; + // Union + // -------------------------------------------------------------------------------------------------- + // - // -- None -- + // Interface + // -------------------------------------------------------------------------------------------------- + // } diff --git a/website/graffle/modules/SelectionSets.ts b/website/graffle/modules/SelectionSets.ts index 0e9dd9e19..e3edf2bd7 100644 --- a/website/graffle/modules/SelectionSets.ts +++ b/website/graffle/modules/SelectionSets.ts @@ -1,5 +1,5 @@ -import type { Select as $Select } from 'graffle/schema' -import type * as $$Utilities from 'graffle/utilities-for-generated' +import type { Select as $Select } from "graffle/schema"; +import type * as $$Utilities from "graffle/utilities-for-generated"; // // @@ -17,9 +17,10 @@ import type * as $$Utilities from 'graffle/utilities-for-generated' // // -// Prefix with $ because this is not a schema type. A user could have a schema type named "Document" that this would conflict with. -export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - query?: Record> +export interface $Document< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + query?: Record>; } // @@ -38,45 +39,39 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { +export interface Query< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { /** * Select the `continent` field on the `Query` object. Its type is `Continent` (a `OutputObject` kind of type). */ - continent?: Query.continent<$Scalars> | $Select.SelectAlias.SelectAlias> + continent?: Query.continent<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `continents` field on the `Query` object. Its type is `Continent` (a `OutputObject` kind of type). */ - continents?: Query.continents$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + continents?: Query.continents$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `countries` field on the `Query` object. Its type is `Country` (a `OutputObject` kind of type). */ - countries?: Query.countries$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + countries?: Query.countries$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `country` field on the `Query` object. Its type is `Country` (a `OutputObject` kind of type). */ - country?: Query.country<$Scalars> | $Select.SelectAlias.SelectAlias> + country?: Query.country<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `language` field on the `Query` object. Its type is `Language` (a `OutputObject` kind of type). */ - language?: Query.language<$Scalars> | $Select.SelectAlias.SelectAlias> + language?: Query.language<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `languages` field on the `Query` object. Its type is `Language` (a `OutputObject` kind of type). */ - languages?: Query.languages$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + languages?: Query.languages$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -87,8 +82,8 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Query$FragmentInline<$Scalars> - | Query$FragmentInline<$Scalars>[] + | Query$FragmentInline<_$Scalars> + | Query$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -97,29 +92,34 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Query$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Query<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Query$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Query<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Query { - export type continent<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = continent$SelectionSet<$Scalars> + export type continent< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = continent$SelectionSet<_$Scalars>; - export interface continent$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Continent<$Scalars> - { + export interface continent$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Continent<_$Scalars> { /** * Arguments for `continent` field. All arguments are required so you must include this. */ - $: continent$Arguments<$Scalars> + $: continent$Arguments<_$Scalars>; } - export interface continent$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - code: string + export interface continent$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + code: string; } // --- expanded --- @@ -129,25 +129,31 @@ export namespace Query { * 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 continent$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - continent$SelectionSet<$Scalars> - > + export type continent$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + continent$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type continents<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = continents$SelectionSet<$Scalars> + export type continents< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = continents$SelectionSet<_$Scalars>; - export interface continents$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Continent<$Scalars> - { + export interface continents$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Continent<_$Scalars> { /** * Arguments for `continents` field. No arguments are required so you may omit this. */ - $?: continents$Arguments<$Scalars> + $?: continents$Arguments<_$Scalars>; } - export interface continents$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - filter?: $NamedTypes.$ContinentFilterInput<$Scalars> | undefined | null + export interface continents$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + filter?: $NamedTypes.$ContinentFilterInput<_$Scalars> | undefined | null; } // --- expanded --- @@ -157,25 +163,31 @@ export namespace Query { * 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 continents$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - continents$SelectionSet<$Scalars> - > + export type continents$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + continents$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type countries<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = countries$SelectionSet<$Scalars> + export type countries< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = countries$SelectionSet<_$Scalars>; - export interface countries$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Country<$Scalars> - { + export interface countries$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Country<_$Scalars> { /** * Arguments for `countries` field. No arguments are required so you may omit this. */ - $?: countries$Arguments<$Scalars> + $?: countries$Arguments<_$Scalars>; } - export interface countries$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - filter?: $NamedTypes.$CountryFilterInput<$Scalars> | undefined | null + export interface countries$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + filter?: $NamedTypes.$CountryFilterInput<_$Scalars> | undefined | null; } // --- expanded --- @@ -185,25 +197,30 @@ export namespace Query { * 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 countries$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - countries$SelectionSet<$Scalars> - > + export type countries$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + countries$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type country<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = country$SelectionSet<$Scalars> + export type country<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + country$SelectionSet<_$Scalars>; - export interface country$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Country<$Scalars> - { + export interface country$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Country<_$Scalars> { /** * Arguments for `country` field. All arguments are required so you must include this. */ - $: country$Arguments<$Scalars> + $: country$Arguments<_$Scalars>; } - export interface country$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - code: string + export interface country$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + code: string; } // --- expanded --- @@ -213,25 +230,31 @@ export namespace Query { * 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 country$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - country$SelectionSet<$Scalars> - > + export type country$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + country$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type language<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = language$SelectionSet<$Scalars> + export type language< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = language$SelectionSet<_$Scalars>; - export interface language$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Language<$Scalars> - { + export interface language$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Language<_$Scalars> { /** * Arguments for `language` field. All arguments are required so you must include this. */ - $: language$Arguments<$Scalars> + $: language$Arguments<_$Scalars>; } - export interface language$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - code: string + export interface language$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + code: string; } // --- expanded --- @@ -241,25 +264,31 @@ export namespace Query { * 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 language$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - language$SelectionSet<$Scalars> - > + export type language$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + language$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type languages<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = languages$SelectionSet<$Scalars> + export type languages< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = languages$SelectionSet<_$Scalars>; - export interface languages$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Language<$Scalars> - { + export interface languages$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Language<_$Scalars> { /** * Arguments for `languages` field. No arguments are required so you may omit this. */ - $?: languages$Arguments<$Scalars> + $?: languages$Arguments<_$Scalars>; } - export interface languages$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - filter?: $NamedTypes.$LanguageFilterInput<$Scalars> | undefined | null + export interface languages$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + filter?: $NamedTypes.$LanguageFilterInput<_$Scalars> | undefined | null; } // --- expanded --- @@ -269,9 +298,11 @@ export namespace Query { * 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 languages$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - languages$SelectionSet<$Scalars> - > + export type languages$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + languages$SelectionSet<_$Scalars> + >; } // @@ -290,27 +321,35 @@ export namespace Query { // // -export interface ContinentFilterInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - code?: $NamedTypes.$StringQueryOperatorInput<$Scalars> | undefined | null +export interface ContinentFilterInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + code?: $NamedTypes.$StringQueryOperatorInput<_$Scalars> | undefined | null; } -export interface CountryFilterInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - code?: $NamedTypes.$StringQueryOperatorInput<$Scalars> | undefined | null - continent?: $NamedTypes.$StringQueryOperatorInput<$Scalars> | undefined | null - currency?: $NamedTypes.$StringQueryOperatorInput<$Scalars> | undefined | null - name?: $NamedTypes.$StringQueryOperatorInput<$Scalars> | undefined | null +export interface CountryFilterInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + code?: $NamedTypes.$StringQueryOperatorInput<_$Scalars> | undefined | null; + continent?: $NamedTypes.$StringQueryOperatorInput<_$Scalars> | undefined | null; + currency?: $NamedTypes.$StringQueryOperatorInput<_$Scalars> | undefined | null; + name?: $NamedTypes.$StringQueryOperatorInput<_$Scalars> | undefined | null; } -export interface LanguageFilterInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - code?: $NamedTypes.$StringQueryOperatorInput<$Scalars> | undefined | null +export interface LanguageFilterInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + code?: $NamedTypes.$StringQueryOperatorInput<_$Scalars> | undefined | null; } -export interface StringQueryOperatorInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - eq?: string | undefined | null - in?: Array | undefined | null - ne?: string | undefined | null - nin?: Array | undefined | null - regex?: string | undefined | null +export interface StringQueryOperatorInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + eq?: string | undefined | null; + in?: Array | undefined | null; + ne?: string | undefined | null; + nin?: Array | undefined | null; + regex?: string | undefined | null; } // @@ -329,33 +368,27 @@ export interface StringQueryOperatorInput<$Scalars extends $$Utilities.Schema.Sc // // -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Continent // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Continent<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { +export interface Continent< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `code` field on the `Continent` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - code?: Continent.code$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + code?: Continent.code$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `countries` field on the `Continent` object. Its type is `Country` (a `OutputObject` kind of type). */ - countries?: Continent.countries$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + countries?: Continent.countries$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `Continent` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: Continent.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: Continent.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -366,8 +399,8 @@ export interface Continent<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Continent$FragmentInline<$Scalars> - | Continent$FragmentInline<$Scalars>[] + | Continent$FragmentInline<_$Scalars> + | Continent$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -376,23 +409,24 @@ export interface Continent<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Continent$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Continent<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Continent$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Continent<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Continent { - export type code<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type code<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> + | code$SelectionSet<_$Scalars>; - export interface code$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface code$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -401,18 +435,22 @@ export namespace Continent { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type code$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> - > + | code$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type countries<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = countries$SelectionSet<$Scalars> + export type countries< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = countries$SelectionSet<_$Scalars>; - export interface countries$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Country<$Scalars> - {} + export interface countries$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Country<_$Scalars> {} // --- expanded --- @@ -421,19 +459,21 @@ export namespace Continent { * 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 countries$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - countries$SelectionSet<$Scalars> - > + export type countries$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + countries$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -442,89 +482,85 @@ export namespace Continent { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Country // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Country<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { +export interface Country< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `awsRegion` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - awsRegion?: Country.awsRegion$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + awsRegion?: Country.awsRegion$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `capital` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - capital?: Country.capital$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + capital?: Country.capital$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `code` field on the `Country` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - code?: Country.code$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + code?: Country.code$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `continent` field on the `Country` object. Its type is `Continent` (a `OutputObject` kind of type). */ - continent?: Country.continent$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + continent?: Country.continent$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `currencies` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - currencies?: Country.currencies$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + currencies?: Country.currencies$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `currency` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - currency?: Country.currency$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + currency?: Country.currency$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `emoji` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - emoji?: Country.emoji$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + emoji?: Country.emoji$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `emojiU` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - emojiU?: Country.emojiU$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + emojiU?: Country.emojiU$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `languages` field on the `Country` object. Its type is `Language` (a `OutputObject` kind of type). */ - languages?: Country.languages$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + languages?: Country.languages$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: Country.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: Country.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `native` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - native?: Country.native$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + native?: Country.native$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `phone` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - phone?: Country.phone$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + phone?: Country.phone$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `phones` field on the `Country` object. Its type is `String` (a `ScalarStandard` kind of type). */ - phones?: Country.phones$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + phones?: Country.phones$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `states` field on the `Country` object. Its type is `State` (a `OutputObject` kind of type). */ - states?: Country.states$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + states?: Country.states$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `subdivisions` field on the `Country` object. Its type is `Subdivision` (a `OutputObject` kind of type). */ subdivisions?: - | Country.subdivisions$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | Country.subdivisions$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -535,8 +571,8 @@ export interface Country<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Country$FragmentInline<$Scalars> - | Country$FragmentInline<$Scalars>[] + | Country$FragmentInline<_$Scalars> + | Country$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -545,23 +581,26 @@ export interface Country<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Country$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Country<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Country$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Country<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Country { - export type awsRegion<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type awsRegion< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = | $Select.Indicator.NoArgsIndicator - | awsRegion$SelectionSet<$Scalars> + | awsRegion$SelectionSet<_$Scalars>; - export interface awsRegion$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface awsRegion$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -570,20 +609,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type awsRegion$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | awsRegion$SelectionSet<$Scalars> - > + | awsRegion$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type capital<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type capital<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | capital$SelectionSet<$Scalars> + | capital$SelectionSet<_$Scalars>; - export interface capital$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface capital$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -592,20 +633,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type capital$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | capital$SelectionSet<$Scalars> - > + | capital$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type code<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type code<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> + | code$SelectionSet<_$Scalars>; - export interface code$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface code$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -614,18 +657,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type code$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> - > + | code$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type continent<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = continent$SelectionSet<$Scalars> + export type continent< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = continent$SelectionSet<_$Scalars>; - export interface continent$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Continent<$Scalars> - {} + export interface continent$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Continent<_$Scalars> {} // --- expanded --- @@ -634,19 +681,23 @@ export namespace Country { * 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 continent$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - continent$SelectionSet<$Scalars> - > + export type continent$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + continent$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type currencies<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type currencies< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = | $Select.Indicator.NoArgsIndicator - | currencies$SelectionSet<$Scalars> + | currencies$SelectionSet<_$Scalars>; - export interface currencies$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface currencies$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -655,20 +706,24 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type currencies$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | currencies$SelectionSet<$Scalars> - > + | currencies$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type currency<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type currency< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = | $Select.Indicator.NoArgsIndicator - | currency$SelectionSet<$Scalars> + | currency$SelectionSet<_$Scalars>; - export interface currency$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface currency$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -677,20 +732,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type currency$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | currency$SelectionSet<$Scalars> - > + | currency$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type emoji<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type emoji<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | emoji$SelectionSet<$Scalars> + | emoji$SelectionSet<_$Scalars>; - export interface emoji$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface emoji$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -699,20 +756,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type emoji$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | emoji$SelectionSet<$Scalars> - > + | emoji$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type emojiU<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type emojiU<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | emojiU$SelectionSet<$Scalars> + | emojiU$SelectionSet<_$Scalars>; - export interface emojiU$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface emojiU$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -721,18 +780,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type emojiU$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | emojiU$SelectionSet<$Scalars> - > + | emojiU$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type languages<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = languages$SelectionSet<$Scalars> + export type languages< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = languages$SelectionSet<_$Scalars>; - export interface languages$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Language<$Scalars> - {} + export interface languages$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Language<_$Scalars> {} // --- expanded --- @@ -741,27 +804,31 @@ export namespace Country { * 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 languages$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - languages$SelectionSet<$Scalars> - > + export type languages$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + languages$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - { + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base { /** * Arguments for `name` field. No arguments are required so you may omit this. */ - $?: name$Arguments<$Scalars> + $?: name$Arguments<_$Scalars>; } - export interface name$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - lang?: string | undefined | null + export interface name$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + lang?: string | undefined | null; } // --- expanded --- @@ -771,20 +838,22 @@ export namespace Country { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type native<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type native<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | native$SelectionSet<$Scalars> + | native$SelectionSet<_$Scalars>; - export interface native$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface native$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -793,20 +862,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type native$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | native$SelectionSet<$Scalars> - > + | native$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type phone<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type phone<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | phone$SelectionSet<$Scalars> + | phone$SelectionSet<_$Scalars>; - export interface phone$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface phone$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -815,20 +886,22 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type phone$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | phone$SelectionSet<$Scalars> - > + | phone$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type phones<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type phones<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | phones$SelectionSet<$Scalars> + | phones$SelectionSet<_$Scalars>; - export interface phones$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface phones$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -837,18 +910,21 @@ export namespace Country { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type phones$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | phones$SelectionSet<$Scalars> - > + | phones$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type states<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = states$SelectionSet<$Scalars> + export type states<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + states$SelectionSet<_$Scalars>; - export interface states$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$State<$Scalars> - {} + export interface states$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$State<_$Scalars> {} // --- expanded --- @@ -857,19 +933,21 @@ export namespace Country { * 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 states$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - states$SelectionSet<$Scalars> - > + export type states$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + states$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type subdivisions<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = subdivisions$SelectionSet< - $Scalars - > + export type subdivisions< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = subdivisions$SelectionSet<_$Scalars>; - export interface subdivisions$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Subdivision<$Scalars> - {} + export interface subdivisions$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Subdivision<_$Scalars> {} // --- expanded --- @@ -878,42 +956,38 @@ export namespace Country { * 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 subdivisions$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - subdivisions$SelectionSet<$Scalars> - > + export type subdivisions$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + subdivisions$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Language // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Language<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { +export interface Language< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `code` field on the `Language` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - code?: Language.code$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + code?: Language.code$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `Language` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: Language.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: Language.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `native` field on the `Language` object. Its type is `String` (a `ScalarStandard` kind of type). */ - native?: Language.native$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + native?: Language.native$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `rtl` field on the `Language` object. Its type is `Boolean` (a `ScalarStandard` kind of type). */ - rtl?: Language.rtl$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + rtl?: Language.rtl$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -924,8 +998,8 @@ export interface Language<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Language$FragmentInline<$Scalars> - | Language$FragmentInline<$Scalars>[] + | Language$FragmentInline<_$Scalars> + | Language$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -934,23 +1008,24 @@ export interface Language<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Language$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Language<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Language$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Language<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Language { - export type code<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type code<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> + | code$SelectionSet<_$Scalars>; - export interface code$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface code$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -959,20 +1034,22 @@ export namespace Language { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type code$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> - > + | code$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -981,20 +1058,22 @@ export namespace Language { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type native<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type native<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | native$SelectionSet<$Scalars> + | native$SelectionSet<_$Scalars>; - export interface native$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface native$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1003,20 +1082,22 @@ export namespace Language { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type native$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | native$SelectionSet<$Scalars> - > + | native$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type rtl<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type rtl<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | rtl$SelectionSet<$Scalars> + | rtl$SelectionSet<_$Scalars>; - export interface rtl$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface rtl$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1025,39 +1106,35 @@ export namespace Language { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type rtl$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | rtl$SelectionSet<$Scalars> - > + | rtl$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // State // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface State<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { +export interface State<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $Select.Bases.ObjectLike +{ /** * Select the `code` field on the `State` object. Its type is `String` (a `ScalarStandard` kind of type). */ - code?: State.code$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + code?: State.code$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `country` field on the `State` object. Its type is `Country` (a `OutputObject` kind of type). */ - country?: State.country$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + country?: State.country$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `State` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: State.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: State.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -1068,8 +1145,8 @@ export interface State<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | State$FragmentInline<$Scalars> - | State$FragmentInline<$Scalars>[] + | State$FragmentInline<_$Scalars> + | State$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -1078,23 +1155,24 @@ export interface State<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface State$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends State<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface State$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends State<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace State { - export type code<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type code<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> + | code$SelectionSet<_$Scalars>; - export interface code$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface code$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1103,18 +1181,21 @@ export namespace State { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type code$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> - > + | code$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type country<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = country$SelectionSet<$Scalars> + export type country<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + country$SelectionSet<_$Scalars>; - export interface country$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Country<$Scalars> - {} + export interface country$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Country<_$Scalars> {} // --- expanded --- @@ -1123,19 +1204,21 @@ export namespace State { * 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 country$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - country$SelectionSet<$Scalars> - > + export type country$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + country$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1144,41 +1227,35 @@ export namespace State { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Subdivision // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Subdivision<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ +export interface Subdivision< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `code` field on the `Subdivision` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - code?: Subdivision.code$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + code?: Subdivision.code$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `emoji` field on the `Subdivision` object. Its type is `String` (a `ScalarStandard` kind of type). */ - emoji?: Subdivision.emoji$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + emoji?: Subdivision.emoji$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `Subdivision` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: Subdivision.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: Subdivision.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -1189,8 +1266,8 @@ export interface Subdivision<$Scalars extends $$Utilities.Schema.Scalar.ScalarMa * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Subdivision$FragmentInline<$Scalars> - | Subdivision$FragmentInline<$Scalars>[] + | Subdivision$FragmentInline<_$Scalars> + | Subdivision$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -1199,23 +1276,24 @@ export interface Subdivision<$Scalars extends $$Utilities.Schema.Scalar.ScalarMa */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Subdivision$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Subdivision<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Subdivision$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Subdivision<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Subdivision { - export type code<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type code<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> + | code$SelectionSet<_$Scalars>; - export interface code$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface code$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1224,20 +1302,22 @@ export namespace Subdivision { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type code$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | code$SelectionSet<$Scalars> - > + | code$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type emoji<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type emoji<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | emoji$SelectionSet<$Scalars> + | emoji$SelectionSet<_$Scalars>; - export interface emoji$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface emoji$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1246,20 +1326,22 @@ export namespace Subdivision { * 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<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type emoji$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | emoji$SelectionSet<$Scalars> - > + | emoji$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1268,10 +1350,12 @@ export namespace Subdivision { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; } /** @@ -1282,21 +1366,32 @@ export namespace Subdivision { * would end up with an error of `export interface Foo extends Foo ...` */ export namespace $NamedTypes { - export type $Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Query<$Scalars> - export type $ContinentFilterInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = ContinentFilterInput< - $Scalars - > - export type $CountryFilterInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = CountryFilterInput< - $Scalars - > - export type $LanguageFilterInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = LanguageFilterInput< - $Scalars - > - export type $StringQueryOperatorInput<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - StringQueryOperatorInput<$Scalars> - export type $Continent<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Continent<$Scalars> - export type $Country<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Country<$Scalars> - export type $Language<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Language<$Scalars> - export type $State<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = State<$Scalars> - export type $Subdivision<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Subdivision<$Scalars> + export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Query<_$Scalars>; + export type $ContinentFilterInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = ContinentFilterInput<_$Scalars>; + export type $CountryFilterInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = CountryFilterInput<_$Scalars>; + export type $LanguageFilterInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = LanguageFilterInput<_$Scalars>; + export type $StringQueryOperatorInput< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = StringQueryOperatorInput<_$Scalars>; + export type $Continent< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Continent<_$Scalars>; + export type $Country< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Country<_$Scalars>; + export type $Language< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Language<_$Scalars>; + export type $State<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + State<_$Scalars>; + export type $Subdivision< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Subdivision<_$Scalars>; } diff --git a/website/pokemon/_.ts b/website/pokemon/_.ts index d27e9e3d3..dbebc63cb 100644 --- a/website/pokemon/_.ts +++ b/website/pokemon/_.ts @@ -2,9 +2,9 @@ // It at least helps with Twoslash wherein without this import here Twoslash will not include the global module. // In real TypeScript projects it seems the global module is included automatically. But there could be certain tsconfig // setups where this still indeed does help. -import './modules/Global.js' +import "./modules/Global.js"; -export { create } from './modules/Client.js' -export { schemaDrivenDataMap } from './modules/SchemaDrivenDataMap.js' -export { Select } from './modules/Select.js' -export * as SelectionSets from './modules/SelectionSets.js' +export { create } from "./modules/Client.js"; +export { schemaDrivenDataMap } from "./modules/SchemaDrivenDataMap.js"; +export { Select } from "./modules/Select.js"; +export * as SelectionSets from "./modules/SelectionSets.js"; diff --git a/website/pokemon/__.ts b/website/pokemon/__.ts index c27d0ff68..e81b60c2f 100644 --- a/website/pokemon/__.ts +++ b/website/pokemon/__.ts @@ -1 +1 @@ -export * as Pokemon from './_.js' +export * as Pokemon from "./_.js"; diff --git a/website/pokemon/modules/Client.ts b/website/pokemon/modules/Client.ts index d6d0b8bf6..b8c827873 100644 --- a/website/pokemon/modules/Client.ts +++ b/website/pokemon/modules/Client.ts @@ -1,6 +1,5 @@ -import { createPrefilled } from 'graffle/client' -import { defaultSchemaUrl } from './Data.js' -import { Name } from './Data.js' -import { schemaDrivenDataMap } from './SchemaDrivenDataMap.js' - -export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl) +import { createPrefilled } from "graffle/client"; +import { defaultSchemaUrl } from "./Data.js"; +import { Name } from "./Data.js"; +import { schemaDrivenDataMap } from "./SchemaDrivenDataMap.js"; +export const create = createPrefilled(Name, schemaDrivenDataMap, defaultSchemaUrl); diff --git a/website/pokemon/modules/Data.ts b/website/pokemon/modules/Data.ts index 2f19c3ff4..249bee765 100644 --- a/website/pokemon/modules/Data.ts +++ b/website/pokemon/modules/Data.ts @@ -1,4 +1,4 @@ -export const Name = `Pokemon` -export type Name = 'Pokemon' +export const Name = `Pokemon`; +export type Name = "Pokemon"; -export const defaultSchemaUrl = new URL('http://localhost:3000/graphql') +export const defaultSchemaUrl = new URL("http://localhost:3000/graphql"); diff --git a/website/pokemon/modules/Global.ts b/website/pokemon/modules/Global.ts index d6045172e..bde6052b7 100644 --- a/website/pokemon/modules/Global.ts +++ b/website/pokemon/modules/Global.ts @@ -1,26 +1,25 @@ -import type * as Data from './Data.js' -import type * as MethodsDocument from './MethodsDocument.js' -import type * as MethodsRoot from './MethodsRoot.js' -import type * as MethodsSelect from './MethodsSelect.js' -import type { Schema } from './Schema.js' +import type * as Data from "./Data.js"; +import type * as MethodsDocument from "./MethodsDocument.js"; +import type * as MethodsRoot from "./MethodsRoot.js"; +import type * as MethodsSelect from "./MethodsSelect.js"; +import type { Schema } from "./Schema.js"; declare global { export namespace GraffleGlobal { export interface Clients { Pokemon: { - name: Data.Name - schema: Schema + name: Data.Name; + schema: Schema; interfaces: { - MethodsSelect: MethodsSelect.$MethodsSelect - Document: MethodsDocument.BuilderMethodsDocumentFn - Root: MethodsRoot.BuilderMethodsRootFn - } - + MethodsSelect: MethodsSelect.$MethodsSelect; + Document: MethodsDocument.BuilderMethodsDocumentFn; + Root: MethodsRoot.BuilderMethodsRootFn; + }; /** * http://localhost:3000/graphql */ - defaultSchemaUrl: string - } + defaultSchemaUrl: string; + }; } } } diff --git a/website/pokemon/modules/MethodsDocument.ts b/website/pokemon/modules/MethodsDocument.ts index 469191c77..f0f74d3c9 100644 --- a/website/pokemon/modules/MethodsDocument.ts +++ b/website/pokemon/modules/MethodsDocument.ts @@ -1,20 +1,19 @@ -import type * as Utilities from 'graffle/utilities-for-generated' -import type { Schema } from './Schema.js' -import type * as SelectionSets from './SelectionSets.js' - +import type * as Utilities from "graffle/utilities-for-generated"; +import type { Schema } from "./Schema.js"; +import type * as SelectionSets from "./SelectionSets.js"; export interface Document<$Context extends Utilities.ClientContext> { <$Document>( - document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context['scalars']>>, + document: Utilities.ExactNonEmpty<$Document, SelectionSets.$Document<$Context["scalars"]>>, ): Utilities.DocumentRunner< $Context, Schema, // @ts-expect-error We use Exact instead of constraint on this function. TypeScript does not see that as // Satisfying the constraint on the DocumentRunner type. $Document - > + >; } export interface BuilderMethodsDocumentFn extends Utilities.TypeFunction.Fn { // @ts-expect-error parameter is Untyped. - return: Document + return: Document; } diff --git a/website/pokemon/modules/MethodsRoot.ts b/website/pokemon/modules/MethodsRoot.ts index 1f1a1c902..84b5e15da 100644 --- a/website/pokemon/modules/MethodsRoot.ts +++ b/website/pokemon/modules/MethodsRoot.ts @@ -1,147 +1,154 @@ -import type { InferResult } from 'graffle/schema' -import type * as $$Utilities from 'graffle/utilities-for-generated' -import { type Simplify } from 'type-fest' -import type { Schema } from './Schema.js' -import type * as SelectionSet from './SelectionSets.js' +import type { InferResult } from "graffle/schema"; +import type * as $$Utilities from "graffle/utilities-for-generated"; +import type { Schema } from "./Schema.js"; +import type * as SelectionSet from "./SelectionSets.js"; -export interface MutationMethods<$Context extends $$Utilities.ClientContext> { +export interface QueryMethods<$Context extends $$Utilities.ClientContext> { $batch: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context['scalars']>>, + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutput< $Context, - InferResult.Mutation<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<$SelectionSet, Schema<$Context["scalars"]>> > > - > + >; __typename: () => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - { __typename: 'Mutation' }, - '__typename' + { __typename: "Query" }, + "__typename" > > - > - addPokemon: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.addPokemon<$Context['scalars']>>, + >; + + battles: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.battles<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Mutation<{ addPokemon: $SelectionSet }, Schema<$Context['scalars']>>, - 'addPokemon' + InferResult.OperationQuery<{ battles: $SelectionSet }, Schema<$Context["scalars"]>>, + "battles" > > - > -} + >; -export interface QueryMethods<$Context extends $$Utilities.ClientContext> { - $batch: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query<$Context['scalars']>>, + beings: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.beings<$Context["scalars"]>>, ) => Promise< - Simplify< - $$Utilities.HandleOutput< + $$Utilities.Simplify< + $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<$SelectionSet, Schema<$Context['scalars']>> + InferResult.OperationQuery<{ beings: $SelectionSet }, Schema<$Context["scalars"]>>, + "beings" > > - > - __typename: () => Promise< - Simplify< + >; + + pokemon: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.pokemon<$Context["scalars"]>>, + ) => Promise< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - { __typename: 'Query' }, - '__typename' + InferResult.OperationQuery<{ pokemon: $SelectionSet }, Schema<$Context["scalars"]>>, + "pokemon" > > - > - battles: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.battles<$Context['scalars']>>, + >; + + pokemonByName: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.pokemonByName<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ battles: $SelectionSet }, Schema<$Context['scalars']>>, - 'battles' + InferResult.OperationQuery<{ pokemonByName: $SelectionSet }, Schema<$Context["scalars"]>>, + "pokemonByName" > > - > - beings: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.beings<$Context['scalars']>>, + >; + + pokemons: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.pokemons<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ beings: $SelectionSet }, Schema<$Context['scalars']>>, - 'beings' + InferResult.OperationQuery<{ pokemons: $SelectionSet }, Schema<$Context["scalars"]>>, + "pokemons" > > - > - pokemon: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.pokemon<$Context['scalars']>>, + >; + + trainerByName: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.trainerByName<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ pokemon: $SelectionSet }, Schema<$Context['scalars']>>, - 'pokemon' + InferResult.OperationQuery<{ trainerByName: $SelectionSet }, Schema<$Context["scalars"]>>, + "trainerByName" > > - > - pokemonByName: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.pokemonByName<$Context['scalars']>>, + >; + + trainers: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.trainers<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ pokemonByName: $SelectionSet }, Schema<$Context['scalars']>>, - 'pokemonByName' + InferResult.OperationQuery<{ trainers: $SelectionSet }, Schema<$Context["scalars"]>>, + "trainers" > > - > - pokemons: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.pokemons<$Context['scalars']>>, + >; +} + +export interface MutationMethods<$Context extends $$Utilities.ClientContext> { + $batch: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation<$Context["scalars"]>>, ) => Promise< - Simplify< - $$Utilities.HandleOutputGraffleRootField< + $$Utilities.Simplify< + $$Utilities.HandleOutput< $Context, - InferResult.Query<{ pokemons: $SelectionSet }, Schema<$Context['scalars']>>, - 'pokemons' + InferResult.OperationMutation<$SelectionSet, Schema<$Context["scalars"]>> > > - > - trainerByName: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.trainerByName<$Context['scalars']>>, - ) => Promise< - Simplify< + >; + __typename: () => Promise< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ trainerByName: $SelectionSet }, Schema<$Context['scalars']>>, - 'trainerByName' + { __typename: "Mutation" }, + "__typename" > > - > - trainers: <$SelectionSet>( - selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Query.trainers<$Context['scalars']>>, + >; + + addPokemon: <$SelectionSet>( + selectionSet: $$Utilities.Exact<$SelectionSet, SelectionSet.Mutation.addPokemon<$Context["scalars"]>>, ) => Promise< - Simplify< + $$Utilities.Simplify< $$Utilities.HandleOutputGraffleRootField< $Context, - InferResult.Query<{ trainers: $SelectionSet }, Schema<$Context['scalars']>>, - 'trainers' + InferResult.OperationMutation<{ addPokemon: $SelectionSet }, Schema<$Context["scalars"]>>, + "addPokemon" > > - > + >; } export interface BuilderMethodsRoot<$Context extends $$Utilities.ClientContext> { - mutation: MutationMethods<$Context> - query: QueryMethods<$Context> + query: QueryMethods<$Context>; + mutation: MutationMethods<$Context>; } export interface BuilderMethodsRootFn extends $$Utilities.TypeFunction.Fn { // @ts-expect-error parameter is Untyped. - return: BuilderMethodsRoot + return: BuilderMethodsRoot; } diff --git a/website/pokemon/modules/MethodsSelect.ts b/website/pokemon/modules/MethodsSelect.ts index cb3e13b7d..2c43a310a 100644 --- a/website/pokemon/modules/MethodsSelect.ts +++ b/website/pokemon/modules/MethodsSelect.ts @@ -1,5 +1,5 @@ -import type * as $Utilities from 'graffle/utilities-for-generated' -import type * as $SelectionSets from './SelectionSets.js' +import type * as $Utilities from "graffle/utilities-for-generated"; +import type * as $SelectionSets from "./SelectionSets.js"; // // @@ -18,18 +18,18 @@ import type * as $SelectionSets from './SelectionSets.js' // export interface $MethodsSelect { - Mutation: Mutation - Query: Query - BattleRoyale: BattleRoyale - BattleTrainer: BattleTrainer - BattleWild: BattleWild - CombatantMultiPokemon: CombatantMultiPokemon - CombatantSinglePokemon: CombatantSinglePokemon - Patron: Patron - Pokemon: Pokemon - Trainer: Trainer - Battle: Battle - Being: Being + Query: Query; + Mutation: Mutation; + BattleRoyale: BattleRoyale; + BattleTrainer: BattleTrainer; + BattleWild: BattleWild; + CombatantMultiPokemon: CombatantMultiPokemon; + CombatantSinglePokemon: CombatantSinglePokemon; + Patron: Patron; + Pokemon: Pokemon; + Trainer: Trainer; + Battle: Battle; + Being: Being; } // @@ -48,12 +48,12 @@ export interface $MethodsSelect { // // -export interface Mutation { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet +export interface Query { + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet; } -export interface Query { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Query>): $SelectionSet +export interface Mutation { + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Mutation>): $SelectionSet; } // @@ -73,35 +73,35 @@ export interface Query { // export interface BattleRoyale { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.BattleRoyale>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.BattleRoyale>): $SelectionSet; } export interface BattleTrainer { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.BattleTrainer>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.BattleTrainer>): $SelectionSet; } export interface BattleWild { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.BattleWild>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.BattleWild>): $SelectionSet; } export interface CombatantMultiPokemon { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.CombatantMultiPokemon>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.CombatantMultiPokemon>): $SelectionSet; } export interface CombatantSinglePokemon { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.CombatantSinglePokemon>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.CombatantSinglePokemon>): $SelectionSet; } export interface Patron { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Patron>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Patron>): $SelectionSet; } export interface Pokemon { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Pokemon>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Pokemon>): $SelectionSet; } export interface Trainer { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Trainer>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Trainer>): $SelectionSet; } // @@ -121,7 +121,7 @@ export interface Trainer { // export interface Battle { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Battle>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Battle>): $SelectionSet; } // @@ -141,5 +141,5 @@ export interface Battle { // export interface Being { - <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Being>): $SelectionSet + <$SelectionSet>(selectionSet: $Utilities.Exact<$SelectionSet, $SelectionSets.Being>): $SelectionSet; } diff --git a/website/pokemon/modules/Scalar.ts b/website/pokemon/modules/Scalar.ts index 98c8e1666..95d22ff6f 100644 --- a/website/pokemon/modules/Scalar.ts +++ b/website/pokemon/modules/Scalar.ts @@ -1,3 +1,17 @@ -import type * as $$Utilities from 'graffle/utilities-for-generated' +import type * as $$Utilities from "graffle/utilities-for-generated"; -export * from 'graffle/generator-helpers/standard-scalar-types' +export * from "graffle/generator-helpers/standard-scalar-types"; + +// +// +// +// +// CUSTOM SCALAR TYPE +// DATE +// -------------------------------------------------------------------------------------------------- +// Date +// -------------------------------------------------------------------------------------------------- +// +// + +export type Date = $$Utilities.Schema.Scalar.ScalarCodecless<"Date">; diff --git a/website/pokemon/modules/Schema.ts b/website/pokemon/modules/Schema.ts index 7cfa353b0..1cc47e4ba 100644 --- a/website/pokemon/modules/Schema.ts +++ b/website/pokemon/modules/Schema.ts @@ -1,8 +1,8 @@ -import type { Schema as $ } from 'graffle/utilities-for-generated' -import type * as $$Utilities from 'graffle/utilities-for-generated' -import type * as Data from './Data.js' -import type * as MethodsRoot from './MethodsRoot.js' -import type * as $Scalar from './Scalar.js' +import type { Schema as $ } from "graffle/utilities-for-generated"; +import type * as $$Utilities from "graffle/utilities-for-generated"; +import type * as Data from "./Data.js"; +import type * as $Scalar from "./Scalar.js"; + export namespace Schema { // // @@ -20,47 +20,167 @@ export namespace Schema { // // - export type Mutation = $.StandardTypes.Mutation<{ - addPokemon: $.OutputField< - 'addPokemon', - $.Nullable, - $.Args<{ - attack: $.InputField<$.Nullable<$Scalar.Int>> - defense: $.InputField<$.Nullable<$Scalar.Int>> - hp: $.InputField<$.Nullable<$Scalar.Int>> - name: $.InputField<$Scalar.String> - type: $.InputField - }, false> - > - }> + // Query + // -------------------------------------------------------------------------------------------------- + // + + export interface Query extends $.OutputObject { + name: "Query"; + fields: { + __typename: Query.__typename; + battles: Query.battles; + beings: Query.beings; + pokemon: Query.pokemon; + pokemonByName: Query.pokemonByName; + pokemons: Query.pokemons; + trainerByName: Query.trainerByName; + trainers: Query.trainers; + }; + } + + export namespace Query { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Query"; + }; + } + + export interface battles extends $.OutputField { + name: "battles"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Battle; + } + + export interface beings extends $.OutputField { + name: "beings"; + arguments: {}; + inlineType: [1, [1]]; + namedType: $$NamedTypes.$$Being; + } - export type Query = $.StandardTypes.Query<{ - battles: $.OutputField<'battles', $.List, null> - beings: $.OutputField<'beings', $.List, null> - pokemon: $.OutputField<'pokemon', $.Nullable<$.List>, null> - pokemonByName: $.OutputField< - 'pokemonByName', - $.Nullable<$.List>, - $.Args<{ - name: $.InputField<$Scalar.String> - }, false> - > - pokemons: $.OutputField< - 'pokemons', - $.Nullable<$.List>, - $.Args<{ - filter: $.InputField<$.Nullable> - }, true> - > - trainerByName: $.OutputField< - 'trainerByName', - $.Nullable, - $.Args<{ - name: $.InputField<$Scalar.String> - }, false> - > - trainers: $.OutputField<'trainers', $.Nullable<$.List>, null> - }> + export interface pokemon extends $.OutputField { + name: "pokemon"; + arguments: {}; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Pokemon; + } + + export interface pokemonByName extends $.OutputField { + name: "pokemonByName"; + arguments: { + name: { + kind: "InputField"; + name: "name"; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + }; + }; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Pokemon; + } + + export interface pokemons extends $.OutputField { + name: "pokemons"; + arguments: { + filter: { + kind: "InputField"; + name: "filter"; + inlineType: [0]; + namedType: $$NamedTypes.$$PokemonFilter; + }; + }; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Pokemon; + } + + export interface trainerByName extends $.OutputField { + name: "trainerByName"; + arguments: { + name: { + kind: "InputField"; + name: "name"; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + }; + }; + inlineType: [0]; + namedType: $$NamedTypes.$$Trainer; + } + + export interface trainers extends $.OutputField { + name: "trainers"; + arguments: {}; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Trainer; + } + } + + // Mutation + // -------------------------------------------------------------------------------------------------- + // + + export interface Mutation extends $.OutputObject { + name: "Mutation"; + fields: { + __typename: Mutation.__typename; + addPokemon: Mutation.addPokemon; + }; + } + + export namespace Mutation { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Mutation"; + }; + } + + export interface addPokemon extends $.OutputField { + name: "addPokemon"; + arguments: { + attack: { + kind: "InputField"; + name: "attack"; + inlineType: [0]; + namedType: $$NamedTypes.$$Int; + }; + defense: { + kind: "InputField"; + name: "defense"; + inlineType: [0]; + namedType: $$NamedTypes.$$Int; + }; + hp: { + kind: "InputField"; + name: "hp"; + inlineType: [0]; + namedType: $$NamedTypes.$$Int; + }; + name: { + kind: "InputField"; + name: "name"; + inlineType: [1]; + namedType: $$NamedTypes.$$String; + }; + type: { + kind: "InputField"; + name: "type"; + inlineType: [1]; + namedType: $$NamedTypes.$$PokemonType; + }; + }; + inlineType: [0]; + namedType: $$NamedTypes.$$Pokemon; + } + } // // @@ -78,64 +198,469 @@ export namespace Schema { // // - export type BattleRoyale = $.OutputObject<'BattleRoyale', { - combatants: $.OutputField<'combatants', $.Nullable<$.List>, null> - date: $.OutputField<'date', $.Nullable<$Scalar.Float>, null> - id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> - winner: $.OutputField<'winner', $.Nullable, null> - }> + // BattleRoyale + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleRoyale extends $.OutputObject { + name: "BattleRoyale"; + fields: { + __typename: BattleRoyale.__typename; + combatants: BattleRoyale.combatants; + date: BattleRoyale.date; + id: BattleRoyale.id; + winner: BattleRoyale.winner; + }; + } + + export namespace BattleRoyale { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "BattleRoyale"; + }; + } + + export interface combatants extends $.OutputField { + name: "combatants"; + arguments: {}; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$CombatantMultiPokemon; + } + + export interface date extends $.OutputField { + name: "date"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Float; + } + + export interface id extends $.OutputField { + name: "id"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$ID; + } + + export interface winner extends $.OutputField { + name: "winner"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Trainer; + } + } + + // BattleTrainer + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleTrainer extends $.OutputObject { + name: "BattleTrainer"; + fields: { + __typename: BattleTrainer.__typename; + combatant1: BattleTrainer.combatant1; + combatant2: BattleTrainer.combatant2; + date: BattleTrainer.date; + id: BattleTrainer.id; + winner: BattleTrainer.winner; + }; + } + + export namespace BattleTrainer { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "BattleTrainer"; + }; + } + + export interface combatant1 extends $.OutputField { + name: "combatant1"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$CombatantSinglePokemon; + } + + export interface combatant2 extends $.OutputField { + name: "combatant2"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$CombatantSinglePokemon; + } + + export interface date extends $.OutputField { + name: "date"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Float; + } + + export interface id extends $.OutputField { + name: "id"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$ID; + } + + export interface winner extends $.OutputField { + name: "winner"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Trainer; + } + } + + // BattleWild + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleWild extends $.OutputObject { + name: "BattleWild"; + fields: { + __typename: BattleWild.__typename; + date: BattleWild.date; + id: BattleWild.id; + pokemon: BattleWild.pokemon; + result: BattleWild.result; + trainer: BattleWild.trainer; + wildPokemons: BattleWild.wildPokemons; + }; + } + + export namespace BattleWild { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "BattleWild"; + }; + } + + export interface date extends $.OutputField { + name: "date"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Float; + } + + export interface id extends $.OutputField { + name: "id"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$ID; + } + + export interface pokemon extends $.OutputField { + name: "pokemon"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Pokemon; + } + + export interface result extends $.OutputField { + name: "result"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$BattleWildResult; + } + + export interface trainer extends $.OutputField { + name: "trainer"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Trainer; + } + + export interface wildPokemons extends $.OutputField { + name: "wildPokemons"; + arguments: {}; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Pokemon; + } + } + + // CombatantMultiPokemon + // -------------------------------------------------------------------------------------------------- + // + + export interface CombatantMultiPokemon extends $.OutputObject { + name: "CombatantMultiPokemon"; + fields: { + __typename: CombatantMultiPokemon.__typename; + pokemons: CombatantMultiPokemon.pokemons; + trainer: CombatantMultiPokemon.trainer; + }; + } + + export namespace CombatantMultiPokemon { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "CombatantMultiPokemon"; + }; + } + + export interface pokemons extends $.OutputField { + name: "pokemons"; + arguments: {}; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Pokemon; + } + + export interface trainer extends $.OutputField { + name: "trainer"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Trainer; + } + } + + // CombatantSinglePokemon + // -------------------------------------------------------------------------------------------------- + // + + export interface CombatantSinglePokemon extends $.OutputObject { + name: "CombatantSinglePokemon"; + fields: { + __typename: CombatantSinglePokemon.__typename; + pokemon: CombatantSinglePokemon.pokemon; + trainer: CombatantSinglePokemon.trainer; + }; + } + + export namespace CombatantSinglePokemon { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "CombatantSinglePokemon"; + }; + } + + export interface pokemon extends $.OutputField { + name: "pokemon"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Pokemon; + } + + export interface trainer extends $.OutputField { + name: "trainer"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Trainer; + } + } + + // Patron + // -------------------------------------------------------------------------------------------------- + // + + export interface Patron extends $.OutputObject { + name: "Patron"; + fields: { + __typename: Patron.__typename; + id: Patron.id; + money: Patron.money; + name: Patron.name; + }; + } + + export namespace Patron { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Patron"; + }; + } + + export interface id extends $.OutputField { + name: "id"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$ID; + } + + export interface money extends $.OutputField { + name: "money"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Int; + } + + export interface name extends $.OutputField { + name: "name"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } + } + + // Pokemon + // -------------------------------------------------------------------------------------------------- + // + + export interface Pokemon extends $.OutputObject { + name: "Pokemon"; + fields: { + __typename: Pokemon.__typename; + attack: Pokemon.attack; + birthday: Pokemon.birthday; + defense: Pokemon.defense; + hp: Pokemon.hp; + id: Pokemon.id; + name: Pokemon.name; + trainer: Pokemon.trainer; + type: Pokemon.type; + }; + } + + export namespace Pokemon { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Pokemon"; + }; + } - export type BattleTrainer = $.OutputObject<'BattleTrainer', { - combatant1: $.OutputField<'combatant1', $.Nullable, null> - combatant2: $.OutputField<'combatant2', $.Nullable, null> - date: $.OutputField<'date', $.Nullable<$Scalar.Float>, null> - id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> - winner: $.OutputField<'winner', $.Nullable, null> - }> + export interface attack extends $.OutputField { + name: "attack"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Int; + } - export type BattleWild = $.OutputObject<'BattleWild', { - date: $.OutputField<'date', $.Nullable<$Scalar.Float>, null> - id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> - pokemon: $.OutputField<'pokemon', $.Nullable, null> - result: $.OutputField<'result', $.Nullable, null> - trainer: $.OutputField<'trainer', $.Nullable, null> - wildPokemons: $.OutputField<'wildPokemons', $.Nullable<$.List>, null> - }> + export interface birthday extends $.OutputField { + name: "birthday"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Date; + } - export type CombatantMultiPokemon = $.OutputObject<'CombatantMultiPokemon', { - pokemons: $.OutputField<'pokemons', $.Nullable<$.List>, null> - trainer: $.OutputField<'trainer', $.Nullable, null> - }> + export interface defense extends $.OutputField { + name: "defense"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Int; + } - export type CombatantSinglePokemon = $.OutputObject<'CombatantSinglePokemon', { - pokemon: $.OutputField<'pokemon', $.Nullable, null> - trainer: $.OutputField<'trainer', $.Nullable, null> - }> + export interface hp extends $.OutputField { + name: "hp"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Int; + } - export type Patron = $.OutputObject<'Patron', { - id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> - money: $.OutputField<'money', $.Nullable<$Scalar.Int>, null> - name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> - }> + export interface id extends $.OutputField { + name: "id"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$ID; + } - export type Pokemon = $.OutputObject<'Pokemon', { - attack: $.OutputField<'attack', $.Nullable<$Scalar.Int>, null> - birthday: $.OutputField<'birthday', $.Nullable<$Scalar.Int>, null> - defense: $.OutputField<'defense', $.Nullable<$Scalar.Int>, null> - hp: $.OutputField<'hp', $.Nullable<$Scalar.Int>, null> - id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> - name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> - trainer: $.OutputField<'trainer', $.Nullable, null> - type: $.OutputField<'type', $.Nullable, null> - }> + export interface name extends $.OutputField { + name: "name"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } - export type Trainer = $.OutputObject<'Trainer', { - class: $.OutputField<'class', $.Nullable, null> - fans: $.OutputField<'fans', $.Nullable<$.List>, null> - id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> - name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> - pokemon: $.OutputField<'pokemon', $.Nullable<$.List>, null> - }> + export interface trainer extends $.OutputField { + name: "trainer"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$Trainer; + } + + export interface type extends $.OutputField { + name: "type"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$PokemonType; + } + } + + // Trainer + // -------------------------------------------------------------------------------------------------- + // + + export interface Trainer extends $.OutputObject { + name: "Trainer"; + fields: { + __typename: Trainer.__typename; + class: Trainer.$class; + fans: Trainer.fans; + id: Trainer.id; + name: Trainer.name; + pokemon: Trainer.pokemon; + }; + } + + export namespace Trainer { + export interface __typename extends $.OutputField { + name: "__typename"; + arguments: {}; + inlineType: [1]; + namedType: { + kind: "__typename"; + value: "Trainer"; + }; + } + + export interface $class extends $.OutputField { + name: "class"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$TrainerClass; + } + + export interface fans extends $.OutputField { + name: "fans"; + arguments: {}; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Patron; + } + + export interface id extends $.OutputField { + name: "id"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$ID; + } + + export interface name extends $.OutputField { + name: "name"; + arguments: {}; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } + + export interface pokemon extends $.OutputField { + name: "pokemon"; + arguments: {}; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$Pokemon; + } + } // // @@ -153,20 +678,86 @@ export namespace Schema { // // - export type DateFilter = $.InputObject<'DateFilter', { - gte: $.InputField<$.Nullable<$Scalar.Float>> - lte: $.InputField<$.Nullable<$Scalar.Float>> - }, true> + // DateFilter + // -------------------------------------------------------------------------------------------------- + // + + export interface DateFilter extends $.InputObject { + name: "DateFilter"; + isAllFieldsNullable: true; + fields: { + gte: DateFilter.gte; + lte: DateFilter.lte; + }; + } - export type PokemonFilter = $.InputObject<'PokemonFilter', { - birthday: $.InputField<$.Nullable> - name: $.InputField<$.Nullable> - }, true> + export namespace DateFilter { + export interface gte extends $.InputField { + name: "gte"; + inlineType: [0]; + namedType: $$NamedTypes.$$Date; + } - export type StringFilter = $.InputObject<'StringFilter', { - contains: $.InputField<$.Nullable<$Scalar.String>> - in: $.InputField<$.Nullable<$.List<$Scalar.String>>> - }, true> + export interface lte extends $.InputField { + name: "lte"; + inlineType: [0]; + namedType: $$NamedTypes.$$Date; + } + } + + // PokemonFilter + // -------------------------------------------------------------------------------------------------- + // + + export interface PokemonFilter extends $.InputObject { + name: "PokemonFilter"; + isAllFieldsNullable: true; + fields: { + birthday: PokemonFilter.birthday; + name: PokemonFilter.name; + }; + } + + export namespace PokemonFilter { + export interface birthday extends $.InputField { + name: "birthday"; + inlineType: [0]; + namedType: $$NamedTypes.$$DateFilter; + } + + export interface name extends $.InputField { + name: "name"; + inlineType: [0]; + namedType: $$NamedTypes.$$StringFilter; + } + } + + // StringFilter + // -------------------------------------------------------------------------------------------------- + // + + export interface StringFilter extends $.InputObject { + name: "StringFilter"; + isAllFieldsNullable: true; + fields: { + contains: StringFilter.contains; + in: StringFilter.$in; + }; + } + + export namespace StringFilter { + export interface contains extends $.InputField { + name: "contains"; + inlineType: [0]; + namedType: $$NamedTypes.$$String; + } + + export interface $in extends $.InputField { + name: "in"; + inlineType: [0, [1]]; + namedType: $$NamedTypes.$$String; + } + } // // @@ -184,10 +775,23 @@ export namespace Schema { // // - export type Being = $.Interface<'Being', { - id: $.OutputField<'id', $.Nullable<$Scalar.ID>, null> - name: $.OutputField<'name', $.Nullable<$Scalar.String>, null> - }, [Patron, Pokemon, Trainer]> + // Being + // -------------------------------------------------------------------------------------------------- + // + + export interface Being extends $.Interface { + name: "Being"; + implementors: [Patron, Pokemon, Trainer]; + implementorsUnion: + | Patron + | Pokemon + | Trainer; + implementorsIndex: { + Patron: Patron; + Pokemon: Pokemon; + Trainer: Trainer; + }; + } // // @@ -205,7 +809,23 @@ export namespace Schema { // // - export type Battle = $.Union<'Battle', [BattleRoyale, BattleTrainer, BattleWild]> + // Battle + // -------------------------------------------------------------------------------------------------- + // + + export interface Battle extends $.Union { + name: "Battle"; + members: [BattleRoyale, BattleTrainer, BattleWild]; + membersUnion: + | BattleRoyale + | BattleTrainer + | BattleWild; + membersIndex: { + BattleRoyale: BattleRoyale; + BattleTrainer: BattleTrainer; + BattleWild: BattleWild; + }; + } // // @@ -223,28 +843,189 @@ export namespace Schema { // // - export type BattleWildResult = $.Enum<'BattleWildResult', ['pokemonsCaptured', 'pokemonsDefeated', 'trainerDefeated']> + // BattleWildResult + // -------------------------------------------------------------------------------------------------- + // + + export interface BattleWildResult extends $.Enum { + name: "BattleWildResult"; + members: ["pokemonsCaptured", "pokemonsDefeated", "trainerDefeated"]; + membersUnion: + | "pokemonsCaptured" + | "pokemonsDefeated" + | "trainerDefeated"; + } + + // PokemonType + // -------------------------------------------------------------------------------------------------- + // + + export interface PokemonType extends $.Enum { + name: "PokemonType"; + members: ["bug", "electric", "fire", "grass", "water"]; + membersUnion: + | "bug" + | "electric" + | "fire" + | "grass" + | "water"; + } + + // TrainerClass + // -------------------------------------------------------------------------------------------------- + // + + export interface TrainerClass extends $.Enum { + name: "TrainerClass"; + members: [ + "bugCatcher", + "camper", + "picnicker", + "psychic", + "psychicMedium", + "psychicYoungster", + "sailor", + "superNerd", + "tamer", + "teamRocketGrunt", + "triathlete", + "youngster", + "youth", + ]; + membersUnion: + | "bugCatcher" + | "camper" + | "picnicker" + | "psychic" + | "psychicMedium" + | "psychicYoungster" + | "sailor" + | "superNerd" + | "tamer" + | "teamRocketGrunt" + | "triathlete" + | "youngster" + | "youth"; + } + + // + // + // + // + // + // + // ================================================================================================== + // ScalarCustom + // ================================================================================================== + // + // + // + // + // + // + + // Date + // -------------------------------------------------------------------------------------------------- + // - export type PokemonType = $.Enum<'PokemonType', ['bug', 'electric', 'fire', 'grass', 'water']> + export type Date = $Scalar.Date; - export type TrainerClass = $.Enum< - 'TrainerClass', - [ - 'bugCatcher', - 'camper', - 'picnicker', - 'psychic', - 'psychicMedium', - 'psychicYoungster', - 'sailor', - 'superNerd', - 'tamer', - 'teamRocketGrunt', - 'triathlete', - 'youngster', - 'youth', - ] - > + // + // + // + // + // + // + // ================================================================================================== + // ScalarStandard + // ================================================================================================== + // + // + // + // + // + // + + // Float + // -------------------------------------------------------------------------------------------------- + // + + export type Float = $.StandardTypes.Float; + + // ID + // -------------------------------------------------------------------------------------------------- + // + + export type ID = $.StandardTypes.ID; + + // String + // -------------------------------------------------------------------------------------------------- + // + + export type String = $.StandardTypes.String; + + // Int + // -------------------------------------------------------------------------------------------------- + // + + export type Int = $.StandardTypes.Int; + + // Boolean + // -------------------------------------------------------------------------------------------------- + // + + export type Boolean = $.StandardTypes.Boolean; + + // + // + // + // + // + // + // ================================================================================================== + // Named Types Index + // ================================================================================================== + // + // + // + // + // + // + + /** + * [1] These definitions serve to allow field selection interfaces to extend their respective object type without + * name clashing between the field name and the object name. + * + * For example imagine `Query.Foo` field with type also called `Foo`. Our generated interfaces for each field + * would end up with an error of `export interface Foo extends Foo ...` + */ + + namespace $$NamedTypes { + export type $$Query = Query; + export type $$Mutation = Mutation; + export type $$BattleRoyale = BattleRoyale; + export type $$BattleTrainer = BattleTrainer; + export type $$BattleWild = BattleWild; + export type $$CombatantMultiPokemon = CombatantMultiPokemon; + export type $$CombatantSinglePokemon = CombatantSinglePokemon; + export type $$Patron = Patron; + export type $$Pokemon = Pokemon; + export type $$Trainer = Trainer; + export type $$DateFilter = DateFilter; + export type $$PokemonFilter = PokemonFilter; + export type $$StringFilter = StringFilter; + export type $$Being = Being; + export type $$Battle = Battle; + export type $$BattleWildResult = BattleWildResult; + export type $$PokemonType = PokemonType; + export type $$TrainerClass = TrainerClass; + export type $$Date = Date; + export type $$Float = Float; + export type $$ID = ID; + export type $$String = String; + export type $$Int = Int; + export type $$Boolean = Boolean; + } } // @@ -262,48 +1043,53 @@ export namespace Schema { // // // -export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $$Utilities.Schema { - name: Data.Name - RootTypesPresent: ['Mutation', 'Query'] - RootUnion: Schema.Mutation | Schema.Query + +export interface Schema<$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $ +{ + name: Data.Name; + operationsAvailable: ["query", "mutation"]; + RootUnion: + | Schema.Query + | Schema.Mutation; Root: { - Query: Schema.Query - Mutation: Schema.Mutation - Subscription: null - } + query: Schema.Query; + mutation: Schema.Mutation; + subscription: null; + }; allTypes: { - Mutation: Schema.Mutation - Query: Schema.Query - BattleWildResult: Schema.BattleWildResult - PokemonType: Schema.PokemonType - TrainerClass: Schema.TrainerClass - BattleRoyale: Schema.BattleRoyale - BattleTrainer: Schema.BattleTrainer - BattleWild: Schema.BattleWild - CombatantMultiPokemon: Schema.CombatantMultiPokemon - CombatantSinglePokemon: Schema.CombatantSinglePokemon - Patron: Schema.Patron - Pokemon: Schema.Pokemon - Trainer: Schema.Trainer - Battle: Schema.Battle - Being: Schema.Being - } + Query: Schema.Query; + Mutation: Schema.Mutation; + BattleWildResult: Schema.BattleWildResult; + PokemonType: Schema.PokemonType; + TrainerClass: Schema.TrainerClass; + BattleRoyale: Schema.BattleRoyale; + BattleTrainer: Schema.BattleTrainer; + BattleWild: Schema.BattleWild; + CombatantMultiPokemon: Schema.CombatantMultiPokemon; + CombatantSinglePokemon: Schema.CombatantSinglePokemon; + Patron: Schema.Patron; + Pokemon: Schema.Pokemon; + Trainer: Schema.Trainer; + Battle: Schema.Battle; + Being: Schema.Being; + }; objects: { - BattleRoyale: Schema.BattleRoyale - BattleTrainer: Schema.BattleTrainer - BattleWild: Schema.BattleWild - CombatantMultiPokemon: Schema.CombatantMultiPokemon - CombatantSinglePokemon: Schema.CombatantSinglePokemon - Patron: Schema.Patron - Pokemon: Schema.Pokemon - Trainer: Schema.Trainer - } + BattleRoyale: Schema.BattleRoyale; + BattleTrainer: Schema.BattleTrainer; + BattleWild: Schema.BattleWild; + CombatantMultiPokemon: Schema.CombatantMultiPokemon; + CombatantSinglePokemon: Schema.CombatantSinglePokemon; + Patron: Schema.Patron; + Pokemon: Schema.Pokemon; + Trainer: Schema.Trainer; + }; unions: { - Battle: Schema.Battle - } + Battle: Schema.Battle; + }; interfaces: { - Being: Schema.Being - } - scalars: $Scalars - extensions: $$Utilities.GlobalRegistry.TypeExtensions + Being: Schema.Being; + }; + scalars: $Scalars; + extensions: $$Utilities.GlobalRegistry.TypeExtensions; } diff --git a/website/pokemon/modules/SchemaDrivenDataMap.ts b/website/pokemon/modules/SchemaDrivenDataMap.ts index 86e3ac136..961d8329e 100644 --- a/website/pokemon/modules/SchemaDrivenDataMap.ts +++ b/website/pokemon/modules/SchemaDrivenDataMap.ts @@ -1,5 +1,5 @@ -import type * as $$Utilities from 'graffle/utilities-for-generated' -import * as $Scalar from './Scalar.js' +import type * as $$Utilities from "graffle/utilities-for-generated"; +import * as $Scalar from "./Scalar.js"; // // // @@ -16,15 +16,15 @@ import * as $Scalar from './Scalar.js' // // -const Float = $Scalar.Float +const Float = $Scalar.Float; -const ID = $Scalar.ID +const ID = $Scalar.ID; -const String = $Scalar.String +const String = $Scalar.String; -const Int = $Scalar.Int +const Int = $Scalar.Int; -const Boolean = $Scalar.Boolean +const Boolean = $Scalar.Boolean; // // @@ -42,7 +42,7 @@ const Boolean = $Scalar.Boolean // // -// None of your ScalarCustoms have custom scalars. +const Date = "Date"; // // @@ -61,19 +61,19 @@ const Boolean = $Scalar.Boolean // const BattleWildResult: $$Utilities.SchemaDrivenDataMap.Enum = { - k: 'enum', - n: 'BattleWildResult', -} + k: "enum", + n: "BattleWildResult", +}; const PokemonType: $$Utilities.SchemaDrivenDataMap.Enum = { - k: 'enum', - n: 'PokemonType', -} + k: "enum", + n: "PokemonType", +}; const TrainerClass: $$Utilities.SchemaDrivenDataMap.Enum = { - k: 'enum', - n: 'TrainerClass', -} + k: "enum", + n: "TrainerClass", +}; // // @@ -92,28 +92,36 @@ const TrainerClass: $$Utilities.SchemaDrivenDataMap.Enum = { // const DateFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { - n: 'DateFilter', + n: "DateFilter", + fcs: ["gte", "lte"], f: { - gte: {}, - lte: {}, + gte: { + nt: Date, + }, + lte: { + nt: Date, + }, }, -} +}; const PokemonFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { - n: 'PokemonFilter', + n: "PokemonFilter", + fcs: ["birthday"], f: { - birthday: {}, + birthday: { + // nt: DateFilter, <-- Assigned later to avoid potential circular dependency. + }, name: {}, }, -} +}; const StringFilter: $$Utilities.SchemaDrivenDataMap.InputObject = { - n: 'StringFilter', + n: "StringFilter", f: { contains: {}, in: {}, }, -} +}; // // @@ -142,7 +150,7 @@ const BattleRoyale: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Trainer, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; const BattleTrainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -158,7 +166,7 @@ const BattleTrainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Trainer, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; const BattleWild: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -175,7 +183,7 @@ const BattleWild: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; const CombatantMultiPokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -186,7 +194,7 @@ const CombatantMultiPokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Trainer, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; const CombatantSinglePokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -197,7 +205,7 @@ const CombatantSinglePokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Trainer, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; const Patron: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -205,12 +213,14 @@ const Patron: $$Utilities.SchemaDrivenDataMap.OutputObject = { money: {}, name: {}, }, -} +}; const Pokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { attack: {}, - birthday: {}, + birthday: { + nt: Date, + }, defense: {}, hp: {}, id: {}, @@ -220,7 +230,7 @@ const Pokemon: $$Utilities.SchemaDrivenDataMap.OutputObject = { }, type: {}, }, -} +}; const Trainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { @@ -234,7 +244,7 @@ const Trainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; // // @@ -253,8 +263,11 @@ const Trainer: $$Utilities.SchemaDrivenDataMap.OutputObject = { // const Being: $$Utilities.SchemaDrivenDataMap.OutputObject = { - f: {}, -} + f: { + ...Pokemon.f, + ...Trainer.f, + }, +}; // // @@ -273,8 +286,12 @@ const Being: $$Utilities.SchemaDrivenDataMap.OutputObject = { // const Battle: $$Utilities.SchemaDrivenDataMap.OutputObject = { - f: {}, -} + f: { + ...BattleRoyale.f, + ...BattleTrainer.f, + ...BattleWild.f, + }, +}; // // @@ -292,36 +309,6 @@ const Battle: $$Utilities.SchemaDrivenDataMap.OutputObject = { // // -const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { - f: { - addPokemon: { - a: { - attack: { - nt: Int, - it: [0], - }, - defense: { - nt: Int, - it: [0], - }, - hp: { - nt: Int, - it: [0], - }, - name: { - nt: String, - it: [1], - }, - type: { - nt: PokemonType, - it: [1], - }, - }, - // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. - }, - }, -} - const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { f: { battles: { @@ -364,7 +351,37 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { // nt: Trainer, <-- Assigned later to avoid potential circular dependency. }, }, -} +}; + +const Mutation: $$Utilities.SchemaDrivenDataMap.OutputObject = { + f: { + addPokemon: { + a: { + attack: { + nt: Int, + it: [0], + }, + defense: { + nt: Int, + it: [0], + }, + hp: { + nt: Int, + it: [0], + }, + name: { + nt: String, + it: [1], + }, + type: { + nt: PokemonType, + it: [1], + }, + }, + // nt: Pokemon, <-- Assigned later to avoid potential circular dependency. + }, + }, +}; // // @@ -383,29 +400,30 @@ const Query: $$Utilities.SchemaDrivenDataMap.OutputObject = { // // -BattleRoyale.f[`combatants`]!.nt = CombatantMultiPokemon -BattleRoyale.f[`winner`]!.nt = Trainer -BattleTrainer.f[`combatant1`]!.nt = CombatantSinglePokemon -BattleTrainer.f[`combatant2`]!.nt = CombatantSinglePokemon -BattleTrainer.f[`winner`]!.nt = Trainer -BattleWild.f[`pokemon`]!.nt = Pokemon -BattleWild.f[`trainer`]!.nt = Trainer -BattleWild.f[`wildPokemons`]!.nt = Pokemon -CombatantMultiPokemon.f[`pokemons`]!.nt = Pokemon -CombatantMultiPokemon.f[`trainer`]!.nt = Trainer -CombatantSinglePokemon.f[`pokemon`]!.nt = Pokemon -CombatantSinglePokemon.f[`trainer`]!.nt = Trainer -Pokemon.f[`trainer`]!.nt = Trainer -Trainer.f[`fans`]!.nt = Patron -Trainer.f[`pokemon`]!.nt = Pokemon -Mutation.f[`addPokemon`]!.nt = Pokemon -Query.f[`battles`]!.nt = Battle -Query.f[`beings`]!.nt = Being -Query.f[`pokemon`]!.nt = Pokemon -Query.f[`pokemonByName`]!.nt = Pokemon -Query.f[`pokemons`]!.nt = Pokemon -Query.f[`trainerByName`]!.nt = Trainer -Query.f[`trainers`]!.nt = Trainer +PokemonFilter.f![`birthday`]!.nt = DateFilter; +BattleRoyale.f[`combatants`]!.nt = CombatantMultiPokemon; +BattleRoyale.f[`winner`]!.nt = Trainer; +BattleTrainer.f[`combatant1`]!.nt = CombatantSinglePokemon; +BattleTrainer.f[`combatant2`]!.nt = CombatantSinglePokemon; +BattleTrainer.f[`winner`]!.nt = Trainer; +BattleWild.f[`pokemon`]!.nt = Pokemon; +BattleWild.f[`trainer`]!.nt = Trainer; +BattleWild.f[`wildPokemons`]!.nt = Pokemon; +CombatantMultiPokemon.f[`pokemons`]!.nt = Pokemon; +CombatantMultiPokemon.f[`trainer`]!.nt = Trainer; +CombatantSinglePokemon.f[`pokemon`]!.nt = Pokemon; +CombatantSinglePokemon.f[`trainer`]!.nt = Trainer; +Pokemon.f[`trainer`]!.nt = Trainer; +Trainer.f[`fans`]!.nt = Patron; +Trainer.f[`pokemon`]!.nt = Pokemon; +Query.f[`battles`]!.nt = Battle; +Query.f[`beings`]!.nt = Being; +Query.f[`pokemon`]!.nt = Pokemon; +Query.f[`pokemonByName`]!.nt = Pokemon; +Query.f[`pokemons`]!.nt = Pokemon; +Query.f[`trainerByName`]!.nt = Trainer; +Query.f[`trainers`]!.nt = Trainer; +Mutation.f[`addPokemon`]!.nt = Pokemon; // // @@ -424,9 +442,9 @@ Query.f[`trainers`]!.nt = Trainer // const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { - roots: { - Mutation, - Query, + operations: { + query: Query, + mutation: Mutation, }, directives: {}, types: { @@ -435,6 +453,7 @@ const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { String, Int, Boolean, + Date, BattleWildResult, PokemonType, TrainerClass, @@ -451,9 +470,9 @@ const $schemaDrivenDataMap: $$Utilities.SchemaDrivenDataMap = { Trainer, Being, Battle, - Mutation, Query, + Mutation, }, -} +}; -export { $schemaDrivenDataMap as schemaDrivenDataMap } +export { $schemaDrivenDataMap as schemaDrivenDataMap }; diff --git a/website/pokemon/modules/SchemaRuntime.ts b/website/pokemon/modules/SchemaRuntime.ts index 72d27156b..d4edf9aa8 100644 --- a/website/pokemon/modules/SchemaRuntime.ts +++ b/website/pokemon/modules/SchemaRuntime.ts @@ -173,7 +173,7 @@ export const Query = $.Object$(`Query`, { }) export const $Index: Index = { name: Data.Name, - RootTypesPresent: ['Mutation', 'Query'] as const, + operationsAvailable: ['Mutation', 'Query'] as const, RootUnion: undefined as any, // Type level only. Root: { Query, diff --git a/website/pokemon/modules/Select.ts b/website/pokemon/modules/Select.ts index 78578a1b4..06bba5604 100644 --- a/website/pokemon/modules/Select.ts +++ b/website/pokemon/modules/Select.ts @@ -1,7 +1,8 @@ -import type { InferResult } from 'graffle/schema' -import * as Data from './Data.js' -import type { Schema } from './Schema.js' -import type * as SelectionSets from './SelectionSets.js' +import type { InferResult } from "graffle/schema"; +import type { OperationTypeNode } from "graphql"; +import * as Data from "./Data.js"; +import type { Schema } from "./Schema.js"; +import type * as SelectionSets from "./SelectionSets.js"; // // @@ -18,8 +19,8 @@ import type * as SelectionSets from './SelectionSets.js' // // // -import { createSelect } from 'graffle/client' -export const Select = createSelect(Data.Name) +import { createSelect } from "graffle/client"; +export const Select = createSelect(Data.Name); // // @@ -38,68 +39,70 @@ export const Select = createSelect(Data.Name) // export namespace Select { - // Root Types - // ---------- - export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Root< + // Root + // -------------------------------------------------------------------------------------------------- + // + export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Operation< $SelectionSet, Schema, - 'Mutation' - > - export type Query<$SelectionSet extends SelectionSets.Query> = InferResult.Root<$SelectionSet, Schema, 'Query'> - // OutputObject Types - // ------------------ - export type BattleRoyale<$SelectionSet extends SelectionSets.BattleRoyale> = InferResult.Object< + OperationTypeNode.QUERY + >; + export type Mutation<$SelectionSet extends SelectionSets.Mutation> = InferResult.Operation< $SelectionSet, Schema, - Schema['allTypes']['BattleRoyale'] - > - export type BattleTrainer<$SelectionSet extends SelectionSets.BattleTrainer> = InferResult.Object< + OperationTypeNode.MUTATION + >; + // OutputObject + // -------------------------------------------------------------------------------------------------- + // + export type BattleRoyale<$SelectionSet extends SelectionSets.BattleRoyale> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['BattleTrainer'] - > - export type BattleWild<$SelectionSet extends SelectionSets.BattleWild> = InferResult.Object< + Schema["allTypes"]["BattleRoyale"] + >; + export type BattleTrainer<$SelectionSet extends SelectionSets.BattleTrainer> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['BattleWild'] - > - export type CombatantMultiPokemon<$SelectionSet extends SelectionSets.CombatantMultiPokemon> = InferResult.Object< + Schema["allTypes"]["BattleTrainer"] + >; + export type BattleWild<$SelectionSet extends SelectionSets.BattleWild> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['CombatantMultiPokemon'] - > - export type CombatantSinglePokemon<$SelectionSet extends SelectionSets.CombatantSinglePokemon> = InferResult.Object< + Schema["allTypes"]["BattleWild"] + >; + export type CombatantMultiPokemon<$SelectionSet extends SelectionSets.CombatantMultiPokemon> = + InferResult.OutputObject<$SelectionSet, Schema, Schema["allTypes"]["CombatantMultiPokemon"]>; + export type CombatantSinglePokemon<$SelectionSet extends SelectionSets.CombatantSinglePokemon> = + InferResult.OutputObject<$SelectionSet, Schema, Schema["allTypes"]["CombatantSinglePokemon"]>; + export type Patron<$SelectionSet extends SelectionSets.Patron> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['CombatantSinglePokemon'] - > - export type Patron<$SelectionSet extends SelectionSets.Patron> = InferResult.Object< + Schema["allTypes"]["Patron"] + >; + export type Pokemon<$SelectionSet extends SelectionSets.Pokemon> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['Patron'] - > - export type Pokemon<$SelectionSet extends SelectionSets.Pokemon> = InferResult.Object< + Schema["allTypes"]["Pokemon"] + >; + export type Trainer<$SelectionSet extends SelectionSets.Trainer> = InferResult.OutputObject< $SelectionSet, Schema, - Schema['allTypes']['Pokemon'] - > - export type Trainer<$SelectionSet extends SelectionSets.Trainer> = InferResult.Object< - $SelectionSet, - Schema, - Schema['allTypes']['Trainer'] - > - // Union Types - // ----------- + Schema["allTypes"]["Trainer"] + >; + // Union + // -------------------------------------------------------------------------------------------------- + // export type Battle<$SelectionSet extends SelectionSets.Battle> = InferResult.Union< $SelectionSet, Schema, - Schema['allTypes']['Battle'] - > - // Interface Types - // --------------- + Schema["allTypes"]["Battle"] + >; + // Interface + // -------------------------------------------------------------------------------------------------- + // export type Being<$SelectionSet extends SelectionSets.Being> = InferResult.Interface< $SelectionSet, Schema, - Schema['allTypes']['Being'] - > + Schema["allTypes"]["Being"] + >; } diff --git a/website/pokemon/modules/SelectionSets.ts b/website/pokemon/modules/SelectionSets.ts index 6cd92acc9..f248d99f3 100644 --- a/website/pokemon/modules/SelectionSets.ts +++ b/website/pokemon/modules/SelectionSets.ts @@ -1,5 +1,5 @@ -import type { Select as $Select } from 'graffle/schema' -import type * as $$Utilities from 'graffle/utilities-for-generated' +import type { Select as $Select } from "graffle/schema"; +import type * as $$Utilities from "graffle/utilities-for-generated"; // // @@ -17,10 +17,11 @@ import type * as $$Utilities from 'graffle/utilities-for-generated' // // -// Prefix with $ because this is not a schema type. A user could have a schema type named "Document" that this would conflict with. -export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - query?: Record> - mutation?: Record> +export interface $Document< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + query?: Record>; + mutation?: Record>; } // @@ -39,129 +40,43 @@ export interface $Document<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap // // -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- -// Mutation -// -------------------------------------------------------------------------------------------------- -// -// - -// ----------------------------------------| Entrypoint Interface | - -export interface Mutation<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - /** - * Select the `addPokemon` field on the `Mutation` object. Its type is `Pokemon` (a `OutputObject` kind of type). - */ - addPokemon?: Mutation.addPokemon<$Scalars> | $Select.SelectAlias.SelectAlias> - - /** - * Inline fragments for field groups. - * - * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the - * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. - * - * @see https://spec.graphql.org/draft/#sec-Inline-Fragments - */ - ___?: - | Mutation$FragmentInline<$Scalars> - | Mutation$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> -} - -export interface Mutation$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Mutation<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} - -// ----------------------------------------| Fields | - -export namespace Mutation { - export type addPokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = addPokemon$SelectionSet<$Scalars> - - export interface addPokemon$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - { - /** - * Arguments for `addPokemon` field. Some (2/5) arguments are required so you must include this. - */ - $: addPokemon$Arguments<$Scalars> - } - - export interface addPokemon$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - attack?: number | undefined | null - defense?: number | undefined | null - hp?: number | undefined | null - name: string - $type: $NamedTypes.$PokemonType - } - - // --- expanded --- - - /** - * This is the "expanded" version of the `addPokemon` type. It is identical except for the fact - * that IDEs will display its contents (a union type) directly, rather than the name of this type. - * In some cases, this is a preferable DX, making the types easier to read for users. - */ - export type addPokemon$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - addPokemon$SelectionSet<$Scalars> - > -} - -// -// -// -// -// GRAPHQL SELECTION SET -// ROOT -// -------------------------------------------------------------------------------------------------- // Query // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { +export interface Query< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { /** * Select the `battles` field on the `Query` object. Its type is `Battle` (a `Union` kind of type). */ - battles?: Query.battles$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + battles?: Query.battles$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `beings` field on the `Query` object. Its type is `Being` (a `Interface` kind of type). */ - beings?: Query.beings$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + beings?: Query.beings$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `pokemon` field on the `Query` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ - pokemon?: Query.pokemon$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + pokemon?: Query.pokemon$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `pokemonByName` field on the `Query` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ - pokemonByName?: Query.pokemonByName<$Scalars> | $Select.SelectAlias.SelectAlias> + pokemonByName?: Query.pokemonByName<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `pokemons` field on the `Query` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ - pokemons?: Query.pokemons$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + pokemons?: Query.pokemons$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `trainerByName` field on the `Query` object. Its type is `Trainer` (a `OutputObject` kind of type). */ - trainerByName?: Query.trainerByName<$Scalars> | $Select.SelectAlias.SelectAlias> + trainerByName?: Query.trainerByName<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `trainers` field on the `Query` object. Its type is `Trainer` (a `OutputObject` kind of type). */ - trainers?: Query.trainers$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + trainers?: Query.trainers$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -172,8 +87,8 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Query$FragmentInline<$Scalars> - | Query$FragmentInline<$Scalars>[] + | Query$FragmentInline<_$Scalars> + | Query$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -182,21 +97,23 @@ export interface Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Query$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Query<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Query$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Query<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Query { - export type battles<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = battles$SelectionSet<$Scalars> + export type battles<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + battles$SelectionSet<_$Scalars>; - export interface battles$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Battle<$Scalars> - {} + export interface battles$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Battle<_$Scalars> {} // --- expanded --- @@ -205,17 +122,20 @@ export namespace Query { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type battles$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - battles$SelectionSet<$Scalars> - > + export type battles$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + battles$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type beings<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = beings$SelectionSet<$Scalars> + export type beings<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + beings$SelectionSet<_$Scalars>; - export interface beings$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Being<$Scalars> - {} + export interface beings$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Being<_$Scalars> {} // --- expanded --- @@ -224,17 +144,20 @@ export namespace Query { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type beings$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - beings$SelectionSet<$Scalars> - > + export type beings$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + beings$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = pokemon$SelectionSet<$Scalars> + export type pokemon<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + pokemon$SelectionSet<_$Scalars>; - export interface pokemon$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - {} + export interface pokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} // --- expanded --- @@ -243,27 +166,31 @@ export namespace Query { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type pokemon$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - pokemon$SelectionSet<$Scalars> - > + export type pokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemon$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type pokemonByName<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = pokemonByName$SelectionSet< - $Scalars - > + export type pokemonByName< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = pokemonByName$SelectionSet<_$Scalars>; - export interface pokemonByName$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - { + export interface pokemonByName$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { /** * Arguments for `pokemonByName` field. All arguments are required so you must include this. */ - $: pokemonByName$Arguments<$Scalars> + $: pokemonByName$Arguments<_$Scalars>; } - export interface pokemonByName$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - name: string + export interface pokemonByName$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + name: string; } // --- expanded --- @@ -273,25 +200,31 @@ export namespace Query { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type pokemonByName$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - pokemonByName$SelectionSet<$Scalars> - > + export type pokemonByName$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemonByName$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type pokemons<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = pokemons$SelectionSet<$Scalars> + export type pokemons< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = pokemons$SelectionSet<_$Scalars>; - export interface pokemons$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - { + export interface pokemons$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { /** * Arguments for `pokemons` field. No arguments are required so you may omit this. */ - $?: pokemons$Arguments<$Scalars> + $?: pokemons$Arguments<_$Scalars>; } - export interface pokemons$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - filter?: $NamedTypes.$PokemonFilter<$Scalars> | undefined | null + export interface pokemons$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + filter?: $NamedTypes.$PokemonFilter<_$Scalars> | undefined | null; } // --- expanded --- @@ -301,27 +234,31 @@ export namespace Query { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type pokemons$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - pokemons$SelectionSet<$Scalars> - > + export type pokemons$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemons$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type trainerByName<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = trainerByName$SelectionSet< - $Scalars - > + export type trainerByName< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = trainerByName$SelectionSet<_$Scalars>; - export interface trainerByName$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - { + export interface trainerByName$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> { /** * Arguments for `trainerByName` field. All arguments are required so you must include this. */ - $: trainerByName$Arguments<$Scalars> + $: trainerByName$Arguments<_$Scalars>; } - export interface trainerByName$Arguments<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - name: string + export interface trainerByName$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + name: string; } // --- expanded --- @@ -331,17 +268,21 @@ export namespace Query { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type trainerByName$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - trainerByName$SelectionSet<$Scalars> - > + export type trainerByName$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainerByName$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type trainers<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = trainers$SelectionSet<$Scalars> + export type trainers< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = trainers$SelectionSet<_$Scalars>; - export interface trainers$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - {} + export interface trainers$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} // --- expanded --- @@ -350,9 +291,92 @@ export namespace Query { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type trainers$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - trainers$SelectionSet<$Scalars> - > + export type trainers$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainers$SelectionSet<_$Scalars> + >; +} + +// Mutation +// -------------------------------------------------------------------------------------------------- +// + +// ----------------------------------------| Entrypoint Interface | + +export interface Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * Select the `addPokemon` field on the `Mutation` object. Its type is `Pokemon` (a `OutputObject` kind of type). + */ + addPokemon?: Mutation.addPokemon<_$Scalars> | $Select.SelectAlias.SelectAlias>; + + /** + * Inline fragments for field groups. + * + * Generally a niche feature. This can be useful for example to apply an `@include` directive to a subset of the + * selection set in turn allowing you to pass a variable to opt in/out of that selection during execution on the server. + * + * @see https://spec.graphql.org/draft/#sec-Inline-Fragments + */ + ___?: + | Mutation$FragmentInline<_$Scalars> + | Mutation$FragmentInline<_$Scalars>[]; + + /** + * A meta field. Is the name of the type being selected. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; +} + +export interface Mutation$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Mutation<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} + +// ----------------------------------------| Fields | + +export namespace Mutation { + export type addPokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = addPokemon$SelectionSet<_$Scalars>; + + export interface addPokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> { + /** + * Arguments for `addPokemon` field. Some (2/5) arguments are required so you must include this. + */ + $: addPokemon$Arguments<_$Scalars>; + } + + export interface addPokemon$Arguments< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > { + attack?: number | undefined | null; + defense?: number | undefined | null; + hp?: number | undefined | null; + name: string; + $type: $NamedTypes.$PokemonType; + } + + // --- expanded --- + + /** + * This is the "expanded" version of the `addPokemon` type. It is identical except for the fact + * that IDEs will display its contents (a union type) directly, rather than the name of this type. + * In some cases, this is a preferable DX, making the types easier to read for users. + */ + export type addPokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + addPokemon$SelectionSet<_$Scalars> + >; } // @@ -371,24 +395,32 @@ export namespace Query { // // -export type BattleWildResult = 'pokemonsCaptured' | 'pokemonsDefeated' | 'trainerDefeated' +export type BattleWildResult = + | "pokemonsCaptured" + | "pokemonsDefeated" + | "trainerDefeated"; -export type PokemonType = 'bug' | 'electric' | 'fire' | 'grass' | 'water' +export type PokemonType = + | "bug" + | "electric" + | "fire" + | "grass" + | "water"; export type TrainerClass = - | 'bugCatcher' - | 'camper' - | 'picnicker' - | 'psychic' - | 'psychicMedium' - | 'psychicYoungster' - | 'sailor' - | 'superNerd' - | 'tamer' - | 'teamRocketGrunt' - | 'triathlete' - | 'youngster' - | 'youth' + | "bugCatcher" + | "camper" + | "picnicker" + | "psychic" + | "psychicMedium" + | "psychicYoungster" + | "sailor" + | "superNerd" + | "tamer" + | "teamRocketGrunt" + | "triathlete" + | "youngster" + | "youth"; // // @@ -406,19 +438,35 @@ export type TrainerClass = // // -export interface DateFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - gte?: number | undefined | null - lte?: number | undefined | null +export interface DateFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + gte?: + | $$Utilities.Schema.Scalar.GetDecoded< + $$Utilities.Schema.Scalar.LookupCustomScalarOrFallbackToString<"Date", _$Scalars> + > + | undefined + | null; + lte?: + | $$Utilities.Schema.Scalar.GetDecoded< + $$Utilities.Schema.Scalar.LookupCustomScalarOrFallbackToString<"Date", _$Scalars> + > + | undefined + | null; } -export interface PokemonFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - birthday?: $NamedTypes.$DateFilter<$Scalars> | undefined | null - name?: $NamedTypes.$StringFilter<$Scalars> | undefined | null +export interface PokemonFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + birthday?: $NamedTypes.$DateFilter<_$Scalars> | undefined | null; + name?: $NamedTypes.$StringFilter<_$Scalars> | undefined | null; } -export interface StringFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - contains?: string | undefined | null - in?: Array | undefined | null +export interface StringFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + contains?: string | undefined | null; + in?: Array | undefined | null; } // @@ -437,41 +485,33 @@ export interface StringFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarM // // -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // BattleRoyale // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface BattleRoyale<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ +export interface BattleRoyale< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `combatants` field on the `BattleRoyale` object. Its type is `CombatantMultiPokemon` (a `OutputObject` kind of type). */ combatants?: - | BattleRoyale.combatants$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | BattleRoyale.combatants$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Select the `date` field on the `BattleRoyale` object. Its type is `Float` (a `ScalarStandard` kind of type). */ - date?: BattleRoyale.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + date?: BattleRoyale.date$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `id` field on the `BattleRoyale` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - id?: BattleRoyale.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + id?: BattleRoyale.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `winner` field on the `BattleRoyale` object. Its type is `Trainer` (a `OutputObject` kind of type). */ - winner?: BattleRoyale.winner$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + winner?: BattleRoyale.winner$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -482,8 +522,8 @@ export interface BattleRoyale<$Scalars extends $$Utilities.Schema.Scalar.ScalarM * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | BattleRoyale$FragmentInline<$Scalars> - | BattleRoyale$FragmentInline<$Scalars>[] + | BattleRoyale$FragmentInline<_$Scalars> + | BattleRoyale$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -492,21 +532,24 @@ export interface BattleRoyale<$Scalars extends $$Utilities.Schema.Scalar.ScalarM */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface BattleRoyale$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends BattleRoyale<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface BattleRoyale$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends BattleRoyale<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace BattleRoyale { - export type combatants<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = combatants$SelectionSet<$Scalars> + export type combatants< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = combatants$SelectionSet<_$Scalars>; - export interface combatants$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$CombatantMultiPokemon<$Scalars> - {} + export interface combatants$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$CombatantMultiPokemon<_$Scalars> {} // --- expanded --- @@ -515,19 +558,21 @@ export namespace BattleRoyale { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type combatants$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - combatants$SelectionSet<$Scalars> - > + export type combatants$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + combatants$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type date<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type date<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | date$SelectionSet<$Scalars> + | date$SelectionSet<_$Scalars>; - export interface date$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface date$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -536,20 +581,22 @@ export namespace BattleRoyale { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type date$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type date$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | date$SelectionSet<$Scalars> - > + | date$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> + | id$SelectionSet<_$Scalars>; - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -558,18 +605,21 @@ export namespace BattleRoyale { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > + | id$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type winner<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = winner$SelectionSet<$Scalars> + export type winner<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + winner$SelectionSet<_$Scalars>; - export interface winner$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - {} + export interface winner$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} // --- expanded --- @@ -578,52 +628,46 @@ export namespace BattleRoyale { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type winner$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - winner$SelectionSet<$Scalars> - > + export type winner$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + winner$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // BattleTrainer // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface BattleTrainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ +export interface BattleTrainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `combatant1` field on the `BattleTrainer` object. Its type is `CombatantSinglePokemon` (a `OutputObject` kind of type). */ combatant1?: - | BattleTrainer.combatant1$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | BattleTrainer.combatant1$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Select the `combatant2` field on the `BattleTrainer` object. Its type is `CombatantSinglePokemon` (a `OutputObject` kind of type). */ combatant2?: - | BattleTrainer.combatant2$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | BattleTrainer.combatant2$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Select the `date` field on the `BattleTrainer` object. Its type is `Float` (a `ScalarStandard` kind of type). */ - date?: BattleTrainer.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + date?: BattleTrainer.date$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `id` field on the `BattleTrainer` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - id?: BattleTrainer.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + id?: BattleTrainer.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `winner` field on the `BattleTrainer` object. Its type is `Trainer` (a `OutputObject` kind of type). */ - winner?: BattleTrainer.winner$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + winner?: BattleTrainer.winner$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -634,8 +678,8 @@ export interface BattleTrainer<$Scalars extends $$Utilities.Schema.Scalar.Scalar * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | BattleTrainer$FragmentInline<$Scalars> - | BattleTrainer$FragmentInline<$Scalars>[] + | BattleTrainer$FragmentInline<_$Scalars> + | BattleTrainer$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -644,21 +688,24 @@ export interface BattleTrainer<$Scalars extends $$Utilities.Schema.Scalar.Scalar */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface BattleTrainer$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends BattleTrainer<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface BattleTrainer$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends BattleTrainer<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace BattleTrainer { - export type combatant1<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = combatant1$SelectionSet<$Scalars> + export type combatant1< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = combatant1$SelectionSet<_$Scalars>; - export interface combatant1$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$CombatantSinglePokemon<$Scalars> - {} + export interface combatant1$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$CombatantSinglePokemon<_$Scalars> {} // --- expanded --- @@ -667,17 +714,21 @@ export namespace BattleTrainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type combatant1$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - combatant1$SelectionSet<$Scalars> - > + export type combatant1$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + combatant1$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type combatant2<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = combatant2$SelectionSet<$Scalars> + export type combatant2< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = combatant2$SelectionSet<_$Scalars>; - export interface combatant2$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$CombatantSinglePokemon<$Scalars> - {} + export interface combatant2$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$CombatantSinglePokemon<_$Scalars> {} // --- expanded --- @@ -686,19 +737,21 @@ export namespace BattleTrainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type combatant2$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - combatant2$SelectionSet<$Scalars> - > + export type combatant2$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + combatant2$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type date<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type date<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | date$SelectionSet<$Scalars> + | date$SelectionSet<_$Scalars>; - export interface date$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface date$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -707,20 +760,22 @@ export namespace BattleTrainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type date$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type date$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | date$SelectionSet<$Scalars> - > + | date$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> + | id$SelectionSet<_$Scalars>; - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -729,18 +784,21 @@ export namespace BattleTrainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > + | id$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type winner<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = winner$SelectionSet<$Scalars> + export type winner<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + winner$SelectionSet<_$Scalars>; - export interface winner$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - {} + export interface winner$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} // --- expanded --- @@ -749,54 +807,48 @@ export namespace BattleTrainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type winner$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - winner$SelectionSet<$Scalars> - > + export type winner$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + winner$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // BattleWild // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ +export interface BattleWild< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `date` field on the `BattleWild` object. Its type is `Float` (a `ScalarStandard` kind of type). */ - date?: BattleWild.date$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + date?: BattleWild.date$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `id` field on the `BattleWild` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - id?: BattleWild.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + id?: BattleWild.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `pokemon` field on the `BattleWild` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ - pokemon?: BattleWild.pokemon$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + pokemon?: BattleWild.pokemon$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `result` field on the `BattleWild` object. Its type is `BattleWildResult` (a `Enum` kind of type). */ - result?: BattleWild.result$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + result?: BattleWild.result$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `trainer` field on the `BattleWild` object. Its type is `Trainer` (a `OutputObject` kind of type). */ - trainer?: BattleWild.trainer$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + trainer?: BattleWild.trainer$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `wildPokemons` field on the `BattleWild` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ wildPokemons?: - | BattleWild.wildPokemons$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | BattleWild.wildPokemons$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -807,8 +859,8 @@ export interface BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | BattleWild$FragmentInline<$Scalars> - | BattleWild$FragmentInline<$Scalars>[] + | BattleWild$FragmentInline<_$Scalars> + | BattleWild$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -817,23 +869,24 @@ export interface BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface BattleWild$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends BattleWild<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface BattleWild$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends BattleWild<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace BattleWild { - export type date<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type date<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | date$SelectionSet<$Scalars> + | date$SelectionSet<_$Scalars>; - export interface date$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface date$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -842,20 +895,22 @@ export namespace BattleWild { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type date$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type date$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | date$SelectionSet<$Scalars> - > + | date$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> + | id$SelectionSet<_$Scalars>; - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -864,18 +919,21 @@ export namespace BattleWild { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > + | id$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = pokemon$SelectionSet<$Scalars> + export type pokemon<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + pokemon$SelectionSet<_$Scalars>; - export interface pokemon$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - {} + export interface pokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} // --- expanded --- @@ -884,19 +942,21 @@ export namespace BattleWild { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type pokemon$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - pokemon$SelectionSet<$Scalars> - > + export type pokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemon$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type result<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type result<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | result$SelectionSet<$Scalars> + | result$SelectionSet<_$Scalars>; - export interface result$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface result$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -905,18 +965,21 @@ export namespace BattleWild { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type result$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type result$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | result$SelectionSet<$Scalars> - > + | result$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = trainer$SelectionSet<$Scalars> + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars>; - export interface trainer$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - {} + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} // --- expanded --- @@ -925,19 +988,21 @@ export namespace BattleWild { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type trainer$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - trainer$SelectionSet<$Scalars> - > + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type wildPokemons<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = wildPokemons$SelectionSet< - $Scalars - > + export type wildPokemons< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = wildPokemons$SelectionSet<_$Scalars>; - export interface wildPokemons$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - {} + export interface wildPokemons$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} // --- expanded --- @@ -946,40 +1011,34 @@ export namespace BattleWild { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type wildPokemons$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - wildPokemons$SelectionSet<$Scalars> - > + export type wildPokemons$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + wildPokemons$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // CombatantMultiPokemon // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface CombatantMultiPokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ +export interface CombatantMultiPokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `pokemons` field on the `CombatantMultiPokemon` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ pokemons?: - | CombatantMultiPokemon.pokemons$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | CombatantMultiPokemon.pokemons$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Select the `trainer` field on the `CombatantMultiPokemon` object. Its type is `Trainer` (a `OutputObject` kind of type). */ trainer?: - | CombatantMultiPokemon.trainer$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | CombatantMultiPokemon.trainer$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -990,8 +1049,8 @@ export interface CombatantMultiPokemon<$Scalars extends $$Utilities.Schema.Scala * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | CombatantMultiPokemon$FragmentInline<$Scalars> - | CombatantMultiPokemon$FragmentInline<$Scalars>[] + | CombatantMultiPokemon$FragmentInline<_$Scalars> + | CombatantMultiPokemon$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -1000,21 +1059,24 @@ export interface CombatantMultiPokemon<$Scalars extends $$Utilities.Schema.Scala */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface CombatantMultiPokemon$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends CombatantMultiPokemon<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface CombatantMultiPokemon$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends CombatantMultiPokemon<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace CombatantMultiPokemon { - export type pokemons<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = pokemons$SelectionSet<$Scalars> + export type pokemons< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = pokemons$SelectionSet<_$Scalars>; - export interface pokemons$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - {} + export interface pokemons$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} // --- expanded --- @@ -1023,17 +1085,20 @@ export namespace CombatantMultiPokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type pokemons$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - pokemons$SelectionSet<$Scalars> - > + export type pokemons$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemons$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = trainer$SelectionSet<$Scalars> + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars>; - export interface trainer$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - {} + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} // --- expanded --- @@ -1042,40 +1107,34 @@ export namespace CombatantMultiPokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type trainer$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - trainer$SelectionSet<$Scalars> - > + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // CombatantSinglePokemon // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface CombatantSinglePokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.ObjectLike -{ +export interface CombatantSinglePokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `pokemon` field on the `CombatantSinglePokemon` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ pokemon?: - | CombatantSinglePokemon.pokemon$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | CombatantSinglePokemon.pokemon$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Select the `trainer` field on the `CombatantSinglePokemon` object. Its type is `Trainer` (a `OutputObject` kind of type). */ trainer?: - | CombatantSinglePokemon.trainer$Expanded<$Scalars> - | $Select.SelectAlias.SelectAlias> + | CombatantSinglePokemon.trainer$Expanded<_$Scalars> + | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -1086,8 +1145,8 @@ export interface CombatantSinglePokemon<$Scalars extends $$Utilities.Schema.Scal * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | CombatantSinglePokemon$FragmentInline<$Scalars> - | CombatantSinglePokemon$FragmentInline<$Scalars>[] + | CombatantSinglePokemon$FragmentInline<_$Scalars> + | CombatantSinglePokemon$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -1096,21 +1155,23 @@ export interface CombatantSinglePokemon<$Scalars extends $$Utilities.Schema.Scal */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface CombatantSinglePokemon$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends CombatantSinglePokemon<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface CombatantSinglePokemon$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends CombatantSinglePokemon<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace CombatantSinglePokemon { - export type pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = pokemon$SelectionSet<$Scalars> + export type pokemon<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + pokemon$SelectionSet<_$Scalars>; - export interface pokemon$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - {} + export interface pokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} // --- expanded --- @@ -1119,17 +1180,20 @@ export namespace CombatantSinglePokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type pokemon$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - pokemon$SelectionSet<$Scalars> - > + export type pokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemon$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = trainer$SelectionSet<$Scalars> + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars>; - export interface trainer$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - {} + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} // --- expanded --- @@ -1138,38 +1202,34 @@ export namespace CombatantSinglePokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type trainer$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - trainer$SelectionSet<$Scalars> - > + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Patron // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Patron<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { +export interface Patron<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $Select.Bases.ObjectLike +{ /** * Select the `id` field on the `Patron` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - id?: Patron.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + id?: Patron.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `money` field on the `Patron` object. Its type is `Int` (a `ScalarStandard` kind of type). */ - money?: Patron.money$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + money?: Patron.money$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `Patron` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: Patron.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: Patron.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -1180,8 +1240,8 @@ export interface Patron<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = { * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Patron$FragmentInline<$Scalars> - | Patron$FragmentInline<$Scalars>[] + | Patron$FragmentInline<_$Scalars> + | Patron$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -1190,23 +1250,24 @@ export interface Patron<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = { */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Patron$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Patron<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Patron$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Patron<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Patron { - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> + | id$SelectionSet<_$Scalars>; - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1215,20 +1276,22 @@ export namespace Patron { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > + | id$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type money<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type money<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | money$SelectionSet<$Scalars> + | money$SelectionSet<_$Scalars>; - export interface money$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface money$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1237,20 +1300,22 @@ export namespace Patron { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type money$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type money$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | money$SelectionSet<$Scalars> - > + | money$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1259,59 +1324,55 @@ export namespace Patron { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Pokemon // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { +export interface Pokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `attack` field on the `Pokemon` object. Its type is `Int` (a `ScalarStandard` kind of type). */ - attack?: Pokemon.attack$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + attack?: Pokemon.attack$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** - * Select the `birthday` field on the `Pokemon` object. Its type is `Int` (a `ScalarStandard` kind of type). + * Select the `birthday` field on the `Pokemon` object. Its type is `Date` (a `ScalarCustom` kind of type). */ - birthday?: Pokemon.birthday$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + birthday?: Pokemon.birthday$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `defense` field on the `Pokemon` object. Its type is `Int` (a `ScalarStandard` kind of type). */ - defense?: Pokemon.defense$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + defense?: Pokemon.defense$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `hp` field on the `Pokemon` object. Its type is `Int` (a `ScalarStandard` kind of type). */ - hp?: Pokemon.hp$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + hp?: Pokemon.hp$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `id` field on the `Pokemon` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - id?: Pokemon.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + id?: Pokemon.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `Pokemon` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: Pokemon.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: Pokemon.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `trainer` field on the `Pokemon` object. Its type is `Trainer` (a `OutputObject` kind of type). */ - trainer?: Pokemon.trainer$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + trainer?: Pokemon.trainer$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `type` field on the `Pokemon` object. Its type is `PokemonType` (a `Enum` kind of type). */ - type?: Pokemon.type$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + type?: Pokemon.type$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -1322,8 +1383,8 @@ export interface Pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Pokemon$FragmentInline<$Scalars> - | Pokemon$FragmentInline<$Scalars>[] + | Pokemon$FragmentInline<_$Scalars> + | Pokemon$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -1332,23 +1393,24 @@ export interface Pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Pokemon$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Pokemon<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Pokemon$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Pokemon<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Pokemon { - export type attack<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type attack<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | attack$SelectionSet<$Scalars> + | attack$SelectionSet<_$Scalars>; - export interface attack$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface attack$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1357,20 +1419,24 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type attack$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type attack$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | attack$SelectionSet<$Scalars> - > + | attack$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type birthday<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type birthday< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = | $Select.Indicator.NoArgsIndicator - | birthday$SelectionSet<$Scalars> + | birthday$SelectionSet<_$Scalars>; - export interface birthday$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface birthday$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1379,20 +1445,22 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type birthday$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type birthday$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | birthday$SelectionSet<$Scalars> - > + | birthday$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type defense<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type defense<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | defense$SelectionSet<$Scalars> + | defense$SelectionSet<_$Scalars>; - export interface defense$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface defense$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1401,20 +1469,22 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type defense$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type defense$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | defense$SelectionSet<$Scalars> - > + | defense$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type hp<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type hp<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | hp$SelectionSet<$Scalars> + | hp$SelectionSet<_$Scalars>; - export interface hp$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface hp$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1423,20 +1493,22 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type hp$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type hp$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | hp$SelectionSet<$Scalars> - > + | hp$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> + | id$SelectionSet<_$Scalars>; - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1445,20 +1517,22 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > + | id$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1467,18 +1541,21 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = trainer$SelectionSet<$Scalars> + export type trainer<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + trainer$SelectionSet<_$Scalars>; - export interface trainer$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Trainer<$Scalars> - {} + export interface trainer$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Trainer<_$Scalars> {} // --- expanded --- @@ -1487,19 +1564,21 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type trainer$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - trainer$SelectionSet<$Scalars> - > + export type trainer$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + trainer$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type type<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type type<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | type$SelectionSet<$Scalars> + | type$SelectionSet<_$Scalars>; - export interface type$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface type$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1508,47 +1587,43 @@ export namespace Pokemon { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type type$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type type$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | type$SelectionSet<$Scalars> - > + | type$SelectionSet<_$Scalars> + >; } -// -// -// -// -// GRAPHQL SELECTION SET -// OUTPUTOBJECT -// -------------------------------------------------------------------------------------------------- // Trainer // -------------------------------------------------------------------------------------------------- // -// // ----------------------------------------| Entrypoint Interface | -export interface Trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { +export interface Trainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends $Select.Bases.ObjectLike { /** * Select the `class` field on the `Trainer` object. Its type is `TrainerClass` (a `Enum` kind of type). */ - class?: Trainer.$class$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + class?: Trainer.$class$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `fans` field on the `Trainer` object. Its type is `Patron` (a `OutputObject` kind of type). */ - fans?: Trainer.fans$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + fans?: Trainer.fans$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `id` field on the `Trainer` object. Its type is `ID` (a `ScalarStandard` kind of type). */ - id?: Trainer.id$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + id?: Trainer.id$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `name` field on the `Trainer` object. Its type is `String` (a `ScalarStandard` kind of type). */ - name?: Trainer.name$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + name?: Trainer.name$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Select the `pokemon` field on the `Trainer` object. Its type is `Pokemon` (a `OutputObject` kind of type). */ - pokemon?: Trainer.pokemon$Expanded<$Scalars> | $Select.SelectAlias.SelectAlias> + pokemon?: Trainer.pokemon$Expanded<_$Scalars> | $Select.SelectAlias.SelectAlias>; /** * Inline fragments for field groups. @@ -1559,8 +1634,8 @@ export interface Trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Trainer$FragmentInline<$Scalars> - | Trainer$FragmentInline<$Scalars>[] + | Trainer$FragmentInline<_$Scalars> + | Trainer$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. @@ -1569,23 +1644,24 @@ export interface Trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Trainer$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Trainer<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Trainer$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Trainer<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} // ----------------------------------------| Fields | export namespace Trainer { - export type $class<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type $class<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | $class$SelectionSet<$Scalars> + | $class$SelectionSet<_$Scalars>; - export interface $class$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface $class$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1594,18 +1670,21 @@ export namespace Trainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type $class$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type $class$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | $class$SelectionSet<$Scalars> - > + | $class$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type fans<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = fans$SelectionSet<$Scalars> + export type fans<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + fans$SelectionSet<_$Scalars>; - export interface fans$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Patron<$Scalars> - {} + export interface fans$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Patron<_$Scalars> {} // --- expanded --- @@ -1614,19 +1693,21 @@ export namespace Trainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type fans$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - fans$SelectionSet<$Scalars> - > + export type fans$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + fans$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> + | id$SelectionSet<_$Scalars>; - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1635,20 +1716,22 @@ export namespace Trainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > + | id$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1657,18 +1740,21 @@ export namespace Trainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; // -------------------------------------------------------------------------------------------------- - export type pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = pokemon$SelectionSet<$Scalars> + export type pokemon<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + pokemon$SelectionSet<_$Scalars>; - export interface pokemon$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base, $NamedTypes.$Pokemon<$Scalars> - {} + export interface pokemon$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base, $NamedTypes.$Pokemon<_$Scalars> {} // --- expanded --- @@ -1677,9 +1763,11 @@ export namespace Trainer { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type pokemon$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< - pokemon$SelectionSet<$Scalars> - > + export type pokemon$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< + pokemon$SelectionSet<_$Scalars> + >; } // @@ -1698,10 +1786,22 @@ export namespace Trainer { // // -export interface Battle<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> { - ___on_BattleRoyale?: BattleRoyale<$Scalars> - ___on_BattleTrainer?: BattleTrainer<$Scalars> - ___on_BattleWild?: BattleWild<$Scalars> +export interface Battle< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> { + /** + * A meta field. Is the name of the type being selected. Since this is a union type and thus polymorphic, + * the name is one of the member type names, whichever is ultimately returned at runtime. + * + * @see https://graphql.org/learn/queries/#meta-fields + */ + __typename?: + | $Select.Indicator.NoArgsIndicator$Expanded + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; + + ___on_BattleRoyale?: BattleRoyale<_$Scalars>; + ___on_BattleTrainer?: BattleTrainer<_$Scalars>; + ___on_BattleWild?: BattleWild<_$Scalars>; /** * Inline fragments for field groups. @@ -1712,22 +1812,13 @@ export interface Battle<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = { * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Battle$FragmentInline<$Scalars> - | Battle$FragmentInline<$Scalars>[] - - /** - * A meta field. Is the name of the type being selected. Since this is a union type and thus polymorphic, - * the name is one of the member type names, whichever is ultimately returned at runtime. - * - * @see https://graphql.org/learn/queries/#meta-fields - */ - __typename?: - | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | Battle$FragmentInline<_$Scalars> + | Battle$FragmentInline<_$Scalars>[]; +} +export interface Battle$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Battle<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { } -export interface Battle$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Battle<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} // // @@ -1745,15 +1836,18 @@ export interface Battle$FragmentInline<$Scalars extends $$Utilities.Schema.Scala // // -// Interface Type: Being +// Being // -------------------------------------------------------------------------------------------------- +// -export interface Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> extends $Select.Bases.ObjectLike { - id?: Being.id<$Scalars> - name?: Being.name<$Scalars> - ___on_Patron?: Patron<$Scalars> - ___on_Pokemon?: Pokemon<$Scalars> - ___on_Trainer?: Trainer<$Scalars> +export interface Being<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> + extends $Select.Bases.ObjectLike +{ + id?: Being.id<_$Scalars>; + name?: Being.name<_$Scalars>; + ___on_Patron?: Patron<_$Scalars>; + ___on_Pokemon?: Pokemon<_$Scalars>; + ___on_Trainer?: Trainer<_$Scalars>; /** * Inline fragments for field groups. @@ -1764,8 +1858,8 @@ export interface Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} * @see https://spec.graphql.org/draft/#sec-Inline-Fragments */ ___?: - | Being$FragmentInline<$Scalars> - | Being$FragmentInline<$Scalars>[] + | Being$FragmentInline<_$Scalars> + | Being$FragmentInline<_$Scalars>[]; /** * A meta field. Is the name of the type being selected. Since this is a interface type and thus polymorphic, @@ -1775,21 +1869,22 @@ export interface Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {} */ __typename?: | $Select.Indicator.NoArgsIndicator$Expanded - | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator> + | $Select.SelectAlias.SelectAlias<$Select.Indicator.NoArgsIndicator>; } -export interface Being$FragmentInline<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends Being<$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields -{} +export interface Being$FragmentInline< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, +> extends Being<_$Scalars>, $Select.Directive.$Groups.InlineFragment.Fields { +} export namespace Being { - export type id<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type id<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> + | id$SelectionSet<_$Scalars>; - export interface id$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface id$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1798,18 +1893,20 @@ export namespace Being { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type id$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type id$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | id$SelectionSet<$Scalars> - > + | id$SelectionSet<_$Scalars> + >; - export type name<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = + export type name<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> + | name$SelectionSet<_$Scalars>; - export interface name$SelectionSet<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> - extends $Select.Bases.Base - {} + export interface name$SelectionSet< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > extends $Select.Bases.Base {} // --- expanded --- @@ -1818,10 +1915,12 @@ export namespace Being { * that IDEs will display its contents (a union type) directly, rather than the name of this type. * In some cases, this is a preferable DX, making the types easier to read for users. */ - export type name$Expanded<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = $$Utilities.Simplify< + export type name$Expanded< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = $$Utilities.Simplify< | $Select.Indicator.NoArgsIndicator - | name$SelectionSet<$Scalars> - > + | name$SelectionSet<_$Scalars> + >; } /** @@ -1832,25 +1931,48 @@ export namespace Being { * would end up with an error of `export interface Foo extends Foo ...` */ export namespace $NamedTypes { - export type $Mutation<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Mutation<$Scalars> - export type $Query<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Query<$Scalars> - export type $BattleWildResult = BattleWildResult - export type $PokemonType = PokemonType - export type $TrainerClass = TrainerClass - export type $DateFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = DateFilter<$Scalars> - export type $PokemonFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = PokemonFilter<$Scalars> - export type $StringFilter<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = StringFilter<$Scalars> - export type $BattleRoyale<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = BattleRoyale<$Scalars> - export type $BattleTrainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = BattleTrainer<$Scalars> - export type $BattleWild<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = BattleWild<$Scalars> - export type $CombatantMultiPokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = CombatantMultiPokemon< - $Scalars - > - export type $CombatantSinglePokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = - CombatantSinglePokemon<$Scalars> - export type $Patron<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Patron<$Scalars> - export type $Pokemon<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Pokemon<$Scalars> - export type $Trainer<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Trainer<$Scalars> - export type $Battle<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Battle<$Scalars> - export type $Being<$Scalars extends $$Utilities.Schema.Scalar.ScalarMap = {}> = Being<$Scalars> + export type $Query<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Query<_$Scalars>; + export type $Mutation< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Mutation<_$Scalars>; + export type $BattleWildResult = BattleWildResult; + export type $PokemonType = PokemonType; + export type $TrainerClass = TrainerClass; + export type $DateFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = DateFilter<_$Scalars>; + export type $PokemonFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = PokemonFilter<_$Scalars>; + export type $StringFilter< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = StringFilter<_$Scalars>; + export type $BattleRoyale< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = BattleRoyale<_$Scalars>; + export type $BattleTrainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = BattleTrainer<_$Scalars>; + export type $BattleWild< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = BattleWild<_$Scalars>; + export type $CombatantMultiPokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = CombatantMultiPokemon<_$Scalars>; + export type $CombatantSinglePokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = CombatantSinglePokemon<_$Scalars>; + export type $Patron<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Patron<_$Scalars>; + export type $Pokemon< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Pokemon<_$Scalars>; + export type $Trainer< + _$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty, + > = Trainer<_$Scalars>; + export type $Battle<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Battle<_$Scalars>; + export type $Being<_$Scalars extends $$Utilities.Schema.Scalar.Registry = $$Utilities.Schema.Scalar.Registry.Empty> = + Being<_$Scalars>; }