Skip to content

Commit 9ed1693

Browse files
feat: implement GraphQL file watcher and automatic type generation
- Add automatic .graphql file watching in dev mode - Implement GraphQL Code Generator integration - Create resolver auto-discovery system - Generate TypeScript types from GraphQL schema - Add type-safe resolver support - Update playground with example resolvers - Add necessary dependencies for codegen BREAKING CHANGE: Module now requires .graphql files instead of .ts schema files
1 parent 97186f6 commit 9ed1693

File tree

20 files changed

+4516
-274
lines changed

20 files changed

+4516
-274
lines changed

eslint.config.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import antfu from '@antfu/eslint-config'
2+
3+
const nitro = {
4+
ignores: [
5+
'**/core.ts',
6+
'**/.output',
7+
'**/.nitro',
8+
'**/.netlify',
9+
'**/.nuxt',
10+
'**/*.gen.*',
11+
'**/dist',
12+
'**/assets',
13+
'**/vfs',
14+
],
15+
}
16+
export default antfu({
17+
...nitro,
18+
}, {
19+
rules: {
20+
'node/prefer-global/process': 'off',
21+
},
22+
}, {
23+
files: ['playground/**/*.{ts,js,mjs,cjs}'],
24+
rules: {
25+
'no-console': 'off',
26+
'unused-imports/no-unused-vars': 'off',
27+
},
28+
})

package.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,37 @@
2020
"build": "tsdown",
2121
"dev": "tsdown --watch",
2222
"release": "pnpm run build && changelogen --release && npm publish && git push --follow-tags",
23-
"playground": "cd playground && pnpm install && pnpm dev"
23+
"playground": "cd playground && pnpm install && pnpm dev",
24+
"lint": "eslint .",
25+
"lint:fix": "eslint . --fix"
2426
},
2527
"peerDependencies": {
2628
"nitropack": "^2.11.13"
2729
},
2830
"dependencies": {
31+
"@graphql-codegen/core": "^4.0.2",
32+
"@graphql-codegen/plugin-helpers": "^5.1.1",
33+
"@graphql-codegen/typescript": "^4.1.6",
34+
"@graphql-codegen/typescript-resolvers": "^4.5.1",
35+
"@graphql-tools/graphql-file-loader": "^8.0.20",
36+
"@graphql-tools/load": "^8.1.0",
37+
"@graphql-tools/load-files": "^7.0.1",
38+
"@graphql-tools/merge": "^9.0.24",
2939
"@graphql-tools/schema": "^10.0.23",
40+
"@graphql-tools/utils": "^10.8.6",
41+
"chokidar": "^4.0.3",
42+
"consola": "^3.4.2",
3043
"defu": "^6.1.4",
3144
"graphql": "^16.11.0",
32-
"graphql-yoga": "^5.14.0"
45+
"graphql-scalars": "^1.24.2",
46+
"graphql-yoga": "^5.14.0",
47+
"pathe": "^2.0.3"
3348
},
3449
"devDependencies": {
50+
"@antfu/eslint-config": "^4.16.2",
3551
"@types/node": "^20.19.6",
3652
"changelogen": "^0.6.2",
53+
"eslint": "^9.30.1",
3754
"nitropack": "^2.11.13",
3855
"tsdown": "^0.12.9",
3956
"typescript": "^5.8.3"

0 commit comments

Comments
 (0)