Skip to content

Commit e233adb

Browse files
committed
chore(example/solid): minor updates and regenerate schema
1 parent 2a35e40 commit e233adb

6 files changed

Lines changed: 57 additions & 47 deletions

File tree

examples/solid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"devDependencies": {
2020
"@tailwindcss/postcss": "^4.0.17",
2121
"@tailwindcss/typography": "^0.5.16",
22-
"graphql": "^16.10.0",
22+
"graphql": "^16.11.0",
2323
"postcss": "^8.5.3",
2424
"solid-devtools": "^0.33.0",
2525
"tailwindcss": "^4.0.17",

examples/solid/src/gqty/schema.generated.ts

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
* GQty AUTO-GENERATED CODE: PLEASE DO NOT MODIFY MANUALLY
33
*/
44

5+
import { type ScalarsEnumsHash } from 'gqty';
6+
57
export type Maybe<T> = T | null;
68
export type InputMaybe<T> = Maybe<T>;
79
export type Exact<T extends { [key: string]: unknown }> = {
@@ -13,15 +15,24 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
1315
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
1416
[SubKey in K]: Maybe<T[SubKey]>;
1517
};
18+
export type MakeEmpty<
19+
T extends { [key: string]: unknown },
20+
K extends keyof T,
21+
> = { [_ in K]?: never };
22+
export type Incremental<T> =
23+
| T
24+
| {
25+
[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;
26+
};
1627
/** All built-in and custom scalars, mapped to their actual values */
1728
export interface Scalars {
18-
ID: string;
19-
String: string;
20-
Boolean: boolean;
21-
Int: number;
22-
Float: number;
29+
ID: { input: string; output: string };
30+
String: { input: string; output: string };
31+
Boolean: { input: boolean; output: boolean };
32+
Int: { input: number; output: number };
33+
Float: { input: number; output: number };
2334
/** The `Upload` scalar type represents a file upload. */
24-
Upload: any;
35+
Upload: { input: any; output: any };
2536
}
2637

2738
export enum CacheControlScope {
@@ -30,25 +41,25 @@ export enum CacheControlScope {
3041
}
3142

3243
export interface FilterCharacter {
33-
gender?: InputMaybe<Scalars['String']>;
34-
name?: InputMaybe<Scalars['String']>;
35-
species?: InputMaybe<Scalars['String']>;
36-
status?: InputMaybe<Scalars['String']>;
37-
type?: InputMaybe<Scalars['String']>;
44+
gender?: InputMaybe<Scalars['String']['input']>;
45+
name?: InputMaybe<Scalars['String']['input']>;
46+
species?: InputMaybe<Scalars['String']['input']>;
47+
status?: InputMaybe<Scalars['String']['input']>;
48+
type?: InputMaybe<Scalars['String']['input']>;
3849
}
3950

4051
export interface FilterEpisode {
41-
episode?: InputMaybe<Scalars['String']>;
42-
name?: InputMaybe<Scalars['String']>;
52+
episode?: InputMaybe<Scalars['String']['input']>;
53+
name?: InputMaybe<Scalars['String']['input']>;
4354
}
4455

4556
export interface FilterLocation {
46-
dimension?: InputMaybe<Scalars['String']>;
47-
name?: InputMaybe<Scalars['String']>;
48-
type?: InputMaybe<Scalars['String']>;
57+
dimension?: InputMaybe<Scalars['String']['input']>;
58+
name?: InputMaybe<Scalars['String']['input']>;
59+
type?: InputMaybe<Scalars['String']['input']>;
4960
}
5061

51-
export const scalarsEnumsHash: import('gqty').ScalarsEnumsHash = {
62+
export const scalarsEnumsHash: ScalarsEnumsHash = {
5263
Boolean: true,
5364
CacheControlScope: true,
5465
ID: true,
@@ -301,53 +312,53 @@ export interface Query {
301312
/**
302313
* Get a specific character by ID
303314
*/
304-
character: (args: { id: Scalars['ID'] }) => Maybe<Character>;
315+
character: (args: { id: ScalarsEnums['ID'] }) => Maybe<Character>;
305316
/**
306317
* Get the list of all characters
307318
*/
308319
characters: (args?: {
309320
filter?: Maybe<FilterCharacter>;
310-
page?: Maybe<Scalars['Int']>;
321+
page?: Maybe<ScalarsEnums['Int']>;
311322
}) => Maybe<Characters>;
312323
/**
313324
* Get a list of characters selected by ids
314325
*/
315326
charactersByIds: (args: {
316-
ids: Array<Scalars['ID']>;
327+
ids: Array<ScalarsEnums['ID']>;
317328
}) => Maybe<Array<Maybe<Character>>>;
318329
/**
319330
* Get a specific episode by ID
320331
*/
321-
episode: (args: { id: Scalars['ID'] }) => Maybe<Episode>;
332+
episode: (args: { id: ScalarsEnums['ID'] }) => Maybe<Episode>;
322333
/**
323334
* Get the list of all episodes
324335
*/
325336
episodes: (args?: {
326337
filter?: Maybe<FilterEpisode>;
327-
page?: Maybe<Scalars['Int']>;
338+
page?: Maybe<ScalarsEnums['Int']>;
328339
}) => Maybe<Episodes>;
329340
/**
330341
* Get a list of episodes selected by ids
331342
*/
332343
episodesByIds: (args: {
333-
ids: Array<Scalars['ID']>;
344+
ids: Array<ScalarsEnums['ID']>;
334345
}) => Maybe<Array<Maybe<Episode>>>;
335346
/**
336347
* Get a specific locations by ID
337348
*/
338-
location: (args: { id: Scalars['ID'] }) => Maybe<Location>;
349+
location: (args: { id: ScalarsEnums['ID'] }) => Maybe<Location>;
339350
/**
340351
* Get the list of all locations
341352
*/
342353
locations: (args?: {
343354
filter?: Maybe<FilterLocation>;
344-
page?: Maybe<Scalars['Int']>;
355+
page?: Maybe<ScalarsEnums['Int']>;
345356
}) => Maybe<Locations>;
346357
/**
347358
* Get a list of locations selected by ids
348359
*/
349360
locationsByIds: (args: {
350-
ids: Array<Scalars['ID']>;
361+
ids: Array<ScalarsEnums['ID']>;
351362
}) => Maybe<Array<Maybe<Location>>>;
352363
}
353364

@@ -361,10 +372,10 @@ export interface GeneratedSchema {
361372
subscription: Subscription;
362373
}
363374

364-
export type MakeNullable<T> = {
365-
[K in keyof T]: T[K] | undefined;
375+
export type ScalarsEnums = {
376+
[Key in keyof Scalars]: Scalars[Key] extends { output: unknown }
377+
? Scalars[Key]['output']
378+
: never;
379+
} & {
380+
CacheControlScope: CacheControlScope;
366381
};
367-
368-
export interface ScalarsEnums extends MakeNullable<Scalars> {
369-
CacheControlScope: CacheControlScope | undefined;
370-
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@
4444
"tsx": "^4.19.3",
4545
"typescript": "^5.8.3"
4646
},
47-
"packageManager": "pnpm@10.11.1"
47+
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
4848
}

packages/cli/src/commands/default/getUserPackageManager.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22

33
import { existsSync } from 'node:fs';
44

5-
export type PackageManager = 'npm' | 'pnpm' | 'yarn';
5+
export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun';
66

7-
export const getUserPackageManager: () => PackageManager | undefined = () => {
7+
export const getUserPackageManager: () => PackageManager = () => {
88
// This environment variable is set by npm and yarn but pnpm seems less consistent
99
const userAgent = process.env.npm_config_user_agent;
1010

11-
if (userAgent) {
12-
if (userAgent.startsWith('yarn') || existsSync('yarn.lock')) {
13-
return 'yarn';
14-
} else if (userAgent.startsWith('pnpm') || existsSync('pnpm-lock.yaml')) {
15-
return 'pnpm';
16-
} else {
17-
return 'npm';
18-
}
11+
if (userAgent?.startsWith('yarn') || existsSync('yarn.lock')) {
12+
return 'yarn';
13+
} else if (userAgent?.startsWith('pnpm') || existsSync('pnpm-lock.yaml')) {
14+
return 'pnpm';
15+
} else if (userAgent?.startsWith('bun') || existsSync('bun.lockb')) {
16+
return 'bun';
17+
} else {
18+
return 'npm';
1919
}
20-
21-
return;
2220
};

packages/cli/src/commands/default/promptInstall.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const runInstall = async (
4949

5050
const getInstallCommand = (packager: PackageManager) => {
5151
switch (packager) {
52+
default:
5253
case 'npm': {
5354
return ['install', '--save-dev'];
5455
}

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)