nitro-graphql 1.5.2 → 1.5.4

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.js CHANGED
@@ -237,8 +237,17 @@ var src_default = defineNitroModule({
237
237
  ...placeholders,
238
238
  serviceName: service.name
239
239
  };
240
+ consola.info(`[DEBUG] External service: ${service.name}`);
241
+ consola.info("[DEBUG] service.paths:", service.paths);
242
+ consola.info("[DEBUG] service.paths?.types:", service.paths?.types);
243
+ consola.info("[DEBUG] typesConfig.external:", typesConfig.external);
240
244
  const externalTypesPath = resolveFilePath(service.paths?.types ?? typesConfig.external, typesConfig.enabled, true, "{typesDir}/nitro-graphql-client-{serviceName}.d.ts", servicePlaceholders);
241
- if (externalTypesPath) types.tsConfig.compilerOptions.paths[`#graphql/client/${service.name}`] = [relativeWithDot(tsconfigDir, externalTypesPath)];
245
+ consola.info("[DEBUG] externalTypesPath after resolveFilePath:", externalTypesPath);
246
+ if (externalTypesPath) {
247
+ const relativePath = relativeWithDot(tsconfigDir, externalTypesPath);
248
+ consola.info("[DEBUG] relativePath after relativeWithDot:", relativePath);
249
+ types.tsConfig.compilerOptions.paths[`#graphql/client/${service.name}`] = [relativePath];
250
+ }
242
251
  }
243
252
  types.tsConfig.include = types.tsConfig.include || [];
244
253
  if (serverTypesPath) types.tsConfig.include.push(relativeWithDot(tsconfigDir, serverTypesPath));
@@ -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.EventHandler<h35.EventHandlerRequest, Promise<Response>>;
4
+ declare const _default: h31.EventHandler<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 h35 from "h3";
2
2
 
3
3
  //#region src/routes/health.d.ts
4
- declare const _default: h31.EventHandler<h31.EventHandlerRequest, Promise<{
4
+ declare const _default: h35.EventHandler<h35.EventHandlerRequest, Promise<{
5
5
  status: string;
6
6
  message: string;
7
7
  timestamp: string;
@@ -1,4 +1,4 @@
1
- import { resolve } from "pathe";
1
+ import { isAbsolute, resolve } from "pathe";
2
2
 
3
3
  //#region src/utils/path-resolver.ts
4
4
  /**
@@ -49,7 +49,7 @@ function resolveFilePath(config, categoryEnabled, topLevelEnabled, defaultPath,
49
49
  if (!shouldGenerateFile(config, categoryEnabled, topLevelEnabled)) return null;
50
50
  if (typeof config === "string") {
51
51
  const customPath = replacePlaceholders(config, placeholders);
52
- return resolve(placeholders.rootDir, customPath);
52
+ return isAbsolute(customPath) ? customPath : resolve(placeholders.rootDir, customPath);
53
53
  }
54
54
  const resolvedDefault = replacePlaceholders(defaultPath, placeholders);
55
55
  return resolve(placeholders.rootDir, resolvedDefault);
@@ -336,7 +336,12 @@ async function generateExternalServicesTypes(nitro) {
336
336
  };
337
337
  const typesConfig = getTypesConfig(nitro);
338
338
  const sdkConfig = getSdkConfig(nitro);
339
+ consola.info(`[TYPE-GEN DEBUG] External service: ${service.name}`);
340
+ consola.info("[TYPE-GEN DEBUG] service.paths:", service.paths);
341
+ consola.info("[TYPE-GEN DEBUG] service.paths?.types:", service.paths?.types);
342
+ consola.info("[TYPE-GEN DEBUG] typesConfig.external:", typesConfig.external);
339
343
  const serviceTypesPath = resolveFilePath(service.paths?.types ?? typesConfig.external, typesConfig.enabled, true, "{typesDir}/nitro-graphql-client-{serviceName}.d.ts", placeholders);
344
+ consola.info("[TYPE-GEN DEBUG] serviceTypesPath after resolveFilePath:", serviceTypesPath);
340
345
  if (serviceTypesPath) {
341
346
  mkdirSync(dirname(serviceTypesPath), { recursive: true });
342
347
  writeFileSync(serviceTypesPath, types.types, "utf-8");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nitro-graphql",
3
3
  "type": "module",
4
- "version": "1.5.2",
4
+ "version": "1.5.4",
5
5
  "description": "GraphQL integration for Nitro",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,