nitro-graphql 2.0.0-beta.27 → 2.0.0-beta.29

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,6 +1,6 @@
1
- import * as h30 from "h3";
1
+ import * as nitro_deps_h33 from "nitro/deps/h3";
2
2
 
3
3
  //#region src/routes/apollo-server.d.ts
4
- declare const _default: h30.EventHandlerWithFetch<h30.EventHandlerRequest, Promise<any>>;
4
+ declare const _default: nitro_deps_h33.EventHandlerWithFetch<nitro_deps_h33.EventHandlerRequest, Promise<any>>;
5
5
  //#endregion
6
6
  export { _default as default };
@@ -10,8 +10,8 @@ import { schemas } from "#nitro-graphql/server-schemas";
10
10
  import { ApolloServer } from "@apollo/server";
11
11
  import { ApolloServerPluginLandingPageLocalDefault } from "@apollo/server/plugin/landingPage/default";
12
12
  import { makeExecutableSchema } from "@graphql-tools/schema";
13
- import { defineEventHandler } from "h3";
14
13
  import { startServerAndCreateH3Handler } from "nitro-graphql/utils/apollo";
14
+ import { defineEventHandler } from "nitro/h3";
15
15
 
16
16
  //#region src/routes/apollo-server.ts
17
17
  let buildSubgraphSchema = null;
@@ -1,4 +1,4 @@
1
- import * as h33 from "h3";
1
+ import * as nitro_deps_h35 from "nitro/deps/h3";
2
2
 
3
3
  //#region src/routes/debug.d.ts
4
4
 
@@ -10,7 +10,7 @@ import * as h33 from "h3";
10
10
  * - /_nitro/graphql/debug - HTML dashboard
11
11
  * - /_nitro/graphql/debug?format=json - JSON API
12
12
  */
