Skip to content

Commit 80e05bf

Browse files
feat: add schema path mapping for GraphQL types in TypeScript configuration
1 parent 5b0a5c8 commit 80e05bf

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "nitro-graphql",
33
"type": "module",
4-
"version": "0.0.6",
4+
"version": "0.0.7",
55
"packageManager": "pnpm@10.13.1",
66
"description": "GraphQL integration for Nitro",
77
"license": "MIT",

playground/server/graphql/schemas.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ import { z } from 'zod/v4'
33
export default defineSchema({
44
Todo: z.object({
55
id: z.string(),
6+
title: z.string(),
67
}),
78
})

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ declare module 'nitro-graphql' {
245245
types.tsConfig.compilerOptions.paths['#graphql/client'] = [
246246
relativeWithDot(tsconfigDir, join(typesDir, 'nitro-graphql-client.d.ts')),
247247
]
248+
types.tsConfig.compilerOptions.paths['#graphql/schemas'] = [
249+
relativeWithDot(tsconfigDir, join(nitro.graphql.serverDir, 'schemas.ts')),
250+
]
248251
types.tsConfig.include = types.tsConfig.include || []
249252
types.tsConfig.include.push(
250253
relativeWithDot(tsconfigDir, join(typesDir, 'nitro-graphql-server.d.ts')),

0 commit comments

Comments
 (0)