Skip to content

Commit 171c330

Browse files
Fix GraphQL examples (#8471)
* fix: update and validate GraphQL examples * fix: use npm in shared test helpers for ci
1 parent 248f85b commit 171c330

39 files changed

Lines changed: 338 additions & 283 deletions

File tree

orm/fastify-graphql-sdl-first/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
},
1212
"dependencies": {
1313
"@graphql-tools/schema": "10.0.31",
14-
"@prisma/client": "7.0.0",
15-
"@prisma/adapter-pg": "7.0.0",
16-
"dotenv": "^17.2.1",
17-
"fastify": "5.6.1",
18-
"graphql": "16.11.0",
19-
"graphql-scalars": "1.24.2",
20-
"mercurius": "16.2.0",
21-
"pg": "^8.16.3"
14+
"@prisma/client": "7.5.0",
15+
"@prisma/adapter-pg": "7.5.0",
16+
"dotenv": "^17.3.1",
17+
"fastify": "5.8.2",
18+
"graphql": "16.13.1",
19+
"graphql-scalars": "1.25.0",
20+
"mercurius": "16.8.0",
21+
"pg": "^8.20.0"
2222
},
2323
"devDependencies": {
24-
"@types/node": "22.18.12",
25-
"prisma": "7.0.0",
26-
"tsx": "4.20.6",
27-
"typescript": "5.8.2",
28-
"@types/pg": "^8.15.6"
24+
"@types/node": "25.5.0",
25+
"prisma": "7.5.0",
26+
"tsx": "4.21.0",
27+
"typescript": "5.9.3",
28+
"@types/pg": "^8.18.0"
2929
}
3030
}

orm/fastify-graphql/package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,21 @@
66
"dev": "tsx src/server"
77
},
88
"dependencies": {
9-
"@prisma/client": "7.0.0",
10-
"@prisma/adapter-pg": "7.0.0",
11-
"dotenv": "16.6.1",
12-
"fastify": "5.6.1",
13-
"graphql": "16.11.0",
14-
"graphql-scalars": "1.24.2",
15-
"mercurius": "16.2.0",
9+
"@prisma/client": "7.5.0",
10+
"@prisma/adapter-pg": "7.5.0",
11+
"dotenv": "17.3.1",
12+
"fastify": "5.8.2",
13+
"graphql": "16.13.1",
14+
"graphql-scalars": "1.25.0",
15+
"mercurius": "16.8.0",
1616
"nexus": "1.3.0",
17-
"pg": "^8.16.3"
17+
"pg": "^8.20.0"
1818
},
1919
"devDependencies": {
20-
"@types/node": "22.18.12",
21-
"dotenv": "^17.2.1",
22-
"prisma": "7.0.0",
23-
"tsx": "4.20.6",
24-
"typescript": "5.8.2",
25-
"@types/pg": "^8.15.6"
20+
"@types/node": "25.5.0",
21+
"prisma": "7.5.0",
22+
"tsx": "4.21.0",
23+
"typescript": "5.9.3",
24+
"@types/pg": "^8.18.0"
2625
}
27-
}
26+
}

orm/fastify-graphql/src/generated/nexus.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Do not make changes to this file directly
44
*/
55

