added codegen

This commit is contained in:
Niklas Kapelle 2025-01-09 15:51:37 +01:00
parent 399fde8616
commit 415fd74c4f
Signed by: niklas
GPG Key ID: 4EB651B36D841D16
3 changed files with 5038 additions and 3 deletions

19
web/codegen.ts Normal file
View File

@ -0,0 +1,19 @@
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: "http://localhost:8080/graphql",
documents: "./src/**/*.graphql",
generates: {
"src/gql/": {
preset: "client",
plugins: [],
config:{
useTypeImports: true,
},
}
}
};
export default config;

5013
web/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,8 @@
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json" "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
"codegen": "graphql-codegen --config codegen.ts"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/vite-plugin-svelte": "^5.0.3", "@sveltejs/vite-plugin-svelte": "^5.0.3",
@ -20,6 +21,8 @@
"svelte-check": "^4.1.1", "svelte-check": "^4.1.1",
"tailwindcss": "^3.4.17", "tailwindcss": "^3.4.17",
"typescript": "~5.6.2", "typescript": "~5.6.2",
"vite": "^6.0.5" "vite": "^6.0.5",
"@graphql-codegen/cli": "5.0.3",
"@graphql-codegen/client-preset": "4.5.1"
} }
} }