nitro-graphql 1.5.7 → 1.5.9
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/ecosystem/{nuxt.mjs → nuxt.js} +1 -1
- package/dist/{index.d.mts → index.d.ts} +4 -3
- package/dist/{index.mjs → index.js} +6 -6
- package/dist/{rollup.mjs → rollup.js} +2 -2
- package/dist/routes/apollo-server.d.ts +6 -0
- package/dist/routes/{debug.d.mts → debug.d.ts} +2 -2
- package/dist/routes/graphql-yoga.d.ts +6 -0
- package/dist/routes/health.d.ts +10 -0
- package/dist/types/{index.d.mts → index.d.ts} +1 -1
- package/dist/types/{standard-schema.d.mts → standard-schema.d.ts} +2 -2
- package/dist/utils/{client-codegen.d.mts → client-codegen.d.ts} +1 -1
- package/dist/utils/{index.d.mts → index.d.ts} +2 -2
- package/dist/utils/{index.mjs → index.js} +1 -1
- package/dist/utils/{path-resolver.d.mts → path-resolver.d.ts} +1 -1
- package/dist/utils/{server-codegen.d.mts → server-codegen.d.ts} +1 -1
- package/dist/utils/{server-codegen.mjs → server-codegen.js} +19 -14
- package/dist/utils/{type-generation.mjs → type-generation.js} +4 -4
- package/package.json +1 -1
- package/dist/routes/apollo-server.d.mts +0 -6
- package/dist/routes/graphql-yoga.d.mts +0 -6
- package/dist/routes/health.d.mts +0 -10
- /package/dist/ecosystem/{nuxt.d.mts → nuxt.d.ts} +0 -0
- /package/dist/graphql/{index.d.mts → index.d.ts} +0 -0
- /package/dist/graphql/{index.mjs → index.js} +0 -0
- /package/dist/graphql/{server.d.mts → server.d.ts} +0 -0
- /package/dist/graphql/{server.mjs → server.js} +0 -0
- /package/dist/routes/{apollo-server.mjs → apollo-server.js} +0 -0
- /package/dist/routes/{debug.mjs → debug.js} +0 -0
- /package/dist/routes/{graphql-yoga.mjs → graphql-yoga.js} +0 -0
- /package/dist/routes/{health.mjs → health.js} +0 -0
- /package/dist/utils/{apollo.d.mts → apollo.d.ts} +0 -0
- /package/dist/utils/{apollo.mjs → apollo.js} +0 -0
- /package/dist/utils/{client-codegen.mjs → client-codegen.js} +0 -0
- /package/dist/utils/{define.d.mts → define.d.ts} +0 -0
- /package/dist/utils/{define.mjs → define.js} +0 -0
- /package/dist/utils/{directive-parser.d.mts → directive-parser.d.ts} +0 -0
- /package/dist/utils/{directive-parser.mjs → directive-parser.js} +0 -0
- /package/dist/utils/{file-generator.d.mts → file-generator.d.ts} +0 -0
- /package/dist/utils/{file-generator.mjs → file-generator.js} +0 -0
- /package/dist/utils/{path-resolver.mjs → path-resolver.js} +0 -0
- /package/dist/utils/{type-generation.d.mts → type-generation.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDefaultPaths, getTypesConfig, resolveFilePath } from "../utils/path-resolver.
|
|
1
|
+
import { getDefaultPaths, getTypesConfig, resolveFilePath } from "../utils/path-resolver.js";
|
|
2
2
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, join, relative, resolve } from "pathe";
|
|
4
4
|
import { defineNuxtModule, getLayerDirectories } from "@nuxt/kit";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { StandardSchemaV1 } from "./types/standard-schema.
|
|
2
|
-
import { ClientUtilsConfig, CodegenClientConfig, CodegenServerConfig, ExternalGraphQLService, ExternalServicePaths, FederationConfig, FileGenerationConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions, PathsConfig, ScaffoldConfig, SdkConfig, TypesConfig } from "./types/index.
|
|
1
|
+
import { StandardSchemaV1 } from "./types/standard-schema.js";
|
|
2
|
+
import { ClientUtilsConfig, CodegenClientConfig, CodegenServerConfig, ExternalGraphQLService, ExternalServicePaths, FederationConfig, FileGenerationConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions, PathsConfig, ScaffoldConfig, SdkConfig, TypesConfig } from "./types/index.js";
|
|
3
|
+
import * as nitropack0 from "nitropack";
|
|
3
4
|
|
|
4
5
|
//#region src/index.d.ts
|
|
5
|
-
declare const _default:
|
|
6
|
+
declare const _default: nitropack0.NitroModule;
|
|
6
7
|
//#endregion
|
|
7
8
|
export { ClientUtilsConfig, CodegenClientConfig, CodegenServerConfig, ExternalGraphQLService, ExternalServicePaths, FederationConfig, FileGenerationConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions, PathsConfig, ScaffoldConfig, SdkConfig, StandardSchemaV1, TypesConfig, _default as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { generateDirectiveSchemas } from "./utils/directive-parser.
|
|
2
|
-
import { generateLayerIgnorePatterns, getLayerAppDirectories, getLayerServerDirectories, relativeWithDot, scanDirectives, scanDocs, scanResolvers, scanSchemas, validateExternalServices } from "./utils/index.
|
|
3
|
-
import { writeFileIfNotExists } from "./utils/file-generator.
|
|
4
|
-
import { getDefaultPaths, getScaffoldConfig, getTypesConfig, resolveFilePath, shouldGenerateScaffold } from "./utils/path-resolver.
|
|
5
|
-
import { clientTypeGeneration, serverTypeGeneration } from "./utils/type-generation.
|
|
6
|
-
import { rollupConfig } from "./rollup.
|
|
1
|
+
import { generateDirectiveSchemas } from "./utils/directive-parser.js";
|
|
2
|
+
import { generateLayerIgnorePatterns, getLayerAppDirectories, getLayerServerDirectories, relativeWithDot, scanDirectives, scanDocs, scanResolvers, scanSchemas, validateExternalServices } from "./utils/index.js";
|
|
3
|
+
import { writeFileIfNotExists } from "./utils/file-generator.js";
|
|
4
|
+
import { getDefaultPaths, getScaffoldConfig, getTypesConfig, resolveFilePath, shouldGenerateScaffold } from "./utils/path-resolver.js";
|
|
5
|
+
import { clientTypeGeneration, serverTypeGeneration } from "./utils/type-generation.js";
|
|
6
|
+
import { rollupConfig } from "./rollup.js";
|
|
7
7
|
import { existsSync, mkdirSync } from "node:fs";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { watch } from "chokidar";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getImportId, scanGraphql } from "./utils/index.
|
|
2
|
-
import { clientTypeGeneration, serverTypeGeneration } from "./utils/type-generation.
|
|
1
|
+
import { getImportId, scanGraphql } from "./utils/index.js";
|
|
2
|
+
import { clientTypeGeneration, serverTypeGeneration } from "./utils/type-generation.js";
|
|
3
3
|
import { resolve } from "pathe";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
5
5
|
import { parse } from "graphql";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
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:
|
|
13
|
+
declare const _default: h35.EventHandler<h35.EventHandlerRequest, Promise<string | {
|
|
14
14
|
timestamp: string;
|
|
15
15
|
environment: {
|
|
16
16
|
dev: any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StandardSchemaV1 } from "./standard-schema.
|
|
1
|
+
import { StandardSchemaV1 } from "./standard-schema.js";
|
|
2
2
|
import { ESMCodeGenOptions } from "knitwork";
|
|
3
3
|
import { IResolvers } from "@graphql-tools/utils";
|
|
4
4
|
import { TypeScriptPluginConfig } from "@graphql-codegen/typescript";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//#region src/types/standard-schema.d.ts
|
|
2
2
|
/** The Standard Schema interface. */
|
|
3
|
-
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
3
|
+
interface StandardSchemaV1<Input$1 = unknown, Output$1 = Input$1> {
|
|
4
4
|
/** The Standard Schema properties. */
|
|
5
|
-
readonly '~standard': StandardSchemaV1.Props<Input, Output>;
|
|
5
|
+
readonly '~standard': StandardSchemaV1.Props<Input$1, Output$1>;
|
|
6
6
|
}
|
|
7
7
|
declare namespace StandardSchemaV1 {
|
|
8
8
|
/** The Standard Schema properties interface. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodegenClientConfig, ExternalGraphQLService, GenericSdkConfig } from "../types/index.
|
|
1
|
+
import { CodegenClientConfig, ExternalGraphQLService, GenericSdkConfig } from "../types/index.js";
|
|
2
2
|
import { GraphQLSchema } from "graphql";
|
|
3
3
|
import { Source } from "@graphql-tools/utils";
|
|
4
4
|
import { LoadSchemaOptions, UnnormalizedTypeDefPointer } from "@graphql-tools/load";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GenImport } from "../types/index.
|
|
2
|
-
import { directiveParser, generateDirectiveSchema, generateDirectiveSchemas } from "./directive-parser.
|
|
1
|
+
import { GenImport } from "../types/index.js";
|
|
2
|
+
import { directiveParser, generateDirectiveSchema, generateDirectiveSchemas } from "./directive-parser.js";
|
|
3
3
|
import { Nitro } from "nitropack";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/index.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { directiveParser, generateDirectiveSchema, generateDirectiveSchemas } from "./directive-parser.
|
|
1
|
+
import { directiveParser, generateDirectiveSchema, generateDirectiveSchemas } from "./directive-parser.js";
|
|
2
2
|
import { join, relative } from "pathe";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { hash } from "ohash";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientUtilsConfig, FileGenerationConfig, ScaffoldConfig, SdkConfig, TypesConfig } from "../types/index.
|
|
1
|
+
import { ClientUtilsConfig, FileGenerationConfig, ScaffoldConfig, SdkConfig, TypesConfig } from "../types/index.js";
|
|
2
2
|
import { Nitro } from "nitropack/types";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/path-resolver.d.ts
|
|
@@ -98,25 +98,30 @@ type Primitive =
|
|
|
98
98
|
|
|
99
99
|
type BuiltIns = Primitive | void | Date | RegExp;
|
|
100
100
|
|
|
101
|
+
type IsLiteral<T> = T extends string
|
|
102
|
+
? string extends T
|
|
103
|
+
? false
|
|
104
|
+
: true
|
|
105
|
+
: false;
|
|
101
106
|
|
|
102
107
|
type ResolverReturnType<T> = T extends BuiltIns
|
|
103
|
-
? T
|
|
104
|
-
: T extends (...args: any[]) => unknown
|
|
105
|
-
? T | undefined
|
|
106
|
-
: T extends
|
|
107
|
-
? T
|
|
108
|
-
|
|
109
|
-
?
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
: { [K in keyof T]: ResolverReturnType<T[K]> }
|
|
114
|
-
: unknown;
|
|
108
|
+
? T
|
|
109
|
+
: T extends (...args: any[]) => unknown
|
|
110
|
+
? T | undefined
|
|
111
|
+
: T extends object
|
|
112
|
+
? T extends Array<infer ItemType>
|
|
113
|
+
? ItemType[] extends T
|
|
114
|
+
? Array<ResolverReturnType<ItemType>>
|
|
115
|
+
: ResolverReturnTypeObject<T>
|
|
116
|
+
: ResolverReturnTypeObject<T>
|
|
117
|
+
: unknown;
|
|
115
118
|
|
|
116
119
|
type ResolverReturnTypeObject<T extends object> =
|
|
117
120
|
T extends { __typename?: infer TTypename }
|
|
118
|
-
? TTypename extends
|
|
119
|
-
?
|
|
121
|
+
? IsLiteral<TTypename> extends true
|
|
122
|
+
? TTypename extends SchemaKeys
|
|
123
|
+
? InferOutputFromSchema<TTypename>
|
|
124
|
+
: { [K in keyof T]: ResolverReturnType<T[K]> }
|
|
120
125
|
: { [K in keyof T]: ResolverReturnType<T[K]> }
|
|
121
126
|
: { [K in keyof T]: ResolverReturnType<T[K]> };
|
|
122
127
|
`,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { downloadAndSaveSchema, generateClientTypes, generateExternalClientTypes, loadExternalSchema, loadGraphQLDocuments } from "./client-codegen.
|
|
2
|
-
import { writeFileIfNotExists } from "./file-generator.
|
|
3
|
-
import { getClientUtilsConfig, getDefaultPaths, getSdkConfig, getTypesConfig, resolveFilePath, shouldGenerateClientUtils, shouldGenerateTypes } from "./path-resolver.
|
|
4
|
-
import { generateTypes } from "./server-codegen.
|
|
1
|
+
import { downloadAndSaveSchema, generateClientTypes, generateExternalClientTypes, loadExternalSchema, loadGraphQLDocuments } from "./client-codegen.js";
|
|
2
|
+
import { writeFileIfNotExists } from "./file-generator.js";
|
|
3
|
+
import { getClientUtilsConfig, getDefaultPaths, getSdkConfig, getTypesConfig, resolveFilePath, shouldGenerateClientUtils, shouldGenerateTypes } from "./path-resolver.js";
|
|
4
|
+
import { generateTypes } from "./server-codegen.js";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
6
|
import consola from "consola";
|
|
7
7
|
import { basename, dirname, join, resolve } from "pathe";
|
package/package.json
CHANGED
package/dist/routes/health.d.mts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as h31 from "h3";
|
|
2
|
-
|
|
3
|
-
//#region src/routes/health.d.ts
|
|
4
|
-
declare const _default: h31.EventHandlerWithFetch<h31.EventHandlerRequest, Promise<{
|
|
5
|
-
status: string;
|
|
6
|
-
message: string;
|
|
7
|
-
timestamp: string;
|
|
8
|
-
}>>;
|
|
9
|
-
//#endregion
|
|
10
|
-
export { _default as default };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|