nitro-graphql 1.0.13 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import * as _nuxt_schema4 from "@nuxt/schema";
1
+ import * as _nuxt_schema3 from "@nuxt/schema";
2
2
 
3
3
  //#region src/ecosystem/nuxt.d.ts
4
4
  interface ModuleOptions {}
5
- declare const _default: _nuxt_schema4.NuxtModule<ModuleOptions, ModuleOptions, false>;
5
+ declare const _default: _nuxt_schema3.NuxtModule<ModuleOptions, ModuleOptions, false>;
6
6
  //#endregion
7
7
  export { ModuleOptions, _default as default };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { StandardSchemaV1 } from "./types/standard-schema.js";
2
2
  import { CodegenClientConfig, CodegenServerConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions } from "./types/index.js";
3
- import * as nitropack7 from "nitropack";
3
+ import * as nitropack0 from "nitropack";
4
4
 
5
5
  //#region src/index.d.ts
6
- declare const _default: nitropack7.NitroModule;
6
+ declare const _default: nitropack0.NitroModule;
7
7
  //#endregion
8
8
  export { CodegenClientConfig, CodegenServerConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions, StandardSchemaV1, _default as default };
package/dist/index.js CHANGED
@@ -195,17 +195,26 @@ export default defineGraphQLConfig({
195
195
  // },
196
196
  })
197
197
  `, "utf-8");
198
- if (!existsSync(join(nitro.graphql.serverDir, "context.d.ts"))) writeFileSync(join(nitro.graphql.serverDir, "context.d.ts"), `// Example context definition please change it to your needs
199
- import type { H3EventContext as OriginalH3EventContext } from 'h3'
200
-
201
- export interface ExtendedH3EventContext extends OriginalH3EventContext {
202
- // useDatabase: () => Database
203
- // tables: typeof import('~~/server/drizzle/schema/index')
204
- }
198
+ if (!existsSync(join(nitro.graphql.serverDir, "context.ts"))) writeFileSync(join(nitro.graphql.serverDir, "context.ts"), `// Example context definition - please change it to your needs
199
+ // import type { Database } from '../utils/useDb'
205
200
 
206
201
  declare module 'h3' {
207
- interface H3EventContext extends ExtendedH3EventContext {}
202
+ interface H3EventContext {
203
+ // Add your custom context properties here
204
+ // useDatabase: () => Database
205
+ // tables: typeof import('../drizzle/schema')
206
+ // auth?: {
207
+ // user?: {
208
+ // id: string
209
+ // role: 'admin' | 'user'
210
+ // }
211
+ // }
212
+ }
208
213
  }`, "utf-8");
214
+ if (existsSync(join(nitro.graphql.serverDir, "context.d.ts"))) {
215
+ consola.warn("nitro-graphql: Found context.d.ts file. Please rename it to context.ts for the new structure.");
216
+ consola.info("The context file should now be context.ts instead of context.d.ts");
217
+ }
209
218
  }
210
219
  });
211
220
 
@@ -1,6 +1,6 @@
1
- import * as h35 from "h3";
1
+ import * as h34 from "h3";
2
2
 
3
3
  //#region src/routes/apollo-server.d.ts
4
- declare const _default: h35.EventHandler<h35.EventHandlerRequest, any>;
4
+ declare const _default: h34.EventHandler<h34.EventHandlerRequest, any>;
5
5
  //#endregion
6
6
  export { _default as default };
@@ -1,6 +1,6 @@
1
- import * as h32 from "h3";
1
+ import * as h36 from "h3";
2
2
 
3
3
  //#region src/routes/graphql-yoga.d.ts
4
- declare const _default: h32.EventHandler<h32.EventHandlerRequest, Promise<Response>>;
4
+ declare const _default: h36.EventHandler<h36.EventHandlerRequest, Promise<Response>>;
5
5
  //#endregion
6
6
  export { _default as default };
@@ -1,7 +1,7 @@
1
- import * as h30 from "h3";
1
+ import * as h31 from "h3";
2
2
 
3
3
  //#region src/routes/health.d.ts
4
- declare const _default: h30.EventHandler<h30.EventHandlerRequest, Promise<{
4
+ declare const _default: h31.EventHandler<h31.EventHandlerRequest, Promise<{
5
5
  status: string;
6
6
  message: string;
7
7
  timestamp: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nitro-graphql",
3
3
  "type": "module",
4
- "version": "1.0.13",
4
+ "version": "1.1.1",
5
5
  "description": "GraphQL integration for Nitro",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
@@ -78,7 +78,6 @@
78
78
  "defu": "^6.1.4",
79
79
  "graphql-config": "^5.1.5",
80
80
  "graphql-scalars": "^1.24.2",
81
- "h3": "1.15.3",
82
81
  "knitwork": "^1.2.0",
83
82
  "ohash": "^2.0.11",
84
83
  "oxc-parser": "^0.77.2",
@@ -98,6 +97,7 @@
98
97
  "eslint": "^9.31.0",
99
98
  "graphql": "^16.11.0",
100
99
  "graphql-yoga": "^5.15.1",
100
+ "h3": "1.15.3",
101
101
  "nitropack": "^2.12.3",
102
102
  "tsdown": "^0.12.9",
103
103
  "typescript": "^5.8.3"