nitro-graphql 1.0.2 → 1.0.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/ecosystem/nuxt.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _nuxt_schema5 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_schema5.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ModuleOptions, _default as default };
|
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 h36 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/health.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: h36.EventHandler<h36.EventHandlerRequest, Promise<{
|
|
5
5
|
status: string;
|
|
6
6
|
message: string;
|
|
7
7
|
timestamp: string;
|
|
@@ -14,7 +14,6 @@ function generateNuxtOfetchClient(clientDir) {
|
|
|
14
14
|
if (!existsSync(ofetchPath)) {
|
|
15
15
|
const ofetchContent = `// This file is auto-generated once by nitro-graphql for quick start
|
|
16
16
|
// You can modify this file according to your needs
|
|
17
|
-
import type { ExecutionResult } from 'graphql'
|
|
18
17
|
import type { Requester } from './sdk'
|
|
19
18
|
import { getSdk } from './sdk'
|
|
20
19
|
|
|
@@ -29,11 +28,9 @@ export function createGraphQLClient(endpoint: string): Requester {
|
|
|
29
28
|
'Content-Type': 'application/json',
|
|
30
29
|
...headers,
|
|
31
30
|
},
|
|
32
|
-
})
|
|
31
|
+
})
|
|
33
32
|
|
|
34
|
-
return result
|
|
35
|
-
? Promise.reject(new Error(result.errors[0]?.message || 'GraphQL error'))
|
|
36
|
-
: result.data as R
|
|
33
|
+
return result as R
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
|
|
@@ -81,7 +78,9 @@ async function clientTypeGeneration(nitro) {
|
|
|
81
78
|
if (types === false) return;
|
|
82
79
|
const clientTypesPath = resolve(nitro.options.buildDir, "types", "nitro-graphql-client.d.ts");
|
|
83
80
|
const sdkTypesPath = resolve(nitro.graphql.clientDir, "sdk.ts");
|
|
81
|
+
mkdirSync(dirname(clientTypesPath), { recursive: true });
|
|
84
82
|
writeFileSync(clientTypesPath, types.types, "utf-8");
|
|
83
|
+
mkdirSync(dirname(sdkTypesPath), { recursive: true });
|
|
85
84
|
writeFileSync(sdkTypesPath, types.sdk, "utf-8");
|
|
86
85
|
if (nitro.options.framework?.name === "nuxt") generateNuxtOfetchClient(nitro.graphql.clientDir);
|
|
87
86
|
} catch (error) {
|