nitro-graphql 2.0.0-beta.13 → 2.0.0-beta.14

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.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { StandardSchemaV1 } from "./types/standard-schema.js";
2
2
  import { ClientUtilsConfig, CodegenClientConfig, CodegenServerConfig, ExternalGraphQLService, ExternalServicePaths, FederationConfig, FileGenerationConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions, PathsConfig, ScaffoldConfig, SdkConfig, TypesConfig } from "./types/index.js";
3
- import * as nitro_types0 from "nitro/types";
3
+ import * as nitropack_types0 from "nitropack/types";
4
4
 
5
5
  //#region src/index.d.ts
6
6
  /**
7
7
  * Nitro GraphQL module
8
8
  * Can be used via modules array in nitro.config.ts
9
9
  */
10
- declare const _default: nitro_types0.NitroModule;
10
+ declare const _default: nitropack_types0.NitroModule;
11
11
  //#endregion
12
12
  export { ClientUtilsConfig, CodegenClientConfig, CodegenServerConfig, ExternalGraphQLService, ExternalServicePaths, FederationConfig, FileGenerationConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions, PathsConfig, ScaffoldConfig, SdkConfig, StandardSchemaV1, TypesConfig, _default as default };
@@ -1,4 +1,4 @@
1
- import * as h33 from "h3";
1
+ import * as h35 from "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: h35.EventHandlerWithFetch<h35.EventHandlerRequest, Promise<string | {
14
14
  timestamp: string;
15
15
  environment: {
16
16
  dev: any;
@@ -1,6 +1,6 @@
1
- import * as h35 from "h3";
1
+ import * as h31 from "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: h31.EventHandlerWithFetch<h31.EventHandlerRequest, Promise<Response>>;
5
5
  //#endregion
6
6
  export { _default as default };
@@ -1,7 +1,7 @@
1
- import * as h31 from "h3";
1
+ import * as h33 from "h3";
2
2
 
3
3
  //#region src/routes/health.d.ts
4
- declare const _default: h31.EventHandlerWithFetch<h31.EventHandlerRequest, Promise<{
4
+ declare const _default: h33.EventHandlerWithFetch<h33.EventHandlerRequest, Promise<{
5
5
  status: string;
6
6
  message: string;
7
7
  timestamp: string;
@@ -78,7 +78,7 @@ function shouldGenerateClientUtils(nitro) {
78
78
  const clientUtilsConfig = nitro.options.graphql?.clientUtils;
79
79
  if (clientUtilsConfig === false) return false;
80
80
  if (clientUtilsConfig && clientUtilsConfig.enabled === false) return false;
81
- return nitro.options.framework?.name === "nuxt";
81
+ return true;
82
82
  }
83
83
  /**
84
84
  * Get client utilities configuration (handles false case)
@@ -298,11 +298,9 @@ async function generateMainClientTypes(nitro) {
298
298
  writeFileSync(sdkPath, types.sdk, "utf-8");
299
299
  consola.success(`[nitro-graphql] Generated SDK at: ${sdkPath}`);
300
300
  }
301
- if (nitro.options.framework?.name === "nuxt") {
302
- generateNuxtOfetchClient(nitro, nitro.graphql.clientDir, "default");
303
- const externalServices = nitro.options.graphql?.externalServices || [];
304
- generateGraphQLIndexFile(nitro, nitro.graphql.clientDir, externalServices);
305
- }
301
+ generateNuxtOfetchClient(nitro, nitro.graphql.clientDir, "default");
302
+ const externalServices = nitro.options.graphql?.externalServices || [];
303
+ if (externalServices.length > 0) generateGraphQLIndexFile(nitro, nitro.graphql.clientDir, externalServices);
306
304
  }
307
305
  async function generateExternalServicesTypes(nitro) {
308
306
  const externalServices = nitro.options.graphql?.externalServices || [];
@@ -349,7 +347,7 @@ async function generateExternalServicesTypes(nitro) {
349
347
  writeFileSync(serviceSdkPath, types.sdk, "utf-8");
350
348
  consola.success(`[graphql:${service.name}] Generated SDK at: ${serviceSdkPath}`);
351
349
  }
352
- if (nitro.options.framework?.name === "nuxt") generateExternalOfetchClient(nitro, service, service.endpoint);
350
+ generateExternalOfetchClient(nitro, service, service.endpoint);
353
351
  consola.success(`[graphql:${service.name}] External service types generated successfully`);
354
352
  } catch (error) {
355
353
  consola.error(`[graphql:${service.name}] External service generation failed:`, error);
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.13",
4
+ "version": "2.0.0-beta.14",
5
+ "packageManager": "pnpm@10.20.0",
5
6
  "description": "GraphQL integration for Nitro",
6
7
  "license": "MIT",
7
8
  "sideEffects": false,
@@ -86,6 +87,21 @@
86
87
  "files": [
87
88
  "dist"
88
89
  ],
90
+ "scripts": {
91
+ "prepack": "pnpm build",
92
+ "build": "tsdown",
93
+ "dev": "tsdown --watch",
94
+ "bumpp": "bumpp package.json",
95
+ "release": "pnpm build && pnpm bumpp && pnpm publish --no-git-checks --access public",
96
+ "playground:nitro": "cd playgrounds/nitro && pnpm install && pnpm dev",
97
+ "playground:nuxt": "cd playgrounds/nuxt && pnpm install && pnpm dev",
98
+ "playground:federation": "cd playgrounds/federation && pnpm install && pnpm dev",
99
+ "docs:dev": "cd .docs && pnpm install && pnpm dev",
100
+ "docs:build": "cd .docs && pnpm install && pnpm build",
101
+ "docs:preview": "cd .docs && pnpm preview",
102
+ "lint": "eslint .",
103
+ "lint:fix": "eslint . --fix"
104
+ },
89
105
  "peerDependencies": {
90
106
  "@apollo/server": "^5.0.0",
91
107
  "@apollo/utils.withrequired": "^3.0.0",
@@ -106,63 +122,49 @@
106
122
  }
107
123
  },
108
124
  "dependencies": {
109
- "@apollo/subgraph": "^2.11.3",
110
- "@graphql-codegen/core": "^5.0.0",
111
- "@graphql-codegen/import-types-preset": "^3.0.1",
112
- "@graphql-codegen/typescript": "^5.0.2",
113
- "@graphql-codegen/typescript-generic-sdk": "^4.0.2",
114
- "@graphql-codegen/typescript-operations": "^5.0.2",
115
- "@graphql-codegen/typescript-resolvers": "^5.1.0",
116
- "@graphql-tools/graphql-file-loader": "^8.1.3",
117
- "@graphql-tools/load": "^8.1.3",
118
- "@graphql-tools/load-files": "^7.0.1",
119
- "@graphql-tools/merge": "^9.1.2",
120
- "@graphql-tools/schema": "^10.0.26",
121
- "@graphql-tools/url-loader": "^9.0.1",
122
- "@graphql-tools/utils": "^10.10.0",
123
- "chokidar": "^4.0.3",
124
- "consola": "^3.4.2",
125
- "defu": "^6.1.4",
126
- "graphql-config": "^5.1.5",
127
- "graphql-scalars": "^1.25.0",
128
- "knitwork": "^1.2.0",
129
- "ohash": "^2.0.11",
130
- "oxc-parser": "^0.96.0",
131
- "pathe": "^2.0.3",
132
- "tinyglobby": "^0.2.15"
125
+ "@apollo/subgraph": "catalog:",
126
+ "@graphql-codegen/core": "catalog:",
127
+ "@graphql-codegen/import-types-preset": "catalog:",
128
+ "@graphql-codegen/typescript": "catalog:",
129
+ "@graphql-codegen/typescript-generic-sdk": "catalog:",
130
+ "@graphql-codegen/typescript-operations": "catalog:",
131
+ "@graphql-codegen/typescript-resolvers": "catalog:",
132
+ "@graphql-tools/graphql-file-loader": "catalog:",
133
+ "@graphql-tools/load": "catalog:",
134
+ "@graphql-tools/load-files": "catalog:",
135
+ "@graphql-tools/merge": "catalog:",
136
+ "@graphql-tools/schema": "catalog:",
137
+ "@graphql-tools/url-loader": "catalog:",
138
+ "@graphql-tools/utils": "catalog:",
139
+ "chokidar": "catalog:",
140
+ "consola": "catalog:",
141
+ "defu": "catalog:",
142
+ "graphql-config": "catalog:",
143
+ "graphql-scalars": "catalog:",
144
+ "knitwork": "catalog:",
145
+ "ohash": "catalog:",
146
+ "oxc-parser": "catalog:",
147
+ "pathe": "catalog:",
148
+ "tinyglobby": "catalog:"
133
149
  },
134
150
  "devDependencies": {
135
- "@antfu/eslint-config": "^6.2.0",
136
- "@nuxt/kit": "^4.2.0",
137
- "@nuxt/schema": "^4.2.0",
138
- "@types/node": "^24.10.0",
139
- "bumpp": "^10.3.1",
140
- "changelogen": "^0.6.2",
141
- "crossws": "0.3.5",
142
- "eslint": "^9.39.0",
143
- "graphql": "16.11.0",
144
- "graphql-yoga": "^5.16.0",
145
- "h3": "^2.0.1-rc.5",
146
- "nitro": "^3.0.1-alpha.0",
147
- "tsdown": "^0.15.12",
148
- "typescript": "^5.9.3",
151
+ "@antfu/eslint-config": "catalog:",
152
+ "@nuxt/kit": "catalog:",
153
+ "@nuxt/schema": "catalog:",
154
+ "@types/node": "catalog:",
155
+ "bumpp": "catalog:",
156
+ "changelogen": "catalog:",
157
+ "crossws": "catalog:",
158
+ "eslint": "catalog:",
159
+ "graphql": "catalog:",
160
+ "graphql-yoga": "catalog:",
161
+ "h3": "catalog:",
162
+ "nitro": "catalog:",
163
+ "tsdown": "catalog:",
164
+ "typescript": "catalog:",
149
165
  "vitepress-plugin-llms": "^1.8.1"
150
166
  },
151
167
  "resolutions": {
152
168
  "nitro-graphql": "link:."
153
- },
154
- "scripts": {
155
- "build": "tsdown",
156
- "dev": "tsdown --watch",
157
- "bumpp": "bumpp package.json",
158
- "release": "pnpm build && pnpm bumpp && pnpm publish --no-git-checks --access public",
159
- "playground:nitro": "cd playgrounds/nitro && pnpm install && pnpm dev",
160
- "playground:nuxt": "cd playgrounds/nuxt && pnpm install && pnpm dev",
161
- "playground:federation": "cd playgrounds/federation && pnpm install && pnpm dev",
162
- "docs:dev": "cd .docs && pnpm install && pnpm dev",
163
- "docs:build": "cd .docs && pnpm install && pnpm build",
164
- "docs:preview": "cd .docs && pnpm preview",
165
- "lint": "eslint .",
166
- "lint:fix": "eslint . --fix"
167
169
  }
168
- }
170
+ }