13
- declare const _default: h33.EventHandlerWithFetch<h33.EventHandlerRequest, Promise<string | {
13
+ declare const _default: nitro_deps_h35.EventHandlerWithFetch<nitro_deps_h35.EventHandlerRequest, Promise<string | {
14
14
  timestamp: string;
15
15
  environment: {
16
16
  dev: any;
@@ -2,7 +2,7 @@ import { moduleConfig } from "#nitro-graphql/module-config";
2
2
  import { directives } from "#nitro-graphql/server-directives";
3
3
  import { resolvers } from "#nitro-graphql/server-resolvers";
4
4
  import { schemas } from "#nitro-graphql/server-schemas";
5
- import { defineEventHandler, getQuery } from "h3";
5
+ import { defineEventHandler, getQuery } from "nitro/h3";
6
6
  import { debugInfo } from "#nitro-graphql/debug-info";
7
7
 
8
8
  //#region src/routes/debug.ts
@@ -1,6 +1,6 @@
1
- import * as h35 from "h3";
1
+ import * as nitro_deps_h31 from "nitro/deps/h3";
2
2
 
3
3
  //#region src/routes/graphql-yoga.d.ts
4
- declare const _default: h35.EventHandlerWithFetch<h35.EventHandlerRequest, Promise<Response>>;
4
+ declare const _default: nitro_deps_h31.EventHandlerWithFetch<nitro_deps_h31.EventHandlerRequest, Promise<Response>>;
5
5
  //#endregion
6
6
  export { _default as default };
@@ -8,7 +8,7 @@ import { directives } from "#nitro-graphql/server-directives";
8
8
  import { resolvers } from "#nitro-graphql/server-resolvers";
9
9
  import { schemas } from "#nitro-graphql/server-schemas";
10
10
  import { makeExecutableSchema } from "@graphql-tools/schema";
11
- import { defineEventHandler } from "h3";
11
+ import { defineEventHandler } from "nitro/h3";
12
12
  import { createYoga } from "graphql-yoga";
13
13
 
14
14
  //#region src/routes/graphql-yoga.ts
@@ -84,9 +84,9 @@ var graphql_yoga_default = defineEventHandler(async (event) => {
84
84
  renderGraphiQL: () => apolloSandboxHtml
85
85
  }, importedConfig));
86
86
  const response = await yoga.handleRequest(event.req, event);
87
- if (event.res.statusCode && event.res.statusCode !== 200) return new Response(response.body, {
87
+ if (event.res.status && event.res.status !== 200) return new Response(response.body, {
88
88
  ...response,
89
- status: event.res.statusCode
89
+ status: event.res.status
90
90
  });
91
91
  return new Response(response.body, response);
92
92
  });
@@ -1,7 +1,7 @@
1
- import * as h31 from "h3";
1
+ import * as nitro_deps_h30 from "nitro/deps/h3";
2
2
 
3
3
  //#region src/routes/health.d.ts
4
- declare const _default: h31.EventHandlerWithFetch<h31.EventHandlerRequest, Promise<{
4
+ declare const _default: nitro_deps_h30.EventHandlerWithFetch<nitro_deps_h30.EventHandlerRequest, Promise<{
5
5
  status: string;
6
6
  message: string;
7
7
  timestamp: string;
@@ -1,4 +1,4 @@
1
- import { defineEventHandler } from "h3";
1
+ import { defineEventHandler } from "nitro/h3";
2
2
  import { $fetch } from "nitro/deps/ofetch";
3
3
  import { useRuntimeConfig } from "nitro/runtime-config";
4
4
 
package/dist/setup.mjs CHANGED
@@ -18,6 +18,12 @@ const logger = consola.withTag("nitro-graphql");
18
18
  * Used by both the direct Nitro module export and the Vite plugin's nitro: hook
19
19
  */
20
20
  async function setupNitroGraphQL(nitro) {
21
+ nitro.options.graphql ||= {};
22
+ nitro.options.graphql.types = defu(nitro.options.graphql.types, {
23
+ server: ".graphql/nitro-graphql-server.d.ts",
24
+ client: ".graphql/nitro-graphql-client.d.ts",
25
+ enabled: true
26
+ });
21
27
  if (!nitro.options.graphql?.framework) logger.warn("No GraphQL framework specified. Please set graphql.framework to \"graphql-yoga\" or \"apollo-server\".");
22
28
  if (nitro.options.graphql?.externalServices?.length) {
23
29
  const validationErrors = validateExternalServices(nitro.options.graphql.externalServices);
@@ -1,6 +1,6 @@
1
1
  import { GraphQLSchema } from "graphql";
2
2
  import { ApolloServerOptions } from "@apollo/server";
3
- import { H3Event } from "h3";
3
+ import { H3Event } from "nitro/h3";
4
4
  import { YogaServerOptions } from "graphql-yoga";
5
5
  import { NPMConfig } from "#graphql/server";
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { ApolloServer, BaseContext, ContextFunction } from "@apollo/server";
2
- import { EventHandler, H3Event } from "h3";
2
+ import { EventHandler, H3Event } from "nitro/h3";
3
3
  import { Hooks } from "crossws";
4
4
 
5
5
  //#region src/utils/apollo.d.ts
@@ -1,5 +1,5 @@
1
1
  import { HeaderMap } from "@apollo/server";
2
- import { eventHandler, getRequestURL, readBody } from "h3";
2
+ import { eventHandler, getRequestURL, readBody } from "nitro/h3";
3
3
 
4
4
  //#region src/utils/apollo.ts
5
5
  function startServerAndCreateH3Handler(server, options) {
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "nitro-graphql",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.27",
4
+ "version": "2.0.0-beta.29",
5
+ "packageManager": "pnpm@10.22.0",
5
6
  "description": "GraphQL integration for Nitro",
6
7
  "license": "MIT",
7
8
  "sideEffects": false,
@@ -70,10 +71,25 @@
70
71
  "files": [
71
72
  "dist"
72
73
  ],
74
+ "scripts": {
75
+ "prepack": "pnpm build",
76
+ "build": "tsdown",
77
+ "dev": "tsdown --watch",
78
+ "bumpp": "bumpp package.json",
79
+ "release": "pnpm build && pnpm bumpp && pnpm publish --no-git-checks --access public",
80
+ "playground:nitro": "cd playgrounds/nitro && pnpm install && pnpm dev",
81
+ "playground:nuxt": "cd playgrounds/nuxt && pnpm install && pnpm dev",
82
+ "playground:federation": "cd playgrounds/federation && pnpm install && pnpm dev",
83
+ "docs:dev": "cd .docs && pnpm install && pnpm update:metadata && pnpm dev",
84
+ "docs:build": "cd .docs && pnpm install && pnpm update:metadata && pnpm build",
85
+ "docs:preview": "cd .docs && pnpm preview",
86
+ "lint": "eslint .",
87
+ "lint:fix": "eslint . --fix",
88
+ "test:types": "tsc --noEmit"
89
+ },
73
90
  "peerDependencies": {
74
91
  "@apollo/server": "^5.0.0",
75
92
  "graphql": "^16.11.0",
76
- "h3": "^2.0.1-rc.2",
77
93
  "nitro": "^3.0.1-alpha.0"
78
94
  },
79
95
  "peerDependenciesMeta": {
@@ -82,66 +98,56 @@
82
98
  }
83
99
  },
84
100
  "dependencies": {
85
- "@apollo/subgraph": "^2.12.1",
86
- "@graphql-codegen/core": "^5.0.0",
87
- "@graphql-codegen/import-types-preset": "^3.0.1",
88
- "@graphql-codegen/typescript": "^5.0.4",
89
- "@graphql-codegen/typescript-generic-sdk": "^4.0.2",
90
- "@graphql-codegen/typescript-operations": "^5.0.4",
91
- "@graphql-codegen/typescript-resolvers": "^5.1.2",
92
- "@graphql-tools/graphql-file-loader": "^8.1.6",
93
- "@graphql-tools/load": "^8.1.6",
94
- "@graphql-tools/load-files": "^7.0.1",
95
- "@graphql-tools/merge": "^9.1.5",
96
- "@graphql-tools/schema": "^10.0.29",
97
- "@graphql-tools/url-loader": "^9.0.4",
98
- "@graphql-tools/utils": "^10.10.3",
99
- "chokidar": "^4.0.3",
100
- "consola": "^3.4.2",
101
- "defu": "^6.1.4",
102
- "graphql-config": "^5.1.5",
103
- "graphql-scalars": "^1.25.0",
104
- "knitwork": "^1.3.0",
105
- "ohash": "^2.0.11",
106
- "oxc-parser": "^0.97.0",
107
- "pathe": "^2.0.3",
108
- "tinyglobby": "^0.2.15"
101
+ "@apollo/subgraph": "catalog:",
102
+ "@graphql-codegen/core": "catalog:",
103
+ "@graphql-codegen/import-types-preset": "catalog:",
104
+ "@graphql-codegen/typescript": "catalog:",
105
+ "@graphql-codegen/typescript-generic-sdk": "catalog:",
106
+ "@graphql-codegen/typescript-operations": "catalog:",
107
+ "@graphql-codegen/typescript-resolvers": "catalog:",
108
+ "@graphql-tools/graphql-file-loader": "catalog:",
109
+ "@graphql-tools/load": "catalog:",
110
+ "@graphql-tools/load-files": "catalog:",
111
+ "@graphql-tools/merge": "catalog:",
112
+ "@graphql-tools/schema": "catalog:",
113
+ "@graphql-tools/url-loader": "catalog:",
114
+ "@graphql-tools/utils": "catalog:",
115
+ "chokidar": "catalog:",
116
+ "consola": "catalog:",
117
+ "defu": "catalog:",
118
+ "graphql-config": "catalog:",
119
+ "graphql-scalars": "catalog:",
120
+ "knitwork": "catalog:",
121
+ "ohash": "catalog:",
122
+ "oxc-parser": "catalog:",
123
+ "pathe": "catalog:",
124
+ "tinyglobby": "catalog:"
109
125
  },
110
126
  "devDependencies": {
111
- "@antfu/eslint-config": "^6.2.0",
112
- "@nuxt/kit": "^4.2.1",
113
- "@nuxt/schema": "^4.2.1",
114
- "@types/node": "^24.10.1",
115
- "@vitejs/devtools": "^0.0.0-alpha.16",
116
- "bumpp": "^10.3.1",
117
- "changelogen": "^0.6.2",
118
- "crossws": "^0.4.1",
119
- "eslint": "^9.39.1",
120
- "graphql": "^16.12.0",
121
- "graphql-yoga": "^5.16.2",
122
- "h3": "^2.0.1-rc.5",
123
- "nitro": "npm:nitro-nightly@latest",
124
- "tsdown": "^0.16.4",
125
- "typescript": "^5.9.3",
126
- "vite": "npm:rolldown-vite@latest",
127
- "vitepress-plugin-llms": "^1.9.1"
127
+ "@antfu/eslint-config": "catalog:",
128
+ "@nuxt/kit": "catalog:",
129
+ "@nuxt/schema": "catalog:",
130
+ "@types/node": "catalog:",
131
+ "@vitejs/devtools": "catalog:",
132
+ "bumpp": "catalog:",
133
+ "changelogen": "catalog:",
134
+ "crossws": "catalog:",
135
+ "eslint": "catalog:",
136
+ "graphql": "catalog:",
137
+ "graphql-yoga": "catalog:",
138
+ "nitro": "catalog:",
139
+ "tsdown": "catalog:",
140
+ "typescript": "catalog:",
141
+ "vite": "catalog:",
142
+ "vitepress-plugin-llms": "catalog:"
143
+ },
144
+ "pnpm": {
145
+ "overrides": {
146
+ "nitro": "npm:nitro-nightly@latest",
147
+ "vite": "npm:rolldown-vite@latest"
148
+ }
128
149
  },
129
150
  "resolutions": {
130
151
  "nitro-graphql": "link:."
131
- },
132
- "scripts": {
133
- "build": "tsdown",
134
- "dev": "tsdown --watch",
135
- "bumpp": "bumpp package.json",
136
- "release": "pnpm build && pnpm bumpp && pnpm publish --no-git-checks --access public",
137
- "playground:nitro": "cd playgrounds/nitro && pnpm install && pnpm dev",
138
- "playground:nuxt": "cd playgrounds/nuxt && pnpm install && pnpm dev",
139
- "playground:federation": "cd playgrounds/federation && pnpm install && pnpm dev",
140
- "docs:dev": "cd .docs && pnpm install && pnpm update:metadata && pnpm dev",
141
- "docs:build": "cd .docs && pnpm install && pnpm update:metadata && pnpm build",
142
- "docs:preview": "cd .docs && pnpm preview",
143
- "lint": "eslint .",
144
- "lint:fix": "eslint . --fix",
145
- "test:types": "tsc --noEmit"
146
152
  }
147
- }
153
+ }