···11+---
22+'@0no-co/graphqlsp': minor
33+---
44+55+Add ability to specify a URL for your schema, GraphQLSP will then fetch the introspection from the specified URL
+174-63
example/src/index.generated.ts
···11import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
22export type Maybe<T> = T | null;
33export type InputMaybe<T> = Maybe<T>;
44-export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
55-export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
66-export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
44+export type Exact<T extends { [key: string]: unknown }> = {
55+ [K in keyof T]: T[K];
66+};
77+export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
88+ [SubKey in K]?: Maybe<T[SubKey]>;
99+};
1010+export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
1111+ [SubKey in K]: Maybe<T[SubKey]>;
1212+};
713/** All built-in and custom scalars, mapped to their actual values */
814export type Scalars = {
915 ID: string;
···1319 Float: number;
1420};
15212222+/** Elemental property associated with either a Pokémon or one of their moves. */
2323+export type PokemonType =
2424+ | 'Grass'
2525+ | 'Poison'
2626+ | 'Fire'
2727+ | 'Flying'
2828+ | 'Water'
2929+ | 'Bug'
3030+ | 'Normal'
3131+ | 'Electric'
3232+ | 'Ground'
3333+ | 'Fairy'
3434+ | 'Fighting'
3535+ | 'Psychic'
3636+ | 'Rock'
3737+ | 'Steel'
3838+ | 'Ice'
3939+ | 'Ghost'
4040+ | 'Dragon'
4141+ | 'Dark';
4242+1643/** Move a Pokémon can perform with the associated damage and type. */
1744export type Attack = {
1845 __typename?: 'Attack';
1919- damage?: Maybe<Scalars['Int']>;
2046 name?: Maybe<Scalars['String']>;
2147 type?: Maybe<PokemonType>;
2222-};
2323-2424-export type AttacksConnection = {
2525- __typename?: 'AttacksConnection';
2626- fast?: Maybe<Array<Maybe<Attack>>>;
2727- special?: Maybe<Array<Maybe<Attack>>>;
4848+ damage?: Maybe<Scalars['Int']>;
2849};
29503051/** Requirement that prevents an evolution through regular means of levelling up. */
···3455 name?: Maybe<Scalars['String']>;
3556};
36575858+export type PokemonDimension = {
5959+ __typename?: 'PokemonDimension';
6060+ minimum?: Maybe<Scalars['String']>;
6161+ maximum?: Maybe<Scalars['String']>;
6262+};
6363+6464+export type AttacksConnection = {
6565+ __typename?: 'AttacksConnection';
6666+ fast?: Maybe<Array<Maybe<Attack>>>;
6767+ special?: Maybe<Array<Maybe<Attack>>>;
6868+};
6969+3770export type Pokemon = {
3871 __typename?: 'Pokemon';
3939- attacks?: Maybe<AttacksConnection>;
4040- /** @deprecated And this is the reason why */
7272+ id: Scalars['ID'];
7373+ name: Scalars['String'];
4174 classification?: Maybe<Scalars['String']>;
7575+ types?: Maybe<Array<Maybe<PokemonType>>>;
7676+ resistant?: Maybe<Array<Maybe<PokemonType>>>;
7777+ weaknesses?: Maybe<Array<Maybe<PokemonType>>>;
4278 evolutionRequirements?: Maybe<Array<Maybe<EvolutionRequirement>>>;
4343- evolutions?: Maybe<Array<Maybe<Pokemon>>>;
7979+ weight?: Maybe<PokemonDimension>;
8080+ height?: Maybe<PokemonDimension>;
8181+ attacks?: Maybe<AttacksConnection>;
4482 /** Likelihood of an attempt to catch a Pokémon to fail. */
4583 fleeRate?: Maybe<Scalars['Float']>;
4646- height?: Maybe<PokemonDimension>;
4747- id: Scalars['ID'];
4884 /** Maximum combat power a Pokémon may achieve at max level. */
4985 maxCP?: Maybe<Scalars['Int']>;
5086 /** Maximum health points a Pokémon may achieve at max level. */
5187 maxHP?: Maybe<Scalars['Int']>;
5252- name: Scalars['String'];
5353- resistant?: Maybe<Array<Maybe<PokemonType>>>;
5454- types?: Maybe<Array<Maybe<PokemonType>>>;
5555- weaknesses?: Maybe<Array<Maybe<PokemonType>>>;
5656- weight?: Maybe<PokemonDimension>;
5757-};
5858-5959-export type PokemonDimension = {
6060- __typename?: 'PokemonDimension';
6161- maximum?: Maybe<Scalars['String']>;
6262- minimum?: Maybe<Scalars['String']>;
8888+ evolutions?: Maybe<Array<Maybe<Pokemon>>>;
6389};
64906565-/** Elemental property associated with either a Pokémon or one of their moves. */
6666-export type PokemonType =
6767- | 'Bug'
6868- | 'Dark'
6969- | 'Dragon'
7070- | 'Electric'
7171- | 'Fairy'
7272- | 'Fighting'
7373- | 'Fire'
7474- | 'Flying'
7575- | 'Ghost'
7676- | 'Grass'
7777- | 'Ground'
7878- | 'Ice'
7979- | 'Normal'
8080- | 'Poison'
8181- | 'Psychic'
8282- | 'Rock'
8383- | 'Steel'
8484- | 'Water';
8585-8691export type Query = {
8792 __typename?: 'Query';
9393+ /** List out all Pokémon, optionally in pages */
9494+ pokemons?: Maybe<Array<Maybe<Pokemon>>>;
8895 /** Get a single Pokémon by its ID, a three character long identifier padded with zeroes */
8996 pokemon?: Maybe<Pokemon>;
9090- /** List out all Pokémon, optionally in pages */
9191- pokemons?: Maybe<Array<Maybe<Pokemon>>>;
9297};
93989999+export type QueryPokemonsArgs = {
100100+ limit?: InputMaybe<Scalars['Int']>;
101101+ skip?: InputMaybe<Scalars['Int']>;
102102+};
9410395104export type QueryPokemonArgs = {
96105 id: Scalars['ID'];
97106};
98107108108+export type PokemonsQueryVariables = Exact<{ [key: string]: never }>;
99109100100-export type QueryPokemonsArgs = {
101101- limit?: InputMaybe<Scalars['Int']>;
102102- skip?: InputMaybe<Scalars['Int']>;
110110+export type PokemonsQuery = {
111111+ __typename?: 'Query';
112112+ pokemons?: Array<{
113113+ __typename: 'Pokemon';
114114+ id: string;
115115+ name: string;
116116+ } | null> | null;
103117};
104118105105-export type PokemonsQueryVariables = Exact<{ [key: string]: never; }>;
106106-107107-108108-export type PokemonsQuery = { __typename?: 'Query', pokemons?: Array<{ __typename: 'Pokemon', id: string, name: string } | null> | null };
109109-110110-export type PokemonFieldsFragment = { __typename?: 'Pokemon', id: string, name: string };
119119+export type PokemonFieldsFragment = {
120120+ __typename?: 'Pokemon';
121121+ id: string;
122122+ name: string;
123123+};
111124112125export type PokemonQueryVariables = Exact<{
113126 id: Scalars['ID'];
114127}>;
115128129129+export type PokemonQuery = {
130130+ __typename?: 'Query';
131131+ pokemon?: { __typename: 'Pokemon'; id: string; name: string } | null;
132132+};
116133117117-export type PokemonQuery = { __typename?: 'Query', pokemon?: { __typename: 'Pokemon', id: string, name: string } | null };
118118-119119-export const PokemonFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"pokemonFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Pokemon"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]} as unknown as DocumentNode<PokemonFieldsFragment, unknown>;
120120-export const PokemonsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Pokemons"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pokemons"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"FragmentSpread","name":{"kind":"Name","value":"pokemonFields"}},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}}]}},...PokemonFieldsFragmentDoc.definitions]} as unknown as DocumentNode<PokemonsQuery, PokemonsQueryVariables>;
121121-export const PokemonDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Pokemon"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pokemon"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"__typename"}}]}}]}}]} as unknown as DocumentNode<PokemonQuery, PokemonQueryVariables>;134134+export const PokemonFieldsFragmentDoc = {
135135+ kind: 'Document',
136136+ definitions: [
137137+ {
138138+ kind: 'FragmentDefinition',
139139+ name: { kind: 'Name', value: 'pokemonFields' },
140140+ typeCondition: {
141141+ kind: 'NamedType',
142142+ name: { kind: 'Name', value: 'Pokemon' },
143143+ },
144144+ selectionSet: {
145145+ kind: 'SelectionSet',
146146+ selections: [
147147+ { kind: 'Field', name: { kind: 'Name', value: 'id' } },
148148+ { kind: 'Field', name: { kind: 'Name', value: 'name' } },
149149+ ],
150150+ },
151151+ },
152152+ ],
153153+} as unknown as DocumentNode<PokemonFieldsFragment, unknown>;
154154+export const PokemonsDocument = {
155155+ kind: 'Document',
156156+ definitions: [
157157+ {
158158+ kind: 'OperationDefinition',
159159+ operation: 'query',
160160+ name: { kind: 'Name', value: 'Pokemons' },
161161+ selectionSet: {
162162+ kind: 'SelectionSet',
163163+ selections: [
164164+ {
165165+ kind: 'Field',
166166+ name: { kind: 'Name', value: 'pokemons' },
167167+ selectionSet: {
168168+ kind: 'SelectionSet',
169169+ selections: [
170170+ { kind: 'Field', name: { kind: 'Name', value: 'id' } },
171171+ { kind: 'Field', name: { kind: 'Name', value: 'name' } },
172172+ {
173173+ kind: 'FragmentSpread',
174174+ name: { kind: 'Name', value: 'pokemonFields' },
175175+ },
176176+ { kind: 'Field', name: { kind: 'Name', value: '__typename' } },
177177+ ],
178178+ },
179179+ },
180180+ ],
181181+ },
182182+ },
183183+ ...PokemonFieldsFragmentDoc.definitions,
184184+ ],
185185+} as unknown as DocumentNode<PokemonsQuery, PokemonsQueryVariables>;
186186+export const PokemonDocument = {
187187+ kind: 'Document',
188188+ definitions: [
189189+ {
190190+ kind: 'OperationDefinition',
191191+ operation: 'query',
192192+ name: { kind: 'Name', value: 'Pokemon' },
193193+ variableDefinitions: [
194194+ {
195195+ kind: 'VariableDefinition',
196196+ variable: { kind: 'Variable', name: { kind: 'Name', value: 'id' } },
197197+ type: {
198198+ kind: 'NonNullType',
199199+ type: { kind: 'NamedType', name: { kind: 'Name', value: 'ID' } },
200200+ },
201201+ },
202202+ ],
203203+ selectionSet: {
204204+ kind: 'SelectionSet',
205205+ selections: [
206206+ {
207207+ kind: 'Field',
208208+ name: { kind: 'Name', value: 'pokemon' },
209209+ arguments: [
210210+ {
211211+ kind: 'Argument',
212212+ name: { kind: 'Name', value: 'id' },
213213+ value: {
214214+ kind: 'Variable',
215215+ name: { kind: 'Name', value: 'id' },
216216+ },
217217+ },
218218+ ],
219219+ selectionSet: {
220220+ kind: 'SelectionSet',
221221+ selections: [
222222+ { kind: 'Field', name: { kind: 'Name', value: 'id' } },
223223+ { kind: 'Field', name: { kind: 'Name', value: 'name' } },
224224+ { kind: 'Field', name: { kind: 'Name', value: '__typename' } },
225225+ ],
226226+ },
227227+ },
228228+ ],
229229+ },
230230+ },
231231+ ],
232232+} as unknown as DocumentNode<PokemonQuery, PokemonQueryVariables>;
+12-10
example/tsconfig.json
···11{
22 "compilerOptions": {
33- "plugins": [{
44- "name": "plugin",
55- "schema": "./schema.graphql"
66- }],
33+ "plugins": [
44+ {
55+ "name": "plugin",
66+ "schema": "https://trygql.formidable.dev/graphql/basic-pokedex"
77+ }
88+ ],
79 /* Visit https://aka.ms/tsconfig to read more about this file */
810911 /* Projects */
···1517 // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
16181719 /* Language and Environment */
1818- "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
2020+ "target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
1921 // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
2022 // "jsx": "preserve", /* Specify what JSX code is generated. */
2123 // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
···2931 // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
30323133 /* Modules */
3232- "module": "commonjs", /* Specify what module code is generated. */
3434+ "module": "commonjs" /* Specify what module code is generated. */,
3335 // "rootDir": "./", /* Specify the root folder within your source files. */
3436 // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
3537 // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
···7577 /* Interop Constraints */
7678 // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
7779 // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
7878- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
8080+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
7981 // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
8080- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
8282+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
81838284 /* Type Checking */
8383- "strict": true, /* Enable all strict type-checking options. */
8585+ "strict": true /* Enable all strict type-checking options. */,
8486 // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
8587 // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
8688 // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
···102104103105 /* Completeness */
104106 // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
105105- "skipLibCheck": true /* Skip type checking all .d.ts files. */
107107+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
106108 }
107109}