Skip to content

Commit 8fb674e

Browse files
feat: add GraphQL subscription support with client and Vue composables
- Updated pnpm workspace dependencies for GraphQL codegen and tools. - Enhanced client code generation to include subscription operations. - Introduced a new utility to extract subscription information from GraphQL documents. - Implemented a subscription client with WebSocket and SSE support. - Created a template for subscription client configuration. - Added Vue composables for managing subscriptions and session handling. - Updated code generation logic to include subscription builder in SDK. - Ensured backward compatibility while integrating new subscription features.
1 parent 69ac970 commit 8fb674e

File tree

29 files changed

+2689
-256
lines changed

29 files changed

+2689
-256
lines changed

examples/better-auth/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"devDependencies": {
1515
"@better-auth/cli": "^1.4.10",
16-
"@graphql-tools/utils": "^10.11.0",
16+
"@graphql-tools/utils": "^11.0.0",
1717
"@types/pg": "^8.16.0",
1818
"better-auth": "^1.4.10",
1919
"drizzle-kit": "^0.31.8",
@@ -24,9 +24,9 @@
2424
"nitro": "^3.0.1-alpha.1",
2525
"nitro-graphql": "2.0.0-beta.50",
2626
"pg": "^8.16.3",
27-
"rolldown": "^1.0.0-beta.58",
27+
"rolldown": "^1.0.0-beta.59",
2828
"tsx": "^4.21.0",
2929
"uuid": "^13.0.0",
30-
"zod": "^4.3.4"
30+
"zod": "^4.3.5"
3131
}
3232
}

examples/drizzle-orm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"nitro": "^3.0.1-alpha.1",
2121
"nitro-graphql": "2.0.0-beta.50",
2222
"pg": "^8.16.3",
23-
"rolldown": "^1.0.0-beta.58",
23+
"rolldown": "^1.0.0-beta.59",
2424
"tsx": "^4.21.0",
2525
"uuid": "^13.0.0",
26-
"zod": "^4.3.4"
26+
"zod": "^4.3.5"
2727
}
2828
}

examples/nitro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"graphql-yoga": "^5.18.0",
1111
"nitro": "^3.0.1-alpha.1",
1212
"nitro-graphql": "2.0.0-beta.50",
13-
"rolldown": "^1.0.0-beta.58"
13+
"rolldown": "^1.0.0-beta.59"
1414
}
1515
}

examples/subscriptions/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"graphql-yoga": "^5.18.0",
1414
"nitro": "^3.0.1-alpha.1",
1515
"nitro-graphql": "2.0.0-beta.50",
16-
"rolldown": "^1.0.0-beta.58"
17-
16+
"rolldown": "^1.0.0-beta.59"
1817
}
1918
}

examples/vite-vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint:type": "vue-tsc -b"
1111
},
1212
"dependencies": {
13-
"@pinia/colada": "^0.20.0",
13+
"@pinia/colada": "^0.21.0",
1414
"@tailwindcss/vite": "^4.1.18",
1515
"graphql": "^16.12.0",
1616
"graphql-yoga": "^5.18.0",
@@ -29,6 +29,6 @@
2929
"graphql-config": "^5.1.5",
3030
"typescript": "^5.9.3",
3131
"vite": "8.0.0-beta.5",
32-
"vue-tsc": "^3.2.1"
32+
"vue-tsc": "^3.2.2"
3333
}
3434
}

examples/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"graphql": "^16.12.0",
1313
"graphql-yoga": "^5.18.0",
1414
"nitro-graphql": "2.0.0-beta.50",
15-
"rolldown": "^1.0.0-beta.58"
15+
"rolldown": "^1.0.0-beta.59"
1616
},
1717
"devDependencies": {
1818
"nitro": "^3.0.1-alpha.1",

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
"./pubsub": {
8181
"types": "./dist/core/pubsub/index.d.mts",
8282
"import": "./dist/core/pubsub/index.mjs"
83+
},
84+
"./subscribe": {
85+
"types": "./dist/subscribe/index.d.mts",
86+
"import": "./dist/subscribe/index.mjs"
8387
}
8488
},
8589
"module": "./dist/index.mjs",
@@ -129,13 +133,17 @@
129133
"peerDependencies": {
130134
"@apollo/server": "^5.0.0",
131135
"graphql": "^16.12.0",
136+
"graphql-sse": "^2.6.0",
132137
"graphql-ws": "^6.0.6",
133138
"nitro": "^3.0.1-alpha.0"
134139
},
135140
"peerDependenciesMeta": {
136141
"@apollo/server": {
137142
"optional": true
138143
},
144+
"graphql-sse": {
145+
"optional": true
146+
},
139147
"graphql-ws": {
140148
"optional": true
141149
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>GraphQL Subscriptions Playground</title>
7+
</head>
8+
<body>
9+
<div id="app"></div>
10+
<script type="module" src="/src/main.ts"></script>
11+
</body>
12+
</html>

playgrounds/subscriptions/nitro.config.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
{
2-
"name": "nitro-graphql-subscriptions-example",
2+
"name": "nitro-graphql-subscriptions-playground",
3+
"type": "module",
4+
"version": "0.0.0",
35
"private": true,
46
"scripts": {
5-
"dev": "nitro dev",
6-
"build": "nitro build",
7-
"preview": "node .output/server/index.mjs"
7+
"dev": "vite",
8+
"build": "vite build",
9+
"preview": "vite preview"
810
},
911
"dependencies": {
12+
"@tailwindcss/vite": "catalog:",
13+
"graphql": "catalog:",
14+
"graphql-sse": "catalog:",
1015
"graphql-ws": "catalog:",
11-
"nitro-graphql": "link:../.."
16+
"graphql-yoga": "catalog:",
17+
"nitro": "catalog:",
18+
"nitro-graphql": "link:../..",
19+
"tailwindcss": "catalog:",
20+
"vue": "catalog:"
1221
},
1322
"devDependencies": {
14-
"nitro": "catalog:",
15-
"ws": "catalog:"
23+
"@vitejs/plugin-vue": "catalog:",
24+
"typescript": "catalog:",
25+
"vite": "catalog:"
1626
}
1727
}

0 commit comments

Comments
 (0)