6-
6+
import type * as prisma from "./../../prisma/generated/client"
77
import type { Context } from "./../context"
88
import type { core } from "nexus"
99
declare global {
@@ -62,21 +62,9 @@ export interface NexusGenScalars {
6262

6363
export interface NexusGenObjects {
6464
Mutation: {};
65-
Post: { // root type
66-
content?: string | null; // String
67-
createdAt: NexusGenScalars['DateTime']; // DateTime!
68-
id: number; // Int!
69-
published: boolean; // Boolean!
70-
title: string; // String!
71-
updatedAt: NexusGenScalars['DateTime']; // DateTime!
72-
viewCount: number; // Int!
73-
}
65+
Post: prisma.Post;
7466
Query: {};
75-
User: { // root type
76-
email: string; // String!
77-
id: number; // Int!
78-
name?: string | null; // String
79-
}
67+
User: prisma.User;
8068
}
8169

8270
export interface NexusGenInterfaces {

orm/graphql-auth/package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "MIT",
44
"scripts": {
55
"dev": "tsx src/server",
6-
"start": "node dist/server",
6+
"start": "node dist/src/server",
77
"clean": "rm -rf dist",
88
"build": "npm -s run clean && npm -s run generate && tsc",
99
"generate": "npm -s run generate:prisma && npm -s run generate:nexus",
@@ -16,26 +16,26 @@
1616
"trailingComma": "all"
1717
},
1818
"dependencies": {
19-
"@apollo/server": "4.13.0",
20-
"@prisma/client": "7.0.0",
21-
"@prisma/adapter-pg": "7.0.0",
22-
"bcryptjs": "3.0.2",
23-
"dotenv": "^17.2.1",
24-
"graphql": "16.11.0",
19+
"@apollo/server": "5.4.0",
20+
"@prisma/client": "7.5.0",
21+
"@prisma/adapter-pg": "7.5.0",
22+
"bcryptjs": "3.0.3",
23+
"dotenv": "^17.3.1",
24+
"graphql": "16.13.1",
2525
"graphql-middleware": "6.1.35",
26-
"graphql-scalars": "1.24.2",
26+
"graphql-scalars": "1.25.0",
2727
"graphql-shield": "7.6.5",
28-
"jsonwebtoken": "9.0.2",
28+
"jsonwebtoken": "9.0.3",
2929
"nexus": "1.3.0",
30-
"pg": "^8.16.3"
30+
"pg": "^8.20.0"
3131
},
3232
"devDependencies": {
3333
"@types/bcryptjs": "3.0.0",
3434
"@types/jsonwebtoken": "9.0.10",
35-
"@types/node": "22.18.12",
36-
"prisma": "7.0.0",
37-
"tsx": "4.20.6",
38-
"typescript": "5.8.2",
39-
"@types/pg": "^8.15.6"
35+
"@types/node": "25.5.0",
36+
"prisma": "7.5.0",
37+
"tsx": "4.21.0",
38+
"typescript": "5.9.3",
39+
"@types/pg": "^8.18.0"
4040
}
4141
}

orm/graphql-auth/src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const User = objectType({
247247
t.nonNull.list.nonNull.field('posts', {
248248
type: 'Post',
249249
resolve: (parent, _, context: Context) => {
250-
return context.prisma.post.findFirst({
250+
return context.prisma.post.findMany({
251251
where: {
252252
author: { id: parent.id || undefined },
253253
},

orm/graphql-auth/tsconfig.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
"compilerOptions": {
33
"esModuleInterop": true,
44
"outDir": "dist",
5-
"rootDir": "src",
5+
"rootDir": ".",
6+
"module": "commonjs",
7+
"moduleResolution": "node",
8+
"target": "ES2022",
69
"lib": ["esnext"],
7-
"strict": true
10+
"strict": true,
11+
"skipLibCheck": true
812
},
9-
"include": ["src/**/*"]
13+
"include": ["src/**/*", "prisma/generated/**/*"]
1014
}

orm/graphql-nexus/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "MIT",
44
"scripts": {
55
"dev": "tsx src/server",
6-
"start": "node dist/server",
6+
"start": "node dist/src/server",
77
"clean": "rm -rf dist",
88
"build": "npm -s run clean && npm -s run generate && tsc",
99
"generate": "npm -s run generate:prisma && npm -s run generate:nexus",
@@ -16,20 +16,20 @@
1616
"trailingComma": "all"
1717
},
1818
"dependencies": {
19-
"@apollo/server": "4.13.0",
20-
"@prisma/client": "7.0.0",
21-
"dotenv": "^17.2.1",
22-
"@prisma/adapter-pg": "7.0.0",
23-
"graphql": "16.11.0",
24-
"graphql-scalars": "1.24.2",
19+
"@apollo/server": "5.4.0",
20+
"@prisma/client": "7.5.0",
21+
"dotenv": "^17.3.1",
22+
"@prisma/adapter-pg": "7.5.0",
23+
"graphql": "16.13.1",
24+
"graphql-scalars": "1.25.0",
2525
"nexus": "1.3.0",
26-
"pg": "^8.16.3"
26+
"pg": "^8.20.0"
2727
},
2828
"devDependencies": {
29-
"@types/node": "22.18.12",
30-
"prisma": "7.0.0",
31-
"tsx": "4.20.6",
32-
"typescript": "5.8.2",
33-
"@types/pg": "^8.15.6"
29+
"@types/node": "25.5.0",
30+
"prisma": "7.5.0",
31+
"tsx": "4.21.0",
32+
"typescript": "5.9.3",
33+
"@types/pg": "^8.18.0"
3434
}
35-
}
35+
}

orm/graphql-nexus/tsconfig.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"compilerOptions": {
33
"outDir": "dist",
4-
"rootDir": "src",
4+
"rootDir": ".",
55
"esModuleInterop": true,
6+
"module": "commonjs",
7+
"moduleResolution": "node",
8+
"target": "ES2022",
69
"lib": ["esnext"],
710
"strict": true,
11+
"skipLibCheck": true
812
},
9-
"include": ["src/**/*"]
10-
}
13+
"include": ["src/**/*", "prisma/generated/**/*"]
14+
}

orm/graphql-sdl-first/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
"trailingComma": "all"
1010
},
1111
"dependencies": {
12-
"@prisma/client": "7.0.0",
13-
"@prisma/adapter-pg": "7.0.0",
14-
"dotenv": "^17.2.1",
15-
"graphql": "16.11.0",
16-
"graphql-scalars": "1.24.2",
17-
"graphql-yoga": "5.14.0",
18-
"pg": "^8.16.3"
12+
"@prisma/client": "7.5.0",
13+
"@prisma/adapter-pg": "7.5.0",
14+
"dotenv": "^17.3.1",
15+
"graphql": "16.13.1",
16+
"graphql-scalars": "1.25.0",
17+
"graphql-yoga": "5.18.1",
18+
"pg": "^8.20.0"
1919
},
2020
"devDependencies": {
21-
"@types/node": "22.18.12",
22-
"prisma": "7.0.0",
23-
"tsx": "4.20.6",
24-
"typescript": "5.8.2",
25-
"@types/pg": "^8.15.6"
21+
"@types/node": "25.5.0",
22+
"prisma": "7.5.0",
23+
"tsx": "4.21.0",
24+
"typescript": "5.9.3",
25+
"@types/pg": "^8.18.0"
2626
}
2727
}

orm/graphql-subscriptions/package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"license": "MIT",
44
"scripts": {
55
"dev": "tsx src/server",
6-
"start": "node dist/server",
6+
"start": "node dist/src/server",
77
"clean": "rm -rf dist",
88
"build": "npm -s run clean && npm -s run generate && tsc",
99
"generate": "npm -s run generate:prisma && npm -s run generate:nexus",
@@ -16,29 +16,28 @@
1616
"trailingComma": "all"
1717
},
1818
"dependencies": {
19-
"@apollo/server": "4.13.0",
19+
"@apollo/server": "5.4.0",
2020
"@as-integrations/express5": "1.1.2",
21-
"@prisma/client": "7.0.0",
22-
"@prisma/adapter-pg": "7.0.0",
21+
"@prisma/client": "7.5.0",
22+
"@prisma/adapter-pg": "7.5.0",
2323
"cors": "2.8.6",
24-
"dotenv": "16.6.1",
25-
"express": "5.1.0",
26-
"graphql": "16.11.0",
24+
"dotenv": "17.3.1",
25+
"express": "5.2.1",
26+
"graphql": "16.13.1",
2727
"graphql-subscriptions": "3.0.0",
28-
"graphql-ws": "5.16.2",
28+
"graphql-ws": "6.0.7",
2929
"nexus": "1.3.0",
30-
"ws": "8.18.3",
31-
"pg": "^8.16.3"
30+
"ws": "8.19.0",
31+
"pg": "^8.20.0"
3232
},
3333
"devDependencies": {
3434
"@types/cors": "2.8.19",
35-
"@types/express": "5.0.5",
36-
"@types/node": "22.19.0",
35+
"@types/express": "5.0.6",
36+
"@types/node": "25.5.0",
3737
"@types/ws": "8.18.1",
38-
"dotenv": "^17.2.1",
39-
"prisma": "7.0.0",
40-
"tsx": "4.20.6",
41-
"typescript": "5.8.2",
42-
"@types/pg": "^8.15.6"
38+
"prisma": "7.5.0",
39+
"tsx": "4.21.0",
40+
"typescript": "5.9.3",
41+
"@types/pg": "^8.18.0"
4342
}
44-
}
43+
}

0 commit comments

Comments
 (0)