nitro-graphql 1.0.4 → 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/ecosystem/nuxt.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _nuxt_schema7 from "@nuxt/schema";
|
|
2
2
|
|
|
3
3
|
//#region src/ecosystem/nuxt.d.ts
|
|
4
4
|
interface ModuleOptions {}
|
|
5
|
-
declare const _default:
|
|
5
|
+
declare const _default: _nuxt_schema7.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ModuleOptions, _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(config, defaultConfig);
|
|
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",
|
|
@@ -39,7 +43,7 @@ async function generateTypes(schema, config = {}, outputPath) {
|
|
|
39
43
|
declarationKind: "interface",
|
|
40
44
|
enumsAsTypes: true
|
|
41
45
|
};
|
|
42
|
-
const mergedConfig = defu$1(
|
|
46
|
+
const mergedConfig = defu$1(defaultConfig, config);
|
|
43
47
|
const output = await codegen({
|
|
44
48
|
filename: outputPath || "types.generated.ts",
|
|
45
49
|
schema: parse(printSchemaWithDirectives(schema)),
|