nitro-graphql 1.1.0 → 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_schema5 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_schema5.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.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 h36 from "h3";
1
+ import * as h34 from "h3";
2
2
 
3
3
  //#region src/routes/apollo-server.d.ts
4
- declare const _default: h36.EventHandler<h36.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 h33 from "h3";
1
+ import * as h36 from "h3";
2
2
 
3
3
  //#region src/routes/graphql-yoga.d.ts
4
- declare const _default: h33.EventHandler<h33.EventHandlerRequest, Promise<Response>>;
4
+ declare const _default: h36.EventHandler<h36.EventHandlerRequest, Promise<Response>>;
5
5
  //#endregion
6
6
  export { _default as default };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nitro-graphql",
3
3
  "type": "module",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "description": "GraphQL integration for Nitro",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,