nitro-graphql 2.0.0-beta.10 → 2.0.0-beta.12
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 +2 -2
- package/dist/index.js +8 -8
- package/dist/routes/apollo-server.d.ts +2 -2
- package/dist/routes/debug.d.ts +2 -2
- package/dist/routes/debug.js +3 -7
- package/dist/routes/health.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
3
|
+
import * as nitro_types0 from "nitro/types";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
|
-
declare const _default:
|
|
6
|
+
declare const _default: nitro_types0.NitroModule;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ClientUtilsConfig, CodegenClientConfig, CodegenServerConfig, ExternalGraphQLService, ExternalServicePaths, FederationConfig, FileGenerationConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions, PathsConfig, ScaffoldConfig, SdkConfig, StandardSchemaV1, TypesConfig, _default as default };
|
package/dist/index.js
CHANGED
|
@@ -25,8 +25,8 @@ var src_default = defineNitroModule({
|
|
|
25
25
|
}
|
|
26
26
|
consola.info(`Configured ${nitro.options.graphql.externalServices.length} external GraphQL services`);
|
|
27
27
|
}
|
|
28
|
-
const { getDefaultPaths
|
|
29
|
-
const defaultPaths = getDefaultPaths
|
|
28
|
+
const { getDefaultPaths } = await import("./utils/path-resolver.js");
|
|
29
|
+
const defaultPaths = getDefaultPaths(nitro);
|
|
30
30
|
nitro.graphql ||= {
|
|
31
31
|
buildDir: "",
|
|
32
32
|
watchDirs: [],
|
|
@@ -215,6 +215,11 @@ var src_default = defineNitroModule({
|
|
|
215
215
|
const manualChunks = rollupConfig$1.output?.manualChunks;
|
|
216
216
|
const chunkFiles = rollupConfig$1.output?.chunkFileNames;
|
|
217
217
|
if (!rollupConfig$1.output.inlineDynamicImports) {
|
|
218
|
+
rollupConfig$1.output.manualChunks = (id, meta) => {
|
|
219
|
+
if (id.endsWith(".graphql") || id.endsWith(".gql")) return "schemas";
|
|
220
|
+
if (id.endsWith(".resolver.ts")) return "resolvers";
|
|
221
|
+
if (typeof manualChunks === "function") return manualChunks(id, meta);
|
|
222
|
+
};
|
|
218
223
|
rollupConfig$1.output.advancedChunks = { groups: [{
|
|
219
224
|
name: "schemas",
|
|
220
225
|
test: /\.(?:graphql|gql)$/
|
|
@@ -222,11 +227,6 @@ var src_default = defineNitroModule({
|
|
|
222
227
|
name: "resolvers",
|
|
223
228
|
test: /\.resolver\.ts$/
|
|
224
229
|
}] };
|
|
225
|
-
rollupConfig$1.output.manualChunks = (id, meta) => {
|
|
226
|
-
if (id.endsWith(".graphql") || id.endsWith(".gql")) return "schemas";
|
|
227
|
-
if (id.endsWith(".resolver.ts")) return "resolvers";
|
|
228
|
-
if (typeof manualChunks === "function") return manualChunks(id, meta);
|
|
229
|
-
};
|
|
230
230
|
}
|
|
231
231
|
rollupConfig$1.output.chunkFileNames = (chunkInfo) => {
|
|
232
232
|
if (chunkInfo.moduleIds && chunkInfo.moduleIds.some((id) => id.endsWith(".graphql") || id.endsWith(".resolver.ts") || id.endsWith(".gql"))) return `chunks/graphql/[name].mjs`;
|
|
@@ -252,7 +252,7 @@ var src_default = defineNitroModule({
|
|
|
252
252
|
if (nuxtOptions) nuxtOptions.nitroGraphqlExternalServices = nitro.options.graphql?.externalServices || [];
|
|
253
253
|
});
|
|
254
254
|
if (shouldGenerateScaffold(nitro)) {
|
|
255
|
-
const placeholders = getDefaultPaths
|
|
255
|
+
const placeholders = getDefaultPaths(nitro);
|
|
256
256
|
const scaffoldConfig = getScaffoldConfig(nitro);
|
|
257
257
|
const graphqlConfigPath = resolveFilePath(scaffoldConfig.graphqlConfig, scaffoldConfig.enabled, true, "graphql.config.ts", placeholders);
|
|
258
258
|
if (graphqlConfigPath) writeFileIfNotExists(graphqlConfigPath, `
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h33 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/apollo-server.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: h33.EventHandlerWithFetch<h33.EventHandlerRequest, Promise<any>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { _default as default };
|
package/dist/routes/debug.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h31 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:
|
|
13
|
+
declare const _default: h31.EventHandlerWithFetch<h31.EventHandlerRequest, Promise<string | {
|
|
14
14
|
timestamp: string;
|
|
15
15
|
environment: {
|
|
16
16
|
dev: any;
|
package/dist/routes/debug.js
CHANGED
|
@@ -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
|
|
5
|
+
import { defineEventHandler, getQuery } from "h3";
|
|
6
6
|
import { debugInfo } from "#nitro-graphql/debug-info";
|
|
7
7
|
|
|
8
8
|
//#region src/routes/debug.ts
|
|
@@ -15,10 +15,6 @@ import { debugInfo } from "#nitro-graphql/debug-info";
|
|
|
15
15
|
* - /_nitro/graphql/debug?format=json - JSON API
|
|
16
16
|
*/
|
|
17
17
|
var debug_default = defineEventHandler(async (event) => {
|
|
18
|
-
if (!debugInfo.isDev) {
|
|
19
|
-
setResponseHeader(event, "Content-Type", "text/plain");
|
|
20
|
-
return "Debug endpoint is only available in development mode";
|
|
21
|
-
}
|
|
22
18
|
const format = getQuery(event).format || "html";
|
|
23
19
|
const processedResolverFiles = debugInfo.scanned.resolverFiles.map((r) => {
|
|
24
20
|
const parts = r.specifier.split("/");
|
|
@@ -94,10 +90,10 @@ var debug_default = defineEventHandler(async (event) => {
|
|
|
94
90
|
}
|
|
95
91
|
};
|
|
96
92
|
if (format === "json") {
|
|
97
|
-
|
|
93
|
+
event.res.headers.set("Content-Type", "application/json");
|
|
98
94
|
return fullDebugInfo;
|
|
99
95
|
}
|
|
100
|
-
|
|
96
|
+
event.res.headers.set("Content-Type", "text/html");
|
|
101
97
|
return generateHtmlDashboard(fullDebugInfo);
|
|
102
98
|
});
|
|
103
99
|
function generateHtmlDashboard(debugInfo$1) {
|
package/dist/routes/health.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h35 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/health.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: h35.EventHandlerWithFetch<h35.EventHandlerRequest, Promise<{
|
|
5
5
|
status: string;
|
|
6
6
|
message: string;
|
|
7
7
|
timestamp: string;
|