Skip to content

Commit 2d9c0f3

Browse files
feat: add GraphQL endpoint definition and ensure type generation for server and client
1 parent a244bbd commit 2d9c0f3

File tree

2 files changed

+5
-115
lines changed

2 files changed

+5
-115
lines changed

playground-nuxt/app/graphql/sdk.ts

Lines changed: 0 additions & 113 deletions
This file was deleted.

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ export default defineNitroModule({
6464

6565
await rollupConfig(nitro)
6666

67+
// Generate server and client types
68+
await serverTypeGeneration(nitro)
69+
await clientTypeGeneration(nitro, nitro.graphql.clientDir)
70+
71+
// Define the main GraphQL endpoint
6772
const endpoint = '/api/graphql'
6873

6974
const runtime = fileURLToPath(
@@ -142,8 +147,6 @@ export default defineNitroModule({
142147
}
143148
})
144149

145-
await serverTypeGeneration(nitro)
146-
147150
const graphqlDtsContent = `// Auto-generated by nitro-graphql
148151
import type { Resolvers as Test } from './nitro-graphql-server.d.ts'
149152

0 commit comments

Comments
 (0)