nitro-graphql 1.0.5 → 1.0.6
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,9 +1,9 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from "./types/standard-schema.js";
|
|
2
2
|
import { CodegenClientConfig, CodegenServerConfig, GenImport, GenericSdkConfig, NitroGraphQLOptions } from "./types/index.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as nitropack4 from "nitropack";
|
|
4
4
|
|
|
5
5
|
//#region src/index.d.ts
|
|
6
6
|
type GraphQLFramework = 'graphql-yoga';
|
|
7
|
-
declare const _default:
|
|
7
|
+
declare const _default: nitropack4.NitroModule;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { CodegenClientConfig, CodegenServerConfig, GenImport, GenericSdkConfig, GraphQLFramework, NitroGraphQLOptions, StandardSchemaV1, _default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h30 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/apollo-server.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: h30.EventHandler<h30.EventHandlerRequest, any>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { _default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h32 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/graphql-yoga.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: h32.EventHandler<h32.EventHandlerRequest, Promise<Response>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { _default as default };
|
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.EventHandler<h35.EventHandlerRequest, Promise<{
|
|
5
5
|
status: string;
|
|
6
6
|
message: string;
|
|
7
7
|
timestamp: string;
|
|
@@ -9,6 +9,7 @@ import { plugin as plugin$1 } from "@graphql-codegen/typescript-generic-sdk";
|
|
|
9
9
|
import { plugin as plugin$2 } from "@graphql-codegen/typescript-operations";
|
|
10
10
|
import { GraphQLFileLoader } from "@graphql-tools/graphql-file-loader";
|
|
11
11
|
import { loadDocuments, loadSchemaSync } from "@graphql-tools/load";
|
|
12
|
+
import { CurrencyResolver, DateTimeISOResolver, DateTimeResolver, JSONObjectResolver, JSONResolver, NonEmptyStringResolver, UUIDResolver } from "graphql-scalars";
|
|
12
13
|
|
|
13
14
|
//#region src/utils/client-codegen.ts
|
|
14
15
|
function pluginContent(_schema, _documents, _config, _info) {
|
|
@@ -60,31 +61,26 @@ async function generateClientTypes(schema, docs, config = {}, sdkConfig = {}, ou
|
|
|
60
61
|
strictScalars: true,
|
|
61
62
|
maybeValue: "T | null | undefined",
|
|
62
63
|
inputMaybeValue: "T | undefined",
|
|
63
|
-
scalars: {
|
|
64
|
-
DateTime: "string",
|
|
65
|
-
JSON: "any",
|
|
66
|
-
UUID: "string",
|
|
67
|
-
NonEmptyString: "string",
|
|
68
|
-
Currency: "string"
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const mergedConfig = defu$1(defaultConfig, config);
|
|
72
|
-
const defaultSdkConfig = {
|
|
73
64
|
documentMode: "string",
|
|
74
65
|
pureMagicComment: true,
|
|
75
|
-
strictScalars: true,
|
|
76
|
-
useTypeImports: true,
|
|
77
66
|
dedupeOperationSuffix: true,
|
|
78
67
|
rawRequest: true,
|
|
79
68
|
scalars: {
|
|
80
|
-
DateTime:
|
|
81
|
-
|
|
82
|
-
UUID:
|
|
83
|
-
|
|
84
|
-
|
|
69
|
+
DateTime: DateTimeResolver.extensions.codegenScalarType,
|
|
70
|
+
DateTimeISO: DateTimeISOResolver.extensions.codegenScalarType,
|
|
71
|
+
UUID: UUIDResolver.extensions.codegenScalarType,
|
|
72
|
+
JSON: JSONResolver.extensions.codegenScalarType,
|
|
73
|
+
JSONObject: JSONObjectResolver.extensions.codegenScalarType,
|
|
74
|
+
NonEmptyString: NonEmptyStringResolver.extensions.codegenScalarType,
|
|
75
|
+
Currency: CurrencyResolver.extensions.codegenScalarType,
|
|
76
|
+
File: {
|
|
77
|
+
input: "File",
|
|
78
|
+
output: "File"
|
|
79
|
+
}
|
|
85
80
|
}
|
|
86
81
|
};
|
|
87
|
-
const
|
|
82
|
+
const mergedConfig = defu$1(defaultConfig, config);
|
|
83
|
+
const mergedSdkConfig = defu$1(mergedConfig, sdkConfig);
|
|
88
84
|
try {
|
|
89
85
|
const output = await codegen({
|
|
90
86
|
filename: outputPath || "client-types.generated.ts",
|
|
@@ -4,6 +4,7 @@ import { parse } from "graphql";
|
|
|
4
4
|
import { printSchemaWithDirectives } from "@graphql-tools/utils";
|
|
5
5
|
import { codegen } from "@graphql-codegen/core";
|
|
6
6
|
import * as typescriptPlugin from "@graphql-codegen/typescript";
|
|
7
|
+
import { CurrencyResolver, DateTimeISOResolver, DateTimeResolver, JSONObjectResolver, JSONResolver, NonEmptyStringResolver, UUIDResolver } from "graphql-scalars";
|
|
7
8
|
import * as typescriptResolversPlugin from "@graphql-codegen/typescript-resolvers";
|
|
8
9
|
|
|
9
10
|
//#region src/utils/server-codegen.ts
|
|
@@ -22,13 +23,16 @@ function pluginContent(_schema, _documents, _config, _info) {
|
|
|
22
23
|
async function generateTypes(schema, config = {}, outputPath) {
|
|
23
24
|
const defaultConfig = {
|
|
24
25
|
scalars: {
|
|
26
|
+
DateTime: DateTimeResolver.extensions.codegenScalarType,
|
|
27
|
+
DateTimeISO: DateTimeISOResolver.extensions.codegenScalarType,
|
|
28
|
+
UUID: UUIDResolver.extensions.codegenScalarType,
|
|
29
|
+
JSON: JSONResolver.extensions.codegenScalarType,
|
|
30
|
+
JSONObject: JSONObjectResolver.extensions.codegenScalarType,
|
|
31
|
+
NonEmptyString: NonEmptyStringResolver.extensions.codegenScalarType,
|
|
32
|
+
Currency: CurrencyResolver.extensions.codegenScalarType,
|
|
25
33
|
File: {
|
|
26
34
|
input: "File",
|
|
27
35
|
output: "File"
|
|
28
|
-
},
|
|
29
|
-
Cursor: {
|
|
30
|
-
input: "number",
|
|
31
|
-
output: "number"
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
defaultScalarType: "unknown",
|