nitro-graphql 1.7.0-beta.1 → 1.7.0-beta.2
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/routes/debug.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h37 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/debug.d.ts
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ import * as h35 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: h37.EventHandler<h37.EventHandlerRequest, Promise<string | {
|
|
14
14
|
timestamp: string;
|
|
15
15
|
environment: {
|
|
16
16
|
dev: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h31 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/graphql-yoga-ws.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: h31.EventHandler<h31.EventHandlerRequest, never>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { _default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as h30 from "h3";
|
|
2
2
|
|
|
3
3
|
//#region src/routes/graphql-yoga.d.ts
|
|
4
|
-
declare const _default:
|
|
4
|
+
declare const _default: h30.EventHandler<h30.EventHandlerRequest, Promise<Response>>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { _default as default };
|
package/dist/routes/health.d.mts
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;
|
|
@@ -287,12 +287,6 @@ export function getSdk(requester: Requester): Sdk {
|
|
|
287
287
|
async function generateExternalClientTypes(service, schema, docs, virtualTypesPath) {
|
|
288
288
|
return generateClientTypes(schema, docs, service.codegen?.client || {}, service.codegen?.clientSDK || {}, void 0, service.name, virtualTypesPath, false);
|
|
289
289
|
}
|
|
290
|
-
/**
|
|
291
|
-
* Convert PascalCase to camelCase
|
|
292
|
-
*/
|
|
293
|
-
function toCamelCase(str) {
|
|
294
|
-
return str.charAt(0).toLowerCase() + str.slice(1);
|
|
295
|
-
}
|
|
296
290
|
function extractSubscriptions(docs) {
|
|
297
291
|
const subscriptions = [];
|
|
298
292
|
for (const doc of docs) {
|
|
@@ -307,7 +301,6 @@ function extractSubscriptions(docs) {
|
|
|
307
301
|
const hasVariables = (operationDef.variableDefinitions?.length || 0) > 0;
|
|
308
302
|
subscriptions.push({
|
|
309
303
|
name,
|
|
310
|
-
methodName: toCamelCase(name),
|
|
311
304
|
fieldName,
|
|
312
305
|
hasVariables
|
|
313
306
|
});
|
|
@@ -439,11 +432,11 @@ function createSubscriptionBuilder<TData>(query: string, variables: unknown): Su
|
|
|
439
432
|
|
|
440
433
|
export const subscription = {
|
|
441
434
|
`;
|
|
442
|
-
for (const sub of subscriptions) if (sub.hasVariables) output += ` ${sub.
|
|
435
|
+
for (const sub of subscriptions) if (sub.hasVariables) output += ` ${sub.name}(variables: Types.${sub.name}SubscriptionVariables): SubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']> {
|
|
443
436
|
return createSubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']>(${sub.name}Document, variables)
|
|
444
437
|
},
|
|
445
438
|
`;
|
|
446
|
-
else output += ` ${sub.
|
|
439
|
+
else output += ` ${sub.name}(): SubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']> {
|
|
447
440
|
return createSubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']>(${sub.name}Document, undefined)
|
|
448
441
|
},
|
|
449
442
|
`;